56
Digital Electronics
Example 3.4
Subtract (1110.011) 2 from (11011.11) 2 using basic rules of binary subtraction and verify the result by
showing equivalent decimal subtraction.
Solution
The minuend and subtrahend are first modified to have the same number of bits in the integer and
fractional parts. The modified minuend and subtrahend are (11011.110) 2 and (01110.011) 2 respectively:
11011110
− 01110011
01101011
The decimal equivalents of (11011.110) 2 and (01110.011) 2 are 27.75 and 14.375 respectively. Their
difference is 13.375, which is the decimal equivalent of (01101.011) 2 .
Example 3.5
Subtract (a) (−64) 10 from (+32) 10 and (b) (29.A) 16 from (4F.B) 16 . Use 2’s complement arithmetic.
Solution:
(a) (+32) 10 in 2’s complement notation = (00100000) 2 .
(−64) 10 in 2’s complement notation = (11000000) 2 .
The 2’s complement of (−64) 10 = (01000000) 2 .
(+32) 10 − (−64) 10 is determined by adding the 2’s complement of (−64) 10 to (+32) 10 .
Therefore, the addition of (00100000) 2 to (01000000) 2 should give the result. The operation is
shown as follows:
00100000
+ 01000000
01100000
The decimal equivalent of (01100000) 2 is +96, which is the correct answer as +32 − (−64) = +96.
(b) The minuend = (4F.B) 16 = (01001111.1011) 2 .
The minuend in 2’s complement notation = (01001111.1011) 2 .
The subtrahend = (29.A) 16 = (00101001.1010) 2 .
The subtrahend in 2’s complement notation = (00101001.1010) 2 .
The 2’s complement of the subtrahend = (11010110.0110) 2 .
(4F.B) 16 − (29.A) 16 is given by the addition of the 2’s complement of the subtrahend to the
minuend.
010011111011
+ 110101100110
001001100001
with the final carry disregarded. The result is also in 2’s complement form. Since the result is a
positive number, 2’s complement notation is the same as it would be in the case of the straight
binary code.
The hex equivalent of the resulting binary number = (26.1) 16 , which is the correct answer.
Précédent

- 77/741

Suivant