01-01-2014, 12:57 PM
(01-01-2014, 02:03 AM)David Wrote: I find it alot easier to just use the cout to determine if my number is positive or negative, then I don't have to deal with the sign extension part (that I don't get). If you want to hook it up to a display you can just convert it to sign magnitude.
The goal of two's complement is to be a universal representation of the sign, and these adders have the ability to customize both signs. Also, the sign extension is just putting 0s on the front of a number... 101=0101
(01-01-2014, 12:01 PM)Jmking80 Wrote: Cout doesn't say anything about wheter a number is positive or negative.
only the MSB says something about positive or negative.
Btw if you want to know if overflow happend: IF AND ONLY IF (Cin XOR Cout)
of the msb is a 1 then there is a overflow.
It's easier just to use an additional bit.