- Sep 30, 2001
- 12,684
- 2
- 81
I have a homework problem where I need to figure out which signed integer representation is the most complex for finding an absolute value.
I have narrowed it down to 2's Complement and excess biased by 2^(n-1)-1
Assuming that adding or subtracting two binary bits, including carrying and determining the carryout value has the same complexity, I have determined that both of the representations have the same complexity...I think.
2's Complement:
Check bit-n, if 1 flip all bits and add 1.
Excess Biased:
Check bit-n, if 0 flip all bits and subtract 1.
I must be missing something somewhere...does anyone see any mistakes in my logic?
The only other representations we have learned are 1's Complement and Signed Magnitude, both of which are less complex.
I have narrowed it down to 2's Complement and excess biased by 2^(n-1)-1
Assuming that adding or subtracting two binary bits, including carrying and determining the carryout value has the same complexity, I have determined that both of the representations have the same complexity...I think.
2's Complement:
Check bit-n, if 1 flip all bits and add 1.
Excess Biased:
Check bit-n, if 0 flip all bits and subtract 1.
I must be missing something somewhere...does anyone see any mistakes in my logic?
The only other representations we have learned are 1's Complement and Signed Magnitude, both of which are less complex.