Download Understanding Negative Binary Numbers: Signed Magnitude, One's Complement, and Two's Compl and more Slides Microprocessors in PDF only on Docsity!
In decimal we are quite familiar with placing a“-” sign in front of a number to denote that it isnegative
The same is true for binary numbers acomputer won’t understand that
What happens in memory then?
Negative Binary Numbers
There are several representations- Signed magnitude- One’s complement- Two’s complement
Two’s complement is the system used inmicroprocessors
Most significant bit becomes important
Binary Negative Numbers
Method: Invert the ones and zeros
1110
10
0 in MSB implies positive
1 in MSB implies negative
One’s Complement
Method: Take the one’s complement and add 1
1110
- 1110 = 11110100 one’s comp
- 1110 = 11110101 two’s comp
Two’s Complement
Consider 10 – 6 using binary subtraction
00001010 10
00000110 6
00000100 subtract gives 4
Subtraction by Addition
Consider 10 – 6 using two’s complement
0001010 10
11111010 6
(1) 00000100 adding gives 4
Subtraction by Addition
Only need one type of hardware/process to add bothsigned and unsigned numbers. .