Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Binary Division Problem Help

Reply
Thread Tools

Binary Division Problem Help

 
 
Coos Haak
Guest
Posts: n/a
 
      12-01-2006
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" <>
>>>> 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
 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      12-01-2006
> 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

 
Reply With Quote
 
 
 
 
MQ
Guest
Posts: n/a
 
      12-01-2006

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.

 
Reply With Quote
 
jamestuck21
Guest
Posts: n/a
 
      12-01-2006
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.


 
Reply With Quote
 
MQ
Guest
Posts: n/a
 
      12-01-2006

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?

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      12-01-2006
*** rude top-posting fixed ***
jamestuck21 wrote:
> Al Balmer wrote:
>> "jamestuck21" <> 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.

>
> 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>


 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-01-2006
"jamestuck21" <> writes:
> 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) kst- <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.
 
Reply With Quote
 
jamestuck21
Guest
Posts: n/a
 
      12-01-2006
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?


 
Reply With Quote
 
jamestuck21
Guest
Posts: n/a
 
      12-01-2006
I just figured out the problem. Thanks again.

 
Reply With Quote
 
Thad Smith
Guest
Posts: n/a
 
      12-01-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
division by 7 without using division operator krypto.wizard@gmail.com C Programming 94 02-09-2007 06:57 AM
Diggins PDP #1 : Binary Arithmetic Algorithms (division / multiplication / full_adder ) christopher diggins C++ 4 05-22-2005 09:00 PM
Binary division genlock VHDL 5 03-31-2005 10:21 PM
need help with large int multiplication and division akickdoe22@hotmail.com C++ 1 01-21-2005 02:46 AM
Lost Cecil-Jacobs division URL (UK) - help please shimon7633@aol.com Digital Photography 1 11-09-2003 09:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57