Vous êtes sur la page 1sur 23

COMPLEMENTS Syed Muhammad Junaid Zaidi

Assistant Professor CS&IT


Superior University Lahore

SM JUNAID ZAIDI
Assistant Professor
CS&IT
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT

COMPLEMENTS
Superior University Lahore

Complements are used to simplify the subtraction operation


Complement methods are simpler and have less expensive
circuit to implement.
rs complement (Radix Complement)
(r-1)s complement (Diminished Complement)
where r is base
Base rs Complement (r-1)s Complement
2 2 Complement 1 Complement
8 8 Complement 7 Complement
10 10 Complement 9 Complement
16 16 Complement 15 Complement

Syed Muhammad Junaid Zaidi


Assistant Professor CS&IT
Superior University Lahore
Subtraction of Binary Numbers
by 1s and 2s Complement
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore
1s Complement
2s Complement

Syed Muhammad Junaid Zaidi


Assistant Professor CS&IT
Superior University Lahore
1s Complement Subtraction

10010 - 01110
Number which you want to subtract
take its complement.

10001 10001 00011


+ 10010 + 1
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore
100011 00100
1s Complement

Omit Carry and add


Back to LSB
2s Complement Subtraction
10010 - 01110 Number which you want to subtract
take its complement.

10001 10010 00100


1s Complement
+ 10010 Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

10001 100100
+ 1
Omit Carry
10010
2s Complement
Subtraction of Octal Numbers by
7s and 8s Complement
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore
7s Complement

456
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
777
Superior University Lahore

-456
321
8s Complement

456
777 321 Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT

+ 1
Superior University Lahore

-456
321 322
7s Complement 8s Complement
7s Complement Subtraction

2120 - 0543
Number which you want to subtract
take its complement.
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

7777 7234 1354


-0543 + 2120 + 1
7234 11354 1355
7s Complement
Omit Carry and add
Back to LSB
8s Complement Subtraction

2120 - 0543
Number which you want to subtract
take its complement.
Syed Muhammad Junaid Zaidi

7777 Assistant Professor CS&IT


Superior University Lahore

-0543 7235 1355


7234 + 2120
7s Complement

7234 11355
+ 1
Omit Carry
7235
8s Complement
Subtraction of Decimal Numbers
by 9s and 10s Complement
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore
9s Complement

456
999
-456
543 Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore
10s Complement

456
999 543
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

-456 + 1
543 544
9s Complement 10s Complement
9s Complement Subtraction

215-155
Number which you want to subtract
take its complement.
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

999 844 059


-155 + 215 + 1
844 1059 60
9s Complement
Omit Carry and add
Back to LSB
10s Complement Subtraction

215-155
Number which you want to subtract
take its complement.

999
-155 845 60
844 + 215
9s Complement

844 1060 Syed Muhammad Junaid Zaidi

+ 1 Assistant Professor CS&IT


Superior University Lahore

Omit Carry
845
10s Complement
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

Subtraction of Hexadecimal
Numbers by 15s and 16s
Complement

Syed Muhammad Junaid Zaidi


Assistant Professor CS&IT
Superior University Lahore
15s Complement

074E
FFFF Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

- 074E
F8B1
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore
16s Complement

074E
FFFF F8B1
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

- 074E + 1
F8B1 F8B2
15s Complement 16s Complement
15s Complement Subtraction
Number which you want to subtract
take its complement.

E68D - 074E

FFFF F8B1 DF3E


-074E + E68D + 1
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

F8B1 1DF3E DF3F


15s Complement
Omit Carry and add
Back to LSB
16s Complement Subtraction

E68D - 074E
Number which you want to subtract
take its complement.

FFFF
-074E F8B2 DF3F
F8B1 + E68D
15s Complement Syed Muhammad Junaid Zaidi

F8B1 1DF3F Assistant Professor CS&IT


Superior University Lahore

+ 1
Omit Carry
F8B2
16s Complement
Syed Muhammad Junaid Zaidi
Assistant Professor CS&IT
Superior University Lahore

http://atozmath.com/NumberSubCo
mp.aspx?q=9