DLD Lecture 3
DLD Lecture 3
Subtract: 3250-72533
M=03250 03250
N=72532
10’s complement of N 27468
No carry 30718
Answer: -69282=(10’s complement of 30718)
Use 2’s complement to perform M-N with the given
binary numbers.
M=1010100
N=1000100
1010100
2’s complement of N + 0111100
End carry 1 0010000
M= 1000100
N=1010100
1000100
2’s complement of N + 0101100
No carry 1110000
Answer: -0010000 = -(2’s complement of 1110000)
The procedure for subtraction with the (r-1)’s
complement is exactly the same as with the
previous one with one variation, called, “end-
around carry” as shown in example.
The subtraction of M-N, both positive numbers in
base r, may be calculated in the following
manner.
M= 03250
N= 72532
03250
9’s complement of N + 27467
No carry 30717
Answer:-69282= -(9’s complement of 30717)
M= 1010100
N= 1000100
1010100
1’s complement of N + 0111011
End-around carry 1 0001111
1+
0010000
Answer: 10000
M=1000100
N=1010100
1000100
1’s complement of N + 0101011
No carry 1101111
Answer: -10000 = -(1’s complement of 1101111)
A comparison between 1’s and 2’s complements reveals the
advantages and disadvantages of each.