Digital Logic Design Number Systems, Operations and Codes
Digital Logic Design Number Systems, Operations and Codes
0 0 1 1 0 1 0 1
2’s Complement
0 0 1 1 0 1 0 1
Input bits
Carry
Adder
in (add 1)
Output bits (sum)
0 0 1 1 0 1 1 0
Signed Binary Numbers
2’s Complement
Negative numbers can be also the 2’s complements of the corresponding
positive numbers. For example, the decimal number -25 is expressed as the
2’s complement of 00011001 (+25) by inverting each bit and adding 1,
which is: 11100111 (-25).
The 2’s complements of negative numbers are the corresponding positive
numbers.
For example, the 2’s complement of 11100111 (-25 ) is 00011001 (+25).
Example
Express the decimal number -39 as an 8-bit binary number in
the sign magnitude, 1’s complement, and 2’s complement.
Solution:
8-bit binary number for + 39 by repeatedly dividing by 2:
MSB is the 8th bit 6th bit 00100111
Answer: 1 0 0 1 1 1 Remainder LSB
0 1 2 4 9 19 39 2
Continue until the Decimal
Quotient base
last quotient is 0 number