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
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.
(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

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

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
Assistant Professor CS&IT
Superior University Lahore
100011 00100
1s Complement

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
Assistant Professor CS&IT
Superior University Lahore
7s Complement

456
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.
Assistant Professor CS&IT
Superior University Lahore

## 7777 7234 1354

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

2120 - 0543
Number which you want to subtract
take its complement.

## 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
Assistant Professor CS&IT
Superior University Lahore
9s Complement

456
999
-456
Assistant Professor CS&IT
Superior University Lahore
10s Complement

456
999 543
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.
Assistant Professor CS&IT
Superior University Lahore

## 999 844 059

-155 + 215 + 1
844 1059 60
9s Complement
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

## + 1 Assistant Professor CS&IT

Superior University Lahore

Omit Carry
845
10s Complement
Assistant Professor CS&IT
Superior University Lahore

Numbers by 15s and 16s
Complement

Assistant Professor CS&IT
Superior University Lahore
15s Complement

074E
Assistant Professor CS&IT
Superior University Lahore

- 074E
F8B1
Assistant Professor CS&IT
Superior University Lahore
16s Complement

074E
FFFF F8B1
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
Assistant Professor CS&IT
Superior University Lahore

## F8B1 1DF3E DF3F

15s Complement
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