Hardware Reference
In-Depth Information
Quotients
Remainders
1492
746
0
373
0
186
93
1
0
46
23
1
0
11
1
5
2
1
1
1
0
0
1
10111010100=1492 10
Figure A-5. Conversion of the decimal number 1492 to binary by successive
halving, starting at the top and working downward. For example, 93 divided by 2
yields a quotient of 46 and a remainder of 1, written on the line below it.
Decimal-to-octal and decimal-to-hexadecimal conversion can be accomplished
either by first converting to binary and then to the desired system or by subtracting
powers of 8 or 16.
A.4 NEGATIVE BINARY NUMBERS
Four different systems for representing negative numbers have been used in
digital computers at one time or another in history. The first one is called signed
magnitude . In this system the leftmost bit is the sign bit (0 is + and 1 is
) and the
remaining bits hold the absolute magnitude of the number.
The second system, called one's complement , also has a sign bit with 0 used
for plus and 1 for minus. To negate a number, replace each 1 by a 0 and each 0 by
a 1. This holds for the sign bit as well. One's complement is obsolete.
The third system, called two's complement , also has a sign bit that is 0 for
plus and 1 for minus. Negating a number is a two-step process. First, each 1 is re-
placed by a 0 and each 0 by a 1, just as in one's complement. Second, 1 is added
 
 
 
Search WWH ::




Custom Search