Sunteți pe pagina 1din 7

Magnitude Comparator

Digital Electronics Lab Mini Project Report


Members:
1. Soham Karyakarte 111205032
2. Supriya Kawathekar 111205034
3. Smita Lokhande 111205038

Magnitude Comparator

Introduction
It basically is a digital electronic device which compares the magnitude of two binary
inputs. The inputs we have provided are 4 bit binary numbers. So this comparator compares
the values of the two bits inputted and gives their equality relation. It tells whether the two
numbers are equal, whether first number is greater than the second number or whether first
number is less then second number. The result is displayed correspondingly on a seven
segment display.
The Actual Circuit
Let the two numbers to be compared be A and B. The bits constituting A A3, A2,
A1, A0. Similarly the bits constituting B B3, B2, B1, B0. A3 and B3 being MSBs. There
are in all 3 outputs. There are 3 different circuits for each one of the required output.
Note: We have developed low logic circuit (i.e. equal output is low to denote that the
numbers are equal other two outputs are high at this instant, similarly greater output is low to
denote 1st number is greater than the 2nd number other two are high in this case. Lesser
output is low to denote that 1st number is less than 2nd number)
Equality indicating circuit
1. For equality each and every corresponding bit should be equal. Hence we take the
XOR outputs of corresponding bits (i.e. A3 XOR B3, A2 XOR B2 etc.).
2. Finally we take out all the XOR outputs and pass all of them through an OR gate. In
this case we should use a 4 input OR gate. But due to the limitations of the IC
availability we have used 2 input OR gates and ORed 4 inputs to get one single
output.
3. The output will be low only when all the inputs are low. The inputs to the OR will be
low only when Ai=Bi.

4. Even if 1 output of XOR is high, the output of OR will be high thus indicating that the
numbers are not equal.
5. When inputs are equal, the final output will be low.
Greater than circuit
1. To show that 1st number is greater than 2nd number we compare individual bits giving
highest priority to the MSB.
2. Hence first we compare A3, B3. If A3>B3, directly we know that the output should
that A>B.
We compare A2 and B2 only when A3=B3, hence while comparing A2 and B2, the
output of the equality of A3 and B3 should also be checked. Hence when A3=B3 and
A2>B2 the output must be A>B.
3. To bring about the comparison we invert Ai and OR it with Bi. Hence when Ai=1 and
Bi=0, output of the OR is 0 showing Ai>Bi. Note that while comparing A2, B2 we
take Inverted A2 and B2 and also the output of equality of A3 and B3 (i.e. their
XOR). Similarly to compare A1 and B1, we take A3 XOR B3, A2 XOR B2 and the
usual A1 inverted OR B1 and OR them all.
4. Doing same thing for A0, B0, We infer that even if one of the outputs of OR is low it
indicates that A>B. Thus we pass this all through AND gate. Thus when output of
final AND is low, it indicates that A>B.

Less than Circuit


1. For A=B, output E (say) is low. Output L (say) is high.
2. Similarly for A>B, output L is low and E is high.
3. When both inputs are high it indicates A<B thus at this condition output S (say) is
low.
4. Hence we pass the E and L through NAND (AND + NOT) to obtain a low at S.

(note that 1 IC hasnt been placed as we have made extension to accommodate 4 more bits)

Displaying the result

1.
2.
3.
4.

We display the result as E on seven segment display for E output low (A=B).
Display L on seven segment for L output low (A>B).
Display S on seven segment for S output low (A<B).
Correspondingly we develop truth table for E, L, S and all the seven segments of the
display, and find the expression for all the seven segments using karnaugh map
technique.

Final circuit during implementation

Power Source
1. The power source circuit is built using a 230/12 V transformer, bridge rectifier and
voltage regulator circuit.
2. As in circuit diagram, the 100uF capacitor is used for smoothing or filtering out the
ripples caused after the rectification (AC to DC).
3. The next capacitor is for the voltage regulator.
4. The final capacitor is to store voltage for a short amount of time. Here final output of
5 V is obtained

Further Applications
1. The comparator circuit can be used to compare any two values by cascading it with
Analog to digital converter.
2. Two obtained analogue values or an obtained value with a pre stored value can be
compared.

S-ar putea să vă placă și