473,491 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Binary Division Problem Help

Hi,

I'm trying to work out a binary division problem

1100 / 101010101010111

Here is what I have so far but I'm not sure if I'm doing it correctly
and I'm suppose to continue the division until there is only a
remainder left

110
______________________
1100 [ 101010101010111
1100
_______________
1101
1100
_______________
01010
1100
_____________
110

I'm not sure if I'm doing this correctly and I don't really have a way
of checking if I'm doing it right. Does anyone know of a simple web
calculator that I can check against my answer or if someone could run
through this example with me, that would be great. thank you

Nov 30 '06 #1
22 5790
jamestuck21 wrote:
Hi,

I'm trying to work out a binary division problem
<snip>

Post to sci.math

Nov 30 '06 #2
"jamestuck21" <cp********@yahoo.comwrites:
I'm trying to work out a binary division problem

1100 / 101010101010111
The integer quotient is 0, as always when the divisor is greater
than the dividend, for positive operands. The remainder is 1100.
--
Ben Pfaff
email: bl*@cs.stanford.edu
web: http://benpfaff.org
Nov 30 '06 #3
On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:
Does anyone know of a simple web
calculator that I can check against my answer or if someone could run
through this example with me, that would be great. thank you
Does it have to be on the web? Since you're appear to be posting from
Windows, I'd suggest the Windows calculator, in scientific mode.

11100011100

--
Al Balmer
Sun City, AZ
Nov 30 '06 #4
Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
Al Balmer wrote:
On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:
Does anyone know of a simple web
calculator that I can check against my answer or if someone could run
through this example with me, that would be great. thank you

Does it have to be on the web? Since you're appear to be posting from
Windows, I'd suggest the Windows calculator, in scientific mode.

11100011100

--
Al Balmer
Sun City, AZ
Dec 1 '06 #5
"jamestuck21" <cp********@yahoo.comwrites:
An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
There's no way that the quotient to that division can be 101011.
That's as silly as saying that 1234 / 123456789 = 456789.
Dividing a small number by a large number yields 0, with the
small number as remainder.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Dec 1 '06 #6
This is an example on calculating the remainder in use with CRC. Maybe
I might of not explained it properly, but that is the correct solution
and this is using binary division to get a quotient and specifically
interested in the remainder value because that is the extra amount of
bits tacked onto a file for checksum.
Ben Pfaff wrote:
"jamestuck21" <cp********@yahoo.comwrites:
An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.

There's no way that the quotient to that division can be 101011.
That's as silly as saying that 1234 / 123456789 = 456789.
Dividing a small number by a large number yields 0, with the
small number as remainder.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Dec 1 '06 #7
Op 30 Nov 2006 16:23:36 -0800 schreef jamestuck21:
Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
Al Balmer wrote:
>On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:
>>Does anyone know of a simple web
calculator that I can check against my answer or if someone could run
through this example with me, that would be great. thank you

Does it have to be on the web? Since you're appear to be posting from
Windows, I'd suggest the Windows calculator, in scientific mode.

11100011100
<OT>
Why didn't you use the 'MOD' button on the Windows calculator?
(I am lucky to know Forth, '/MOD' gives the quotient and remaider at once.)
</OT>
--
Coos
Dec 1 '06 #8
The mod button does not give you the correct solution. It just returns
the original value that you're trying to use to divide into.
Coos Haak wrote:
Op 30 Nov 2006 16:23:36 -0800 schreef jamestuck21:
Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
Al Balmer wrote:
On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:

Does anyone know of a simple web
calculator that I can check against my answer or if someone could run
through this example with me, that would be great. thank you

Does it have to be on the web? Since you're appear to be posting from
Windows, I'd suggest the Windows calculator, in scientific mode.

11100011100
<OT>
Why didn't you use the 'MOD' button on the Windows calculator?
(I am lucky to know Forth, '/MOD' gives the quotient and remaider at once.)
</OT>
--
Coos
Dec 1 '06 #9
Op 30 Nov 2006 16:49:25 -0800 schreef jamestuck21:
Top-posting corrected.
Coos Haak wrote:
>Op 30 Nov 2006 16:23:36 -0800 schreef jamestuck21:
>>Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
Al Balmer wrote:
On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:

Does anyone know of a simple web
>calculator that I can check against my answer or if someone could run
>through this example with me, that would be great. thank you

Does it have to be on the web? Since you're appear to be posting from
Windows, I'd suggest the Windows calculator, in scientific mode.

11100011100
<OT>
Why didn't you use the 'MOD' button on the Windows calculator?
(I am lucky to know Forth, '/MOD' gives the quotient and remaider at once.)
</OT>
The mod button does not give you the correct solution. It just returns
the original value that you're trying to use to divide into.
Of course, the quotient is zero, so the remainder is the dividend, like Ben
Pfaff said. Simple maths.
--
Coos
Dec 1 '06 #10
Windows calculator does not give the correct solution.
>
An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
It appears from your scratch calculations in previous posts that you
really want to do 101110000 / 1001, i.e., 1001 divided into 101110000,
not divided by.

My copy of Windows calculator does this correctly. Converting to
decimal, the example you gave above is 368 / 9. The answer is 40, with
a remainder of 8, not 43 (= 101011 binary) with a remainder of 3 (= 011
binary) as you're claiming.

Michael

Dec 1 '06 #11
MQ

jamestuck21 wrote:
The mod button does not give you the correct solution. It just returns
the original value that you're trying to use to divide into.
Yes, and why is this not correct. What answer are you expecting? When
the dividend is smaller than the divisor the answer is always 0 rem
dividend.

Dec 1 '06 #12
I'm sorry, but the division that's taking place in calculating the CRC
doesn't seem to match what you guys are saying. I have a concrete
example that I'm using which is 1001 divided into 101110000 returns a
solution of 101011 and 011 as the remainder. This was an example in
calculating a CRC problem done for us. I'll consult our professor in
this question, because it doesn't seem that you guys know how to
calculate the additional bit for the CRC checksum through this type of
binary division. Thanks for trying though.
MQ wrote:
jamestuck21 wrote:
The mod button does not give you the correct solution. It just returns
the original value that you're trying to use to divide into.

Yes, and why is this not correct. What answer are you expecting? When
the dividend is smaller than the divisor the answer is always 0 rem
dividend.
Dec 1 '06 #13
MQ

jamestuck21 wrote:
I'm sorry, but the division that's taking place in calculating the CRC
doesn't seem to match what you guys are saying. I have a concrete
example that I'm using which is 1001 divided into 101110000 returns a
solution of 101011 and 011 as the remainder. This was an example in
calculating a CRC problem done for us. I'll consult our professor in
this question, because it doesn't seem that you guys know how to
calculate the additional bit for the CRC checksum through this type of
binary division. Thanks for trying though.
I think there may be some confusion from your original post. You
posted 1100 / 101010101010111 , whereas I think you meant to say
101010101010111 / 1100. The answer to this is 1820 remainder 7, or
11100011100 remainder 111 in binary. Does this help?

Dec 1 '06 #14
"jamestuck21" <cp********@yahoo.comwrites:
I'm sorry, but the division that's taking place in calculating the CRC
doesn't seem to match what you guys are saying. I have a concrete
example that I'm using which is 1001 divided into 101110000 returns a
solution of 101011 and 011 as the remainder. This was an example in
calculating a CRC problem done for us. I'll consult our professor in
this question, because it doesn't seem that you guys know how to
calculate the additional bit for the CRC checksum through this type of
binary division. Thanks for trying though.
Please don't top post. Read the following:

http://www.caliburn.nl/topposting.html
http://www.cpax.org.uk/prg/writings/topposting.php

If we don't know how to do CRC checksums, it's probably because this
is a newsgroup for discussing the C programming language. I have yet
to see a posting in this thread that has anything to do with C. I'm
not sure what newsgroup would be more appropriate; comp.programming
*might* be a better starting point.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 1 '06 #15
Well my original post was for a seperate problem that I had to work on,
but I can't get everyone to agree to the example that we've been
talking about so I dont' know if what you say is 100% correct. I think
I'm going to just get this clarified by my professor since he'll know
how to do the binary division in terms of generating the CRC bits.
Again, thanks for everyone's help in trying.
MQ wrote:
jamestuck21 wrote:
I'm sorry, but the division that's taking place in calculating the CRC
doesn't seem to match what you guys are saying. I have a concrete
example that I'm using which is 1001 divided into 101110000 returns a
solution of 101011 and 011 as the remainder. This was an example in
calculating a CRC problem done for us. I'll consult our professor in
this question, because it doesn't seem that you guys know how to
calculate the additional bit for the CRC checksum through this type of
binary division. Thanks for trying though.

I think there may be some confusion from your original post. You
posted 1100 / 101010101010111 , whereas I think you meant to say
101010101010111 / 1100. The answer to this is 1820 remainder 7, or
11100011100 remainder 111 in binary. Does this help?
Dec 1 '06 #16
Michael wrote:
>>Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.


It appears from your scratch calculations in previous posts that you
really want to do 101110000 / 1001, i.e., 1001 divided into 101110000,
not divided by.

My copy of Windows calculator does this correctly. Converting to
decimal, the example you gave above is 368 / 9. The answer is 40, with
a remainder of 8, not 43 (= 101011 binary) with a remainder of 3 (= 011
binary) as you're claiming.
What the OP failed to mention is that he isn't dividing binary numbers,
but CRC polynomials with arithmetic modulo 2. See
http://www.relisoft.com/Science/CrcNaive.html
as an example.

--
Thad
Dec 1 '06 #17
I just figured out the problem. Thanks again.

Dec 1 '06 #18
*** rude top-posting fixed ***
jamestuck21 wrote:
Al Balmer wrote:
>"jamestuck21" <cp********@yahoo.comwrote:
>>Does anyone know of a simple web
calculator that I can check against my answer or if someone could
run through this example with me, that would be great. thank you

Does it have to be on the web? Since you're appear to be posting from
Windows, I'd suggest the Windows calculator, in scientific mode.

Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
Which is not the correct answer. Are you incapable of dividing 9
by 368 (decimal) and getting a remainder of 9? Even if you have
the operands exchanged, the remainder would be 8, not 3 and the
quotient would be 40, not 43.

Please do not top-post.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Dec 1 '06 #19

"jamestuck21" <cp********@yahoo.comwrote in message
news:11**********************@l39g2000cwd.googlegr oups.com...
Hi,

I'm trying to work out a binary division problem

1100 / 101010101010111

Here is what I have so far but I'm not sure if I'm doing it correctly
and I'm suppose to continue the division until there is only a
remainder left

110
______________________
1100 [ 101010101010111
1100
_______________
1101
1100
_______________
01010
1100
_____________
110

I'm not sure if I'm doing this correctly and I don't really have a way
of checking if I'm doing it right. Does anyone know of a simple web
calculator that I can check against my answer or if someone could run
through this example with me, that would be great. thank you
You have
A=1100
B=101010101010111

Your first question asks how to take A/B

But your division example tries (incorrectly) to do B/A

Try a newsgroup like sci.math. But be sure you know which division you want!
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project

Dec 1 '06 #20
On 30 Nov 2006 16:23:36 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:
>Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
I suggest you consider the possibility that the calculator is right
and you're wrong.

I didn't bother to get the remainder, since my only purpose was to
inform you of the existence of the calculator. BTW, what you write
above is the opposite of the "picture" you made in the original
posting. As stated above, the problem is trivial. The quotient is 0,
remainder 1001.

PS: Don't top post, and don't quote signature blocks.
>
Al Balmer wrote:
>On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:
Does anyone know of a simple web
calculator that I can check against my answer or if someone could run
through this example with me, that would be great. thank you

Does it have to be on the web? Since you're appear to be posting from
Windows, I'd suggest the Windows calculator, in scientific mode.

11100011100
--
Al Balmer
Sun City, AZ
Dec 1 '06 #21
Al Balmer <al******@att.netwrites:
On 30 Nov 2006 16:23:36 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:
>>Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
I suggest you consider the possibility that the calculator is right
and you're wrong.
Actually, I think the OP has stated that what he's trying to do is not
division in the usual arithmetic sense.

There's also been some confusion about the fact that "a divided into b"
is "b / a", not "a / b".

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 1 '06 #22
On Fri, 01 Dec 2006 19:30:05 GMT, Keith Thompson <ks***@mib.org>
wrote:
>Al Balmer <al******@att.netwrites:
>On 30 Nov 2006 16:23:36 -0800, "jamestuck21" <cp********@yahoo.com>
wrote:
>>>Windows calculator does not give the correct solution.

An example that I worked out with the correct solution is not the same
as the windows calculator is giving

1001 / 101110000

Solution = 101011 with Remainder of 011 and the remainder is what I'm
interested in.
I suggest you consider the possibility that the calculator is right
and you're wrong.

Actually, I think the OP has stated that what he's trying to do is not
division in the usual arithmetic sense.
He has now, though not at the time when I wrote that reply.
>
There's also been some confusion about the fact that "a divided into b"
is "b / a", not "a / b".
As I noted, he originally gave two opposite renditions of the problem.
I assumed he meant the non-trivial case.

--
Al Balmer
Sun City, AZ
Dec 1 '06 #23

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
30095
by: manuel | last post by:
How to convert a decimal to binary ? thx, Manuel
4
2721
by: christopher diggins | last post by:
Welcome to the first installment of the Diggins Public Domain Posts (PDP). There is a significant dearth of good public domain C++ code. All of it seems to come with one kind of a license or...
0
2498
by: christopher diggins | last post by:
// binary_aritmetic.hpp // Diggins PDP (Public Domain Post) #1.2 // by Christopher Diggins, May 24, 2005 // // Comment: // Provides several algorithms for unsigned binary arithmetic // //...
16
2687
by: Mars | last post by:
I'm writing a program for listing all binary numbers of the same length with the same number of 1s. e.g. 0011 0101 0110 1001 1010 1100
1
2145
by: WStoreyII | last post by:
I am using the following sub but i am getting inaccurate output Public Function Convert(ByVal Base As Integer, ByVal Number As Integer) As Strin D If Not Number / Base = 0 The Convert &=...
1
1655
by: oaktree6 | last post by:
I'm trying to create a program to enter data in to a binary text file, but for some reason I dont think all the data is getting in. I'm sure I'm doing something stupid, I just cant find out what. ...
2
3275
by: shalombizal | last post by:
I am a student of Electrical Engineering I want to write a C++ program to realize arthimetic operation in binary. can any body help me by giving C++ code for signed mulitplication and Division of...
3
3479
by: logaelo | last post by:
Hello all, Could anyone explain how to optimization this code? In the prosess of optimization what is the factor needed and important to know about it? Thank you very much for all. ...
36
4000
by: Kapteyn's Star | last post by:
hi group, i try to compile code below but my compiler is failing. it tells:- printbin.c: In function ‘main’: printbin.c:9: error: invalid operands to binary & i am not able to understand what...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.