MAGNITUDE COMPARISON
4-Bit Magnitude Comparator (IC 74LS85)
Compare two 4-bit unsigned binary numbers A and B. Inspect MSB-priority logic, bit-by-bit XNOR equality
gates, and cascade expansion inputs ($I_{A>B}, I_{A
THEORY & EQUATIONS
Binary magnitude comparison evaluates bits starting strictly from the Most Significant Bit (MSB, Bit 3) down to the LSB (Bit 0).
The first pair of bits where \(A_i \neq B_i\) conclusively establishes the inequality, rendering all lower-order bits irrelevant.
To compare words larger than 4 bits, multiple IC 74LS85s are chained together. The outputs of the less significant stage connect directly to the cascade inputs of the next higher stage:
Interactive 4-Bit Magnitude Comparator
Bit-by-Bit Priority & Equality Analysis (MSB to LSB)
Bit Position
Ai
Bi
EQi = XNOR(Ai, Bi)
Ai · Bi' (Ai > Bi)
Ai' · Bi (Ai < Bi)
Status
Toggle input bits above to evaluate bit stages in real time. Magnitude Comparator Architecture (IC 74LS85)
MSB-Priority Logic
74LS85 Boolean Logic Equations
A > B = (A3·B3') + (EQ3·A2·B2') + (EQ3·EQ2·A1·B1') + (EQ3·EQ2·EQ1·A0·B0')
A < B = (A3'·B3) + (EQ3·A2'·B2) + (EQ3·EQ2·A1'·B1) + (EQ3·EQ2·EQ1·A0'·B0)
A = B = EQ3 · EQ2 · EQ1 · EQ0
Multi-Stage Cascading (8-Bit / 12-Bit Expansion)
OA<B = (A < B) + ((A = B) · IA<B)
OA=B = (A = B) · IA=B