0% found this document useful (0 votes)
67 views11 pages

Digital Magnitude Comparator

A digital magnitude comparator compares the relative magnitudes of two binary numbers. It receives two n-bit numbers as inputs and outputs whether the first number is greater than, less than, or equal to the second number. The comparator operates by comparing the bits at each position from most to least significant, returning the appropriate output once a difference is found. Larger comparators can be built by combining the outputs of multiple 1-bit comparators.

Uploaded by

ve
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views11 pages

Digital Magnitude Comparator

A digital magnitude comparator compares the relative magnitudes of two binary numbers. It receives two n-bit numbers as inputs and outputs whether the first number is greater than, less than, or equal to the second number. The comparator operates by comparing the bits at each position from most to least significant, returning the appropriate output once a difference is found. Larger comparators can be built by combining the outputs of multiple 1-bit comparators.

Uploaded by

ve
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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