0% found this document useful (0 votes)
156 views2 pages

4-Bit Magnitude Comparator Design

The document describes a 4-bit magnitude comparator circuit. It explains that a magnitude comparator compares two numbers and determines if one is greater than, less than, or equal to the other. It then provides the logic equations for a 4-bit magnitude comparator to calculate the outputs for A>B, A<B, and A=B based on the input bits of A and B being compared at each bit position from most to least significant. The circuit diagram for a 4-bit magnitude comparator is also included to visually depict how the logic equations would be implemented in a combinational circuit to compare the two 4-bit input numbers.

Uploaded by

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

4-Bit Magnitude Comparator Design

The document describes a 4-bit magnitude comparator circuit. It explains that a magnitude comparator compares two numbers and determines if one is greater than, less than, or equal to the other. It then provides the logic equations for a 4-bit magnitude comparator to calculate the outputs for A>B, A<B, and A=B based on the input bits of A and B being compared at each bit position from most to least significant. The circuit diagram for a 4-bit magnitude comparator is also included to visually depict how the logic equations would be implemented in a combinational circuit to compare the two 4-bit input numbers.

Uploaded by

ShubhPatel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Practical-4

Computer Architecture Lab

PRACTICAL 4
AIM :
To implement magnitude comparator Circuit.

Theory :
A magnitude comparator is a combinational circuit that compare two numbers and
determines their relative magnitudes.
For A and B, the outcome of the comparison is specified by three 'binary variables that
indicate weather A>B. A=B, or A<B.
Consider two numbers, A and B, with four digits each.
A= A3 A2 A1 Ao
B = B3 B2 B1 Bo
Where each subscripted letter represents one of the digits in the number. The two numbers
are equal if all pairs of significant digits are equal i.e. if A3 = B3 , A2 = B2, A, = B1, Ao =
Bo. when the numbers are binary, digits are either 1 or 0 and the equality relation of each
pair of bits can be expressed logically with an equivalence function:
Xi = Ai Bi + Ai' Bi' where I=0,1,2,3n,
Where Xi =1 only if the pair of bits in position i are equal. Le. both are 1's or both are 0's.
The equality of the two numbers, A and B is displayed in a combinational circuit by an out
put binary ,variable which we designate by the symbol ( A = B). this binary variable is equal
to 1 if the input numbers, A and B are equal and it is equal to 0 otherwise. For the equality
condition to exist, all Xi variables must be equal to 1. this dictates an AND operation of all
variables. (A=B) = X3 X2 X1 Xo
the binary variable are equal only if all pairs of digits of the two numbers are equal.
To determine if A is greater than or less than B, we inspect the relative magnitude of pairs of
significant digits starting from the most significant position. If the two digits are equal, we
compare the next lower significant pair of digits. This comparison continues until a pair of
unequal digits is reached. If the corresponding digits 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 that A<B. the
sequential comparison can be expressed logically by the following two Boolean function.

(A>B) = A3 B3 + X3 A2 B2 + X3 X2 A1 B1 + X3 X2 X1 A0 B0
(A<B) = A3 B3 + X3 A2 B2 + X3 X2 A1 B1 + X3 X2 X1 A0 B0
the symbols (A>B) and (A<B) are binary output variables which are equal to 1 when A>B
and A<B respectively.

NIRAV PATEL (13012011036)

Page 10

Practical-4

Computer Architecture Lab

Circuit Diagram :

[ 4 Bit Magnitude Comparator ]


Procedure :

NIRAV PATEL (13012011036)

Page 11

You might also like