4-bit Magnitude Comparator
A 4-bit Magnitude Comparator compares two 4-bit numbers A and B and gives one of the following outputs:
A=B, AB.
Let A=A3A2A1A0 and B=B3B2B1B0 be the two 4-bit numbers to be compared.
The steps involved in comparing two such numbers can be used as the basis for hardware implementation. The steps involved in comparing two 4-bit numbers are:
i. Examine the two most significant bits (A3 and B3). If A3 > B3 then A > B. If A3 > B3 then A < B. If A3=B3, no decisions can be made regarding the relative magnitudes of the two numbers and the next pair of bits (A2 and B2) must be examined.
ii. If A3 = B3 and A2 > B2. If A3 = B3,
then A < B. However, if A3 = B3 and A2 = B2, no conclusion can be drawn regarding the relative magnitudes of the two numbers and the next pair of bits (A1 and B1) must be examined.