A 4-bit magnitude comparator is explained in the attached file. With similar logic, design a 3 bit magnitude comparator. You must show the equations and draw the logic circuit. [Hints: A and B are two numbers each with 3 bits. How can you implement a circuit to compare these two numbers if, A=B, A>B or A
A 4-bit magnitude comparator is explained in the attached file. With similar logic, design a 3 bit magnitude comparator. You must show the equations and draw the logic circuit. [Hints: A and B are two numbers each with 3 bits. How can you implement a circuit to compare these two numbers if, A=B, A>B or A
Chapter22: Sequence Control
Section: Chapter Questions
Problem 6SQ: Draw a symbol for a solid-state logic element AND.
Related questions
Question
A 4-bit magnitude comparator is explained in the attached file. With similar
logic, design a 3 bit magnitude comparator. You must show the equations and draw the logic circuit. [Hints: A and B are two numbers each with 3 bits. How can you implement a circuit to compare these two numbers if, A=B, A>B or A<B]
![Section 4.8 Magnitude Comparator
149
may suspect, a comparator circuit possesses a certain amount of regularity. Digital func-
tions that possess an inherent well-defined regularity can usually be designed by means
of an algorithm-a procedure which specifies a finite set of steps that, if followed, give
the solution to a problem. We illustrate this method here by deriving an algorithm for
the design of a four-bit magnitude comparator.
The algorithm is a direct application of the procedure a person uses to compare the
relative magnitudes of two numbers. Consider two numbers, A and B, with four digits
each. Write the coefficients of the numbers in descending order of significance:
A = A3 A2 Aı Ao
B = B3 B2 B1 Bo
Each subscripted letter represents one of the digits in the number. The two numbers are
equal if all pairs of significant digits are equal: A3 = B3, A2 = B2, A1 = B1, and
Ao = Bo. When the numbers are binary, the digits are either 1 or 0, and the equality of
each pair of bits can be expressed logically with an exclusive-NOR function as
Ві, and
X; = A;B; + A¡B{
for i = 0, 1, 2, 3
6.
where x; = 1 only if the pair of bits in position i are equal (i.e., if both are 1 or both
are 0).
The equality of the two numbers A and B is displayed in a combinational circuit by
an output binary variable that we designate by the symbol (A = B). This binary vari-
able is equal to 1 if the input numbers, A and B, are equal, and is equal to 0 otherwise.
For equality to exist, all x; variables must be equal to 1, a condition that dictates an AND
operation of all variables:
(A = B)
= X3X2X1XO
The binary variable (A = B) is equal to 1 only if all pairs of digits of the two numbers
are equal.
To determine whether A is greater or less than B, we inspect the relative magnitudes
of pairs of significant digits, starting from the most significant position. If the two digits
of a pair are equal, we compare the next lower significant pair of digits. The comparison
continues until a pair of unequal digits is reached. If the corresponding digit of A is 1
and that of B is 0, we conclude that A > B. If the corresponding digit of A is 0 and that
of B is 1, we have A < B. The sequential comparison can be expressed logically by the
two Boolean functions
= A3B + x3A,B½ + X3X2A¡B{ + X3X2X¡A„Bó
(A > В)
(A < B) = A¿B3 + X3A½B, + X3zX2A¡B{ + x3XxX1A'n,B%
The symbols (A > B) and (A < B) are binary output variables that are equal to 1
when A > B and A < B, respectively.
The gate implementation of the three output variables just derived is simpler than it
seems because it involves a certain amount of repetition. The unequal outputs can use
the same gates that are needed to generate the equal output. The logic diagram of the
four-bit magnitude comparator is shown in Fig. 4.17. The four x outputs are generated](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0135192f-077a-4d61-a1cd-845c0d210f0a%2Fd2ba23fe-017e-41e7-b374-a0e3b3a1af79%2F181qu1d_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Section 4.8 Magnitude Comparator
149
may suspect, a comparator circuit possesses a certain amount of regularity. Digital func-
tions that possess an inherent well-defined regularity can usually be designed by means
of an algorithm-a procedure which specifies a finite set of steps that, if followed, give
the solution to a problem. We illustrate this method here by deriving an algorithm for
the design of a four-bit magnitude comparator.
The algorithm is a direct application of the procedure a person uses to compare the
relative magnitudes of two numbers. Consider two numbers, A and B, with four digits
each. Write the coefficients of the numbers in descending order of significance:
A = A3 A2 Aı Ao
B = B3 B2 B1 Bo
Each subscripted letter represents one of the digits in the number. The two numbers are
equal if all pairs of significant digits are equal: A3 = B3, A2 = B2, A1 = B1, and
Ao = Bo. When the numbers are binary, the digits are either 1 or 0, and the equality of
each pair of bits can be expressed logically with an exclusive-NOR function as
Ві, and
X; = A;B; + A¡B{
for i = 0, 1, 2, 3
6.
where x; = 1 only if the pair of bits in position i are equal (i.e., if both are 1 or both
are 0).
The equality of the two numbers A and B is displayed in a combinational circuit by
an output binary variable that we designate by the symbol (A = B). This binary vari-
able is equal to 1 if the input numbers, A and B, are equal, and is equal to 0 otherwise.
For equality to exist, all x; variables must be equal to 1, a condition that dictates an AND
operation of all variables:
(A = B)
= X3X2X1XO
The binary variable (A = B) is equal to 1 only if all pairs of digits of the two numbers
are equal.
To determine whether A is greater or less than B, we inspect the relative magnitudes
of pairs of significant digits, starting from the most significant position. If the two digits
of a pair are equal, we compare the next lower significant pair of digits. The comparison
continues until a pair of unequal digits is reached. If the corresponding digit of A is 1
and that of B is 0, we conclude that A > B. If the corresponding digit of A is 0 and that
of B is 1, we have A < B. The sequential comparison can be expressed logically by the
two Boolean functions
= A3B + x3A,B½ + X3X2A¡B{ + X3X2X¡A„Bó
(A > В)
(A < B) = A¿B3 + X3A½B, + X3zX2A¡B{ + x3XxX1A'n,B%
The symbols (A > B) and (A < B) are binary output variables that are equal to 1
when A > B and A < B, respectively.
The gate implementation of the three output variables just derived is simpler than it
seems because it involves a certain amount of repetition. The unequal outputs can use
the same gates that are needed to generate the equal output. The logic diagram of the
four-bit magnitude comparator is shown in Fig. 4.17. The four x outputs are generated
![148
Chapter 4 Combinational Logic
Ao
B3
B2
B1
Во
A1
B2
B1
Во
Addend
Augend
4-bit adder
Sum and output carry
A2
B2
B1
Bo
B3
Addend
Augend
4-bit adder
Sum and output carry
C4
C3
C2
C1
Co
C6
C5
FIGURE 4.16
Four-bit by three-bit binary multiplier
4.8
MAGNITUDE COMPARATOR
The comparison of two numbers is an operation that determines whether one number
is greater than, less than, or equal to the other number. A magnitude comparator is a
combinational circuit that compares two numbers A and B and determines their relative
magnitudes. The outcome of the comparison is specified by three binary variables that
indicate whether A > B, A = B, or A < B.
On the one hand, the circuit for comparing two n-bit numbers has 22" entries in the
3. On the other hand, as one
truth table and becomes too cumbersome, even with n
B,](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0135192f-077a-4d61-a1cd-845c0d210f0a%2Fd2ba23fe-017e-41e7-b374-a0e3b3a1af79%2Fu58kmoh_processed.jpeg&w=3840&q=75)
Transcribed Image Text:148
Chapter 4 Combinational Logic
Ao
B3
B2
B1
Во
A1
B2
B1
Во
Addend
Augend
4-bit adder
Sum and output carry
A2
B2
B1
Bo
B3
Addend
Augend
4-bit adder
Sum and output carry
C4
C3
C2
C1
Co
C6
C5
FIGURE 4.16
Four-bit by three-bit binary multiplier
4.8
MAGNITUDE COMPARATOR
The comparison of two numbers is an operation that determines whether one number
is greater than, less than, or equal to the other number. A magnitude comparator is a
combinational circuit that compares two numbers A and B and determines their relative
magnitudes. The outcome of the comparison is specified by three binary variables that
indicate whether A > B, A = B, or A < B.
On the one hand, the circuit for comparing two n-bit numbers has 22" entries in the
3. On the other hand, as one
truth table and becomes too cumbersome, even with n
B,
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Electric Motor Control](https://www.bartleby.com/isbn_cover_images/9781133702818/9781133702818_smallCoverImage.gif)
![Electric Motor Control](https://www.bartleby.com/isbn_cover_images/9781133702818/9781133702818_smallCoverImage.gif)