Professional Documents
Culture Documents
Arithmetic Circuits
Signed magnitude
Hum n f i ndl way: Human-friendly : + 14 - 56
sign (+,-) magnitude
Generally, MSB (Most Significant Bit) is used as the sign Generally bit (0 = plus, 1 = minus) n-bits n bits number
-(2n-1 - 1) ~ +(2n-1 - 1) two p presentations of zero (+0, -0)
Representation
magnitude
2
sign bit
Signed magnitude it d 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Decimal +0 +1 +2 +3 +4 4 +5 +6 +7 -0 -1 1 -2 -3 -4 -5 -6 6 -7
3
(r-1)s complement
n-digit di it positive iti number b Ni in b base r (r-1)s complement of N= (rn 1) - N ( ) 9 (ex) 9s complement l t of f 52520
99999 105 -1 -52520 52520 47479
Representation
sign i bit
n-bit numbers
-( 2n-1- 1 ) ~ +( 2n-1 - 1 ) two representations of zero (+0, -0)
1s complement 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Decimal +0 +1 +2 +3 +4 +5 +6 +7 -7 -6 -5 -4 -3 -2 -1 -0
symmetric
rs complement
n-digit positive number N in base r rs complement of N = rn N for N 0 (ex) 10s complement of 52520
100000 105 -52520 47480
for N = 0
Representation
sign i bit
n-bit numbers
-(2n-1) ~ +(2n-1 - 1) Only one zero (+0) 1 no positive Extra E t negative ti # : - 2n-1 iti counterpart t t
2s complement 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Decimal +0 +1 +2 +3 +4 +5 +6 +7 -8 -7 -6 -5 -4 -3 -2 -1
9