BLOGGER TEMPLATES AND TWITTER BACKGROUNDS »

Wednesday 17 October 2012

Binary Subtraction


0 – 0 = 0
1 – 0 = 1
0 – 1 = 1
*  Digit “0” will transform to digit “1”,while 1 is borrow from the left side.



One’s Complement Addition and Subtraction
*  N-bit represent integers in the range –(2N-1-1) to +(2N-1-1) or call modulo (2N-1-1)
Example of Number Presentation :
The table show that all possible value is in 4-bit system:

No.
Positive binary (+)
Negative binary(-)
0
0000
1111
1
0001
1110
2
0010
1101
3
0011
1100
4
0100
1011
5
0101
1010
6
0110
1001
7
0111
1000
8
1111
0000

Two’s Complement Addition and Subtraction
*  N-bit be defined as complement with respect to 2N
*  Equivalent taking one’s complement and then plus “1”
*  N-bit can represent in the range –(2N-1) to +(2N-1-1)
Example :


Signal overflow :
*  Different for unsigned and two’s complement representation.
*  Not necessarily occur when it carry out of sign, but occur when the result is of the opposite sign.
*  Two example of 8-bit for present the result of two’s complement addition.

-lee Man


0 comments: