een1036: digital logic design

advertisement
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:
1. Logic gates
2. Half adder design
3. 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
1. DC power supply - 1
Components
Refer to appendix for further information
2. Breadboard - 1
3. IC 7408 (quad 2-input AND gate) - 1
4. IC 7486 (quad 2-input XOR gate) - 1
5. IC 7432 (quad 2-input OR gate) - 1
6. Resistors 1.2 K - 3
7. LED - 3
Experiment 1A: Logic Gates Implementation (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.
AND
A
B
XOR
Y
A
B
Y
Fig. 1.1 AND and XOR gates
Page 1 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
Table 1.1: Truth tables
AND gate
A B
Y
0 0
0
0 1
0
1 0
0
1 1
1
XOR gate
A B
Y
0 0
0
0 1
1
1 0
1
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.
1. TTL IC 7408 contains quad 2-input AND gates
2. TTL IC 7486 contains quad 2-input XOR gates
3. 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.
1 7486
2
1 7408
2
S1
S2
S3
S4
3
Y
3
Y
1.2K
A
K
1.2K
Jumper wires as switches
Fig. 1.2 Testing basic logic gates
Page 2 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
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.
1. 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).
2. 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.
3. Please make sure that the IC and other components are placed firmly on the breadboard,
otherwise, get a new breadboard from the lab.
4. Construct the circuit as shown in Fig. 1.2.
Guidelines for connections:
i. Connect pin 7(7486, 7408) to GND line
ii. Connect pin 14(7486, 7408) to +5V line.
iii. 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)
iv. Connect pin 3(7408) - 1.2K - LED - ground line.
v. 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).
5. Use a paper to label the locations of the switches, relatively.
6. 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:
1. Switch off the power supply.
2. The circuit in Fig. 1.2 will be used in the next experiment with some modifications.
Page 3 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
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:
1. Design a half adder (Fig. 1.3a)
2. Design a 1-bit full adder (Fig. 1.3b)
3. Design 2-bit adder by combining the half adder and the 1-bit full adder (Fig. 1.3c)
Y0 X0
Y 1 X 1 C in
Y 1 X 1 C in
Y0 X0
half
adder
full
adder
full
adder
half
adder
C 0 S0
C 1 S1
C 1 S1
C 0 S0
(a)
(b)
(c)
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
X0
0
0
1
1
Y0
0
1
0
1
Outputs
Carry Sum
C0
S0
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
Page 4 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
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.
X0
Y0
S0
C0
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.
1. Connect 7408 inputs to 7486 inputs as shown in figure.
2. Verify your connections again.
3. 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]
X0
Y0
1 7486
2
1 7408
2
S1
3
S0
3
C0
1.2K
A
K
1.2K
S2
Figure 1.5 1-bit half adder
This is the end of part 1 of the experiment 1B.
Note:
1. Switch off the power supply.
2. The circuit in Fig. 1.5 will be one part of the circuit in the next experiment with some
modifications.
Page 5 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
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
X1
0
0
0
0
0
1
1
1
1
Inputs
Y1
C0
0
0
1
1
0
0
1
1
Outputs
Carry out Sum
C1
S1
0
0
0
1
0
1
1
0
0
1
1
0
1
0
1
1
0
1
0
1
0
1
0
1
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.
1. Make sure that the power supply is turned off. Insert IC 7432 on the breadboard.
2. Please make sure that the IC and other components are placed firmly on the breadboard,
otherwise, get a new breadboard from the lab.
3. Construct the circuit as shown in Fig. 1.6.
Guidelines for connections (connect from right to left, top to bottom in Fig. 1.6):
i. Remove 1.2K - LED from pin 3(7408) in Fig. 1.5.
ii. Connect pin 7(7432) to GND line and pin 14(7432) to +5V line.
iii. Connect pin 8(7486) - 1.2K - LED - ground line.
iv. Connect pin 6(7432) - 1.2K - LED - ground line.
v. Connect pin 3(7432) - pin 4(7432) line.
vi. Connect pin 6(7486) - pin 9(7486) line.
Page 6 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
vii. Connect pin 6(7408) - pin 1(7432) line.
viii. Connect pin 8(7408) - pin 2(7432) line.
ix. Connect pin 11(7408) - pin 5(7432) line.
x. 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.
xi. 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.
xii. 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.
3. Use a paper to label the locations of the switches and the LEDs, relatively.
4. Verify your connections again.
X1
7486
9
6
4
5
Y1
S3
S4
Cin
From pin 3(7408)
in Fig 1.5
10
4
6
5
9
8
10
12
11
13
7408
1.2K
8
S1
1
3
2
4
6
C1
5
7432
1.2K
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.
1. Turn on the power supply.
2. Record and evaluate your observation results in Table R1 in the result sheet.
[3 marks]
At the end of your experiment,
1.
2.
3.
4.
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 implemented logic gates functions using ICs, and analyzed and
evaluated binary adder functions.
Page 7 of 8
EEN1036: Digital Logic Design, Lab Exp. DL1
APPENDIX
Breadboard: Internal connections
Horizontally connected
Horizontally connected
Vertically
connected
Vertically
connected
THE RESISTOR COLOR CODE CHART
COLOR
Black
Brown
Red
Orange
Yellow
Green
Blue
Violet
Gray
White
Gold
Silver
No Color
SIGNIFICANT
DIGIT
0
1
2
3
4
5
6
7
8
9
-
MULTIPLIER
TOLERANCE
1
10
100
1,000
10,000
100,000
1,000,000
10,000,000
100,000,000
0.1
0.01
-
1%
2%
3%
4%
5%
10%
20%
Pin layouts
7432 OR
gate
7408 AND
gate
7486 XOR
gate
Removal of inserted IC from breadboard
Use the tip of a pen to remove the IC as shown in the figure below.
Make sure that the IC legs are not bent during the removal.
Component testing
Testing logic gates: Use Fig 1.2 and Table 1.1
Testing LED: Use multimeter in diode test mode.
Repeat
Page 8 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 gate
A 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). The input (X1 X0) is to be
added to input (Y1 Y0). The output will be (C1 S1 S0). Analyze the input and output manually
and evaluate whether your circuit follow your analysis.
Input switches
S4
Y1
CLS(0)
CLS(0)
CLS(0)
CLS(0)
CLS(0)
CLS(0)
CLS(0)
CLS(0)
OPEN(1)
OPEN(1)
OPEN(1)
OPEN(1)
OPEN(1)
OPEN(1)
OPEN(1)
OPEN(1)
S3
X1
CLS(0)
CLS(0)
CLS(0)
CLS(0)
OPEN(1)
OPEN(1)
OPEN(1)
OPEN(1)
CLS(0)
CLS(0)
CLS(0)
CLS(0)
OPEN(1)
OPEN(1)
OPEN(1)
OPEN(1)
S2
Y0
CLS(0)
CLS(0)
OPEN(1)
OPEN(1)
CLS(0)
CLS(0)
OPEN(1)
OPEN(1)
CLS(0)
CLS(0)
OPEN(1)
OPEN(1)
CLS(0)
CLS(0)
OPEN(1)
OPEN(1)
S1
X0
CLS(0)
OPEN(1)
CLS(0)
OPEN(1)
CLS(0)
OPEN(1)
CLS(0)
OPEN(1)
CLS(0)
OPEN(1)
CLS(0)
OPEN(1)
CLS(0)
OPEN(1)
CLS(0)
OPEN(1)
Output LED
C1
OFF
ON
Output LED
S1
OFF
ON
Output LED
S0
OFF
ON
Answer the following questions:
What are the results of the following binary additions? Verify them with your experimental
results.
1
0
0
1
1
0
1
1
(X1 X0)
(Y1 Y0)
(C1 S1 S0)
1
1
0
1
0
0
1
1
0
1
1
1
1
1
1
1
1
EEN1036: Digital Logic Design, Lab Exp. DL1, result and mark sheets
Student ID ……………………… Name ………………………………….. Major ………………………….
___________________________________________________________________________
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)
2
Download