Friday, 19 August 2011

Representing Negative Numbers

Signed Bit Notation

1 at the front indicates a negative number
0 indicates a positive number
THEN IGNORE THE SIGNED BIT!

Disadvantages
* Lose Range ( 7 bit range for an 8 bit number because we lose the signed bit)
* Two Representations of Zero
+ 0 - 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0

Two's Complement
Recognising a negative number?????
1 in front (same as Signed Bit, but we dont discard it)
INVERT and then ADD ONE

+10 = 0 0 0 0 1 0 1 0
INVERT 1 1 1 1 0 1 0 1
ADD 1 1 1 1 1 0 1 1 0 = -10

3 comments: