473,761 Members | 10,280 Online
Bytes | Software Development & Data Engineering Community
+ 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 5824
jamestuck21 wrote:
Hi,

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

Post to sci.math

Nov 30 '06 #2
"jamestuck2 1" <cp********@yah oo.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, "jamestuck2 1" <cp********@yah oo.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, "jamestuck2 1" <cp********@yah oo.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
"jamestuck2 1" <cp********@yah oo.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:
"jamestuck2 1" <cp********@yah oo.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, "jamestuck2 1" <cp********@yah oo.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, "jamestuck2 1" <cp********@yah oo.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, "jamestuck2 1" <cp********@yah oo.com>
wrote:

Does anyone know of a simple web
>calculat or 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.

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

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

Similar topics

9
30110
by: manuel | last post by:
How to convert a decimal to binary ? thx, Manuel
4
2739
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 another, and even though I understand the motivations, I believe code is like mathematics and no one can really own it. Rather than stand on a pulpit, or debate the philosophical merits of the various licenses, I have decided instead to post as much...
0
2509
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 // // Changes: // Now includes a full_subtractor
16
2716
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
2160
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 &= (Number Mod Base).ToStrin Number = Number / Bas Els Return StrReverse(Convert
1
1670
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. #include <iostream> #include <fstream> #include <cctype> #include "reint.h" using namespace std; const int SIZE=10;
2
3293
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 binary numbers? shalom
3
3500
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. /********************************************************/ /* Binary converter */ /* By Matt Fowler */ /* email address removed */ /* converts text into...
36
4056
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 it mean. how to correct fault? please help i'm only new to C. #include<stdio.h> #include<math.h> main()
0
9345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10115
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9905
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3881
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 we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.