Binome
Full Member level 3
- Joined
- Nov 16, 2009
- Messages
- 152
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,298
- Location
- Lyon, France
- Activity points
- 2,405
Hi,
my problem is the overflow detection when subtracting:
There are two unsigned integer 4-bit numbers (a and b), so we have 0≦a,b≦15.
I want to subtract a-b, then -15≦a-b≦15.
This result is a signed integer 4-bit number then -8≦s≦7.
I want the operator to be able to detect an overflow. How should I build my circuit? (I have to use adders knowing a-b=a+not(b)+1).
Thanks.
my problem is the overflow detection when subtracting:
There are two unsigned integer 4-bit numbers (a and b), so we have 0≦a,b≦15.
I want to subtract a-b, then -15≦a-b≦15.
This result is a signed integer 4-bit number then -8≦s≦7.
I want the operator to be able to detect an overflow. How should I build my circuit? (I have to use adders knowing a-b=a+not(b)+1).
Thanks.