EEN1036: Digital Logic Design, Lab Exp. DL1
EEN1036: DIGITAL LOGIC DESIGN
Experiment 1: Logic Gates and Their Applications
Objective
The objective of this experiment is to give students hands-on experience on how to use digital ICs, and to demonstrate the principles of logic gates and their applications.
Note: There are three different parts in this experiment. They are:
- Logic gates
- Half adder design
- 2-bit full adder design
You are required to complete all of them.
Preparation
Before starting the experiment, make sure that you have the following equipment and components.
Equipment
- DC power supply - 1
Components
Refer to appendix for further information
- Breadboard - 1
- IC 7408 (quad 2-input AND gate) - 1
- IC 7486 (quad 2-input XOR gate) - 1
- IC 7432 (quad 2-input OR gate) - 1
- Resistors 1.2 K - 3
- LED - 3
Experiment 1A: Logic Gates (30 minutes)
This part of the experiment will examine the truth table properties of basic logic gates, e.g. AND and XOR gates. The symbols and the truth tables of these logic gates are as shown in Fig. 1.1 and Table 1.1, respectively.
Fig. 1.1 AND and XOR gates
Table 1.1: Truth tables
AND gate / XOR gateA B / Y / A B / Y
0 0
0 1
1 0
1 1 / 0
0
0
1 / 0 0
0 1
1 0
1 1 / 0
1
1
0
Experimental Procedures
You can find these logic gates in readymade commercial integrated circuits (ICs). They are also known as chips. Different ICs contain different types of logical functions.
- TTL IC 7408 contains quad 2-input AND gates
- TTL IC 7486 contains quad 2-input XOR gates
- TTL IC 7432 contains quad 2-input OR gates
The pin layouts of these three ICs are given in the appendix of this lab sheet.
Input control
We shall use jumper wires as switches to control gate inputs.
CLOSED circuit (input is connected to ground) is equivalent to logic 0 (logic low)
OPEN circuit (input is connected to +5V) is equivalent to logic 1 (logic high)
Output observation
We shall use LEDs to observe circuit outputs.
The actual experimental circuit is shown in Figure 1.2. Construct the circuit using the following steps.
Fig. 1.2 Testing basic logic gates
Getting ready the power supply: Set the output voltage to +5V. Set the ammeter scale switch to LO (if any). Set the current adjustment knob to about ¼ turn from the min position. Connect the “-“ output terminal to the “GND” terminal. Ask your supervisor if you have any query.- Make sure that the power supply is turned off. Connect two jumper wires from the DC power supply's +5V and GND (ground) points to two horizontally connected lines on your breadboard, respectively (refer to appendix).
- Insert ICs 7486 and 7408 on the breadboard. Note that you will use up to 3 ICs in exp. 1B.2. Distribute your ICs on your breadboard.
- Please make sure that the IC and other components are placed firmly on the breadboard, otherwise, get a new breadboard from the lab.
- Construct the circuit as shown in Fig. 1.2.
Guidelines for connections:
- Connect pin 7(7486, 7408) to GND line
- Connect pin 14(7486, 7408) to +5V line.
- Connect pin 3(7486) - 1.2K - LED - ground line. Make sure the LED is connected in the correct direction - the longer leg of the LED is anode (A)
- Connect pin 3(7408) - 1.2K - LED - ground line.
- Connect 4 jumper wires to respective inputs of AND and XOR gates as shown and let the other ends of the wires free (these free ends will act as switches).
- Use a paper to label the locations of the switches, relatively.
- Verify your connections again.
Now you are ready for the experiment. Turn on the power supply.
Observation
By closing and opening the switches (the free ends of jumper wires) as the switching combinations given in Table 1.1, observe the output LEDs. Verify whether they follow the truth tables or not by filling in Table A.1 in the result sheet.
[1 mark]
This is the end of part A of the experiment.
Note:
- Switch off the power supply.
- The circuit in Fig. 1.2 will be used in the next experiment with some modifications.
Experiment 1B: Application of Logic Gates - Binary Adder
One simple application of logic gates is a binary adder. Its function is to add two binary numbers. In this experiment, we shall design a 2-bit binary adder in the following stages:
- Design a half adder (Fig. 1.3a)
- Design a 1-bit full adder (Fig. 1.3b)
- Design 2-bit adder by combining the half adder and the 1-bit full adder (Fig. 1.3c)
Fig. 1.3 Block diagrams of adders
1B.1 Design of Half Adder (30 minutes)
A half adder adds two 1-bit binary numbers. It has no carry input. The truth table of a half adder is given in Table 1.3.
Table 1.3 Truth table of half adder
Inputs / OutputsX0Y0 / Carry Sum
C0S0
00
01
10
11 / 0 0
0 1
0 1
1 0
Boolean equations of Sum and Carry outputs are:
S0 = X0•Y0 + X0•Y0
= X0 Y0(after simplification)
C0 = X0•Y0
Function S0 can be easily implemented using an XOR logic gate and the function C0 can be implemented using a 2-input AND gate. The logic circuit for the half adder is shown in Fig. 1.4.
Fig. 1.4 Half adder logic circuit
Experimental Procedures
The actual circuit for this experiment is shown in Figure 1.5. It is a continuation of the previous experiment. Proceed with the following steps.
- Connect 7408 inputs to 7486 inputs as shown in figure.
- Verify your connections again.
- Now you are ready for the experiment. Turn on the power supply.
Your next job is to verify the half adder truth table. Record your observation results.
[1 mark]
Figure 1.5 1-bit half adder
This is the end of part 1 of the experiment 1B.
Note:
- Switch off the power supply.
- The circuit in Fig. 1.5 will be one part of the circuit in the next experiment with some modifications.
1B.2 Design of 2-bit Binary Adder (1 hour)
The first step of this part of the experiment is to construct a 1-bit full adder. A 1-bit full adder has 3 inputs, X, Y and a carry input. Truth table of the 1-bit full adder is as shown in Table 1.4.
The 2-bit binary adder is constructed by connecting the carry output of the half adder (C0) to the carry input of this 1-bit full adder.
Table 1.4 Truth table of a 1-bit full adder
Inputs / OutputsX1Y1C0 / Carry out Sum
C1S1
000
001
010
0011
100
101
110
111 / 0 0
0 1
0 1
10
01
1 0
10
11
Boolean equations of the full adder output functions are as follows:
S1 = X1•Y1•C0 + X1•Y1•C0 + X1•Y1•C0 + X1•Y1•C0
= X1 Y1 C0(after simplification)
C1 = X1•Y1•C0 + X1•Y1•C0 + X1•Y1•C0 + X1•Y1•C0
= X1•Y1 + X1•C0 + Y1•C0(after simplification)
Experimental Procedures
The circuit for the 1-bit full adder is shown in Fig. 1.6. Proceed with the following steps:
Note: This part involves many connections. Care must be taken. Use as few jumper wires as possible.
- Make sure that the power supply is turned off. Insert IC 7432 on the breadboard.
- Please make sure that the IC and other components are placed firmly on the breadboard, otherwise, get a new breadboard from the lab.
- Construct the circuit as shown in Fig. 1.6.
Guidelines for connections (connect from right to left, top to bottom in Fig. 1.6):
- Remove 1.2K - LED from pin 3(7408) in Fig. 1.5.
- Connect pin 7(7432) to GND line and pin 14(7432) to +5V line.
- Connect pin 8(7486) - 1.2K - LED - ground line.
- Connect pin 6(7432) - 1.2K - LED - ground line.
- Connect pin 3(7432) - pin 4(7432) line.
- Connect pin 6(7486) - pin 9(7486) line.
- Connect pin 6(7408) - pin 1(7432) line.
- Connect pin 8(7408) - pin 2(7432) line.
- Connect pin 11(7408) - pin 5(7432) line.
- Connect pin 4(7486), pin 4(7408) and pin 13(7408) together by 2 jumper wires, then connect one end of a new jumper wire to one of the above pins and leave the other end of this jumper wire free. This is the input of X1.
- Connect pin 5(7486), pin 5(7408) and pin 9(7408) together by 2 jumper wires, then connect one end of a new jumper wire to one of the above pins and leave the other end of this jumper wire free. This is the input of Y1.
- Connect pin 10(7486), pin 10(7408) and pin 12(7408) together by 2 jumper wires, then connect one end of a new jumper wire to one of the above pins and the other end of this jumper wire to pin 3(7408). This is the input of Cin, connected to C0 of the half adder.
- Use a paper to label the locations of the switches and the LEDs, relatively.
- Verify your connections again.
Fig. 1.6 1-bit full adder.
Note: Your complete experiment setup is now a 2-bit adder. In this part of the experiment, you are to obtain the truth table of the 2-bit binary adder.
- Turn on the power supply.
- Record your observation results in Table R1 in the result sheet.
[3 marks]
At the end of your experiment,
- Switch off the DC power supply.
- Remove all the connections
- Return all the components used.
- Submit the result sheet and the mark sheet to your lab supervisors.
Summary
In this experiment, you have learned how logic gates function, how to make use of ICs and how a binary adder functions.
Page 1 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
THE RESISTOR COLOR CODE CHART
COLOR / SIGNIFICANT DIGIT / MULTIPLIER / TOLERANCEBlack / 0 / 1 / -
Brown / 1 / 10 / 1%
Red / 2 / 100 / 2%
Orange / 3 / 1,000 / 3%
Yellow / 4 / 10,000 / 4%
Green / 5 / 100,000 / -
Blue / 6 / 1,000,000 / -
Violet / 7 / 10,000,000 / -
Gray / 8 / 100,000,000 / -
White / 9 / - / -
Gold / - / 0.1 / 5%
Silver / - / 0.01 / 10%
No Color / - / - / 20%
Page 1 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1, result and mark sheets
Student ID ……………………… Name ………………………………….. Major ………………………….
______
Experiment 1A
Verify whether the LED follows the truth tables below.
Table A.1
AND gate / XOR gateA / B / Y / Output LED (on/off) / A / B / Y / Output LED (on/off)
0 / 0 / 0 / 0 / 0 / 0
0 / 1 / 0 / 0 / 1 / 1
1 / 0 / 0 / 1 / 0 / 1
1 / 1 / 1 / 1 / 1 / 0
Experiment 1B
Table R1 Truth table for the 2-bit full adder experiment (1B.2)
Input switches / Output LEDC1 / Output LED
S1 / Output LED
S0
S4
Y1 / S3
X1 / S2
Y0 / S1
X0 / OFF / ON / OFF / ON / OFF / ON
CLS(0) / CLS(0) / CLS(0) / CLS(0)
CLS(0) / CLS(0) / CLS(0) / OPEN(1)
CLS(0) / CLS(0) / OPEN(1) / CLS(0)
CLS(0) / CLS(0) / OPEN(1) / OPEN(1)
CLS(0) / OPEN(1) / CLS(0) / CLS(0)
CLS(0) / OPEN(1) / CLS(0) / OPEN(1)
CLS(0) / OPEN(1) / OPEN(1) / CLS(0)
CLS(0) / OPEN(1) / OPEN(1) / OPEN(1)
OPEN(1) / CLS(0) / CLS(0) / CLS(0)
OPEN(1) / CLS(0) / CLS(0) / OPEN(1)
OPEN(1) / CLS(0) / OPEN(1) / CLS(0)
OPEN(1) / CLS(0) / OPEN(1) / OPEN(1)
OPEN(1) / OPEN(1) / CLS(0) / CLS(0)
OPEN(1) / OPEN(1) / CLS(0) / OPEN(1)
OPEN(1) / OPEN(1) / OPEN(1) / CLS(0)
OPEN(1) / OPEN(1) / OPEN(1) / OPEN(1)
Answer the following questions:
What are the results of the following binary additions? Verify them with your experimental results.
1 0 (X1 X0) 1 0 0 1
0 1 (Y1 Y0) 1 10 1
(C1 S1 S0)
1 1 0 1 1 1
0 11 11 1
Part 1: Experiment 1A(Logic Gates)
1 Mark
Part 2: Experiment 1B.1
(Design of Half Addder)
1 Mark
Part 3: Experiment 1B.2
(Design of 2-bit Binary Adder )
3 Marks
TOTAL (5 Marks)
1