|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ä |
Signed
Integers
|
|
|
|
ä |
Need
encoding for both positive and negative
|
|
|
numbers
|
|
|
|
ä |
Assume
M bits in a register word
|
|
|
|
ä |
Use
one bit (say the left most, most significant
|
|
|
bit)
to represent sign
|
|
|
|
ä |
0
=> positive
|
|
|
|
ä |
1
=> negative
|
|
|
|
ä |
Encode
magnitude with remaining M-1 bits
|
|
|
|
ä |
Example
for M=4
|
|
|
|
(+1) 0 001
|
|
|
|
(-1) 1 001
|
|
|
|
-------
|
|
|
|
1
010 = -2 decimal??
|
|
Answer should be zero!
|
|
|
|
ä |
Also,
there are two representations of zero
|
|
|
|
(+0) 0
000
|
|
|
|
(-0) 1
000
|
|