Page 281 - FUNDAMENTALS OF COMPUTER
P. 281
NPP
NPP Number System, Boolean Algebra and Logic Circuits 281
2. If a carry is generated at the end, neglect it 2. `{X A§V _| hm{gb AmVm h¡, Vmo Cgo N>mo‹S> Xmo VWm
and put a (+) sign before the number. (+) H$m {MÝh bJmAmo &
3. If the carry is not obtained at the end, take 3. `{X hm{gb Zht AmVm h¡ Vmo EH$ ~ma {\$a go `moJ
2’s complement of the sum and put a (–) H$m 2’s H$m°påßb_|Q> bmo VWm (-) H$m {MÝh bJmAmoŸ&
sign before the number.
Consider one example : {ZåZ CXmhaU H$mo XoImo…
1101 –1010
Replace 1010 with its 2’s complement and (-) dmbr g§»`m 1010 H$m 2’s H$m°påßb_|Q> boH$a Omo‹S>Zo
change (–) to (+), and add: na
1 10 1
+ 0 1 10
Carry () 1 0 0 1 1
There is a carry at the end. It shows that My±{H$ A§V _| hm{gb Am`m h¡ AV… n[aUm_ YZmË_H$
the result is positive. The actual result is ob- h¡ Am¡a `h hm{gb H$mo N>mo‹S>Zo na àmá hmoJmŸ& AV… (+)
tained by neglecting carry and putting a (+) H$m {MÝh bJmZm hmoJm…
sign : Thus,
1101 – 1010 = + 0011
Now consider one more example: A~ EH$ Am¡a CXmhaU bmo…
1001 – 1110
Take 2’s complement of subtrahend 1110 1110 H$m 2’s H$m°påßb_|Q> boH$a (-) H$s OJh
and replace (–) with (+). Add. (+) H$aZo na:
1001 + 0010 = 1011
There is no carry at the end. It shows that My±{H$ A§V _| H$moB© hm{gb Zht Am`mŸ& AV… n[aUm_
the result is negative. The actual result is ob- F$UmË_H$ h¡ Ÿ& `moJ H$m 2’s H$m°påßb_|Q> boH$a dmñV{dH$
tained by taking 2’s complement of the sum n[aUm_ àmá {H$`m Om gH$Vm h¡Ÿ& AV…
and putting a (–) sign. Thus,
1001 – 1110 = – 0101
Thus, we have seen both type of problems. A~ h_Zo XmoZm| Vah H$s g_ñ`m XoI br Ÿ& 2’s
The whole procedure of 2’s complement sub- H$m°påßb_|Q> {d{Y ({~Zm {MÝh dmbr g§»`mAm| hoVw) EH$
traction can best be illustrated using flowchart: âbmoMmQ>© go Xem©B© Om gH$Vr h¡: