Velocity Reviews > Binary Division Problem Help

# Binary Division Problem Help

jamestuck21
Guest
Posts: n/a

 11-30-2006
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

santosh
Guest
Posts: n/a

 11-30-2006
jamestuck21 wrote:
> Hi,
>
> I'm trying to work out a binary division problem

<snip>

Post to sci.math

Ben Pfaff
Guest
Posts: n/a

 11-30-2006
"jamestuck21" <(E-Mail Removed)> writes:

> 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: http://www.velocityreviews.com/forums/(E-Mail Removed)
web: http://benpfaff.org

Fred Kleinschmidt
Guest
Posts: n/a

 11-30-2006

"jamestuck21" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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

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

Al Balmer
Guest
Posts: n/a

 11-30-2006
On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <(E-Mail Removed)>
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

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

Al Balmer wrote:
> On 30 Nov 2006 10:27:57 -0800, "jamestuck21" <(E-Mail Removed)>
> 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

Ben Pfaff
Guest
Posts: n/a

 12-01-2006
"jamestuck21" <(E-Mail Removed)> writes:

> 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

jamestuck21
Guest
Posts: n/a

 12-01-2006
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" <(E-Mail Removed)> writes:
>
> > 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

Coos Haak
Guest
Posts: n/a

 12-01-2006
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" <(E-Mail Removed)>
>> 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

jamestuck21
Guest
Posts: n/a

 12-01-2006
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" <(E-Mail Removed)>
> >> 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