You are on page 1of 11

Digital Magnitude Comparator

A comparator is a special combinational circuit


designed primarily to compare the relative
magnitude of two binary numbers .an n-bit
comparator receives two n-bit numbers A and B
as inputs and the outputs are:
• A > B (G)
• A < B (L)
• A = B (E)
Inputs A B

n- bit Comparator

G L E
Outputs
1 bit Comparator

DEC. A B G L E
0 0 0 0 0 1
1 1 0 1 0 0
2 0 1 0 1 0
3 1 1 0 0 1
1 bit Comparator

G= AB
L=AB
E= AB+AB
1 Bit Comparator

A 1 Bit
G
Comparator
L
B E
GO
AO
LO
1- bit
comp. EO
G
BO
Additional
Logic L
G1 circuit
A1
1- bit L1 E
B1 comp. E1

2 Bit Comparator
2 Bit Comparator
B1 BO A1 AO

2 Bit Comparator

E L G
If A1< B1 or A1 = B1 And AO < BO
G = G1+ E1 .GO
If A1 > B1 or A1 = B1 And AO > BO
L = L1 + E1 . LO
If A1 = B1 and AO = BO
E= E1 . E0
GL
L LL
S Additional
B
EL
G
Logic
L
GM
M LM
Circuit
E
S EM
B

4 Bit Comparator
4 Bit Comparator

G = G M + E M . GL
L = LM + EM . LL
E = EM . EL
MSB LSB MSB LSB

B3 B2 B1 BO A3 A2 A1 AO

4 Bit Comparator

G L E

You might also like