Adder, Subtractor and Magnitude Comparator Circuits.

Experiment No. : 03

i. Design, construction and verification of Half Adder and Half Subtractor circuit.

ii. Design, construction and verification of Full Adder and Full Subtractor circuit.

iii. Design, construction and verification of 1-bit and 4-bit Magnitude comparator.

  • Design, construction and verification of Half Adder and Half Subtractor circuit

Half Adder: It adds two binary digits (A & B) results Sum output (S) and a Carry Output (C).

Truth Table

From table we see that Logic Functions and Logic Diagram will be for SUM & CARRY is S = A⊕B and C = AB

Half Subtractor: It subtracts two binary digits (X & Y) results Difference output (D) & a Borrow Output (B).

Truth Table

From table we see that Logic Functions and Logic Diagram will be for DIFFERENCE & BORROW is D = X⊕Y and B = X’Y

Figure 1. Breadboard connections of two bit half adder and half subtractor

  • Design, construction and verification of Full Adder and Full Subtractor circuit.

Full Adder: It adds three binary digits (A, B & Cin). Cin is the carry resulted from the previous addition. It gives a sum Output (S) and a Carry output (Cout).

Truth Table

From table we see that Logic Functions and Logic Diagram will be for SUM & CARRY is

SUM= A’B’CIN+A’BCIN’+AB’CIN’+ABCIN =CIN (A’B’+AB) + CIN’ (A’B+AB’) =CIN ⊕A⊕BCOUT= A’BCIN+ AB’CIN+ ABCIN’+ ABCIN = CIN (A’B+AB’)+AB = CIN (A⊕B)+AB

Full Subtractor: It subtracts three binary digits (X, Y & Bin). Bin is the borrow input. It gives  a Difference Output (D) and a Borrow output (Bout).

Truth Table

From table we see that Logic Functions and Logic Diagram will be for DIFFERENCE & BORROW is

DIFFERENCE= X’Y’BIN+X’YBIN’+XY’CIN’+XYBIN =BIN (X’Y’+XY) + BIN’ (X’Y+XY’) =BIN ⊕X⊕YBOUT= X’Y’BIN+ X,YBIN’+ X’YBIN+ XYBIN = BIN (X’Y+XY’)+XY = BIN (X⊕Y)’+X’Y

Figure 2. Breadboard connections of three bit full adder and half subtractor

So, the circuit response like as below

 INPUTS SUM/ DIFFERENCE RED LEDCARRY OUT GREEN LEDBORROW OUT BLUE LED
A/XB/YCIN/ BIN
000OFFOFFOFF
001ONOFFON
010ONOFFON
011OFFONON
100ONOFFOFF
101OFFONOFF
110OFFONOFF
111ONONON

4-bit magnitude comparator

The 7485 IC is a 4-bit magnitude comparator that compares two 4-bit binary numbers and gives outputs indicating whether one is greater than, equal to, or less than the other.

Also, in the 7485 IC, the term cascading means connecting two or more comparator ICs together so they can compare numbers larger than 4 bits.

A single 7485 can only compare 4-bit numbers (0 to 15).

If want to compare 8-bit numbers (0 to 255) or more, you connect multiple 7485s in series — this is called cascading.

Here are the pin layout:-

According to Word P and Word Q as 4 bit binary inputs the schematic functional diagram/ logic symbol represented as in shape of IC layout- 

If we create the truth table in binary form, there will be 8 variables  and the table will require 256 rows. So, it is complex one.

Now,

Step-by-step procedure- for connecting a 7485 IC as a 4-bit magnitude comparator:

1. Connect the power supply                  Pin 16 → +5V (Vcc)                  Pin 8 → Ground (GND)4. Set cascade inputs for single IC use                 A > B in (pin 4) → GND (logic 0)                 A = B in (pin 3) → Vcc (logic 1)                 A < B in (pin 2) → GND (logic 0)
2. Identify  & Connect the A inputs (A3–A0): Apply the first 4-bit binary number to pins 15, 13, 12, 10 respectively. Identify  & Connect the B inputs (B3–B0): Apply the second 4-bit binary number to pins 1, 14, 11, 9 respectively.  5. Read the outputs          A > B out → HIGH if A is greater than B          A = B out → HIGH if A equals B          A < B out → HIGH if A is less than B  
3. Take outputs from pins                   A > B out (pin 5)                   A = B out (pin 6)                   A < B out (pin 7)6. Circuit connection  

This is the circuit connection sketch