Lab 1: Implementation of Boolean function on breadboard with logic gates and functional ICsElectronics Department Ho Chi Minh City University of Technology, Vietnam 3 LAB 1:IMPLEMENTATIO
Trang 1VIET NAM NATIONAL UNIVERSITY HO CHI MINH CITY – UNIVERSITY OF TECHNOLOGY FACULTY OF ELECTRICAL AND ELECTRONICS ENGINEERING
DEPARTMENT OF ELECTRONICS
oOo—
INTRODUCTION TO COMPUTING
LABORATORY MANUAL
Trang 2Electronics Department
Ho Chi Minh City University of Technology, Vietnam 2
TABLE OF CONTENT
ABOUT THE MANUAL 1
LAB 1: IMPLEMENTATION OF BOOLEAN FUNCTION ON BREADBOARD WITH LOGIC GATES AND FUNCTIONAL ICS 2
A PRELAB 2
I IMPLEMENTATION OF DIGITAL CIRCUIT ON BREADBOARD 2
II QUESTIONS 6
B LAB MANUAL 13
I OBJECTIVES 13
II LAB PREPARATION: 13
III LAB INSTRUCTION: 13
LAB 2: IMPLEMENTATION OF BASIC LOGIC GATES AND FUNCTIONAL ICs ON FPGA 26
A PRELAB 26
B LAB MANUAL 34
I OBJECTIVES 34
II LAB PREPARATION: 34
III LAB INSTRUCTIONS 34
APPENDIX 1: QUARTUS AND UBUNTU INSTALLATION ON WINDOWS 48
A UBUNTU INSTALLATION ON WINDOWS 48
I Download and install Xming and WSL2: 48
II Install Ubuntu on Windows: 48
III Some basic commands in Linux 51
B INSTALL QUARTUS 13.0SP1 53
APPENDIX 2: DIGITAL CIRCUIT DESIGN FLOW USING SYSTEMVERILOG 54
A DESIGN FLOW 54
B COMBINATIONAL LOGIC MODELING 55
I Problem 55
II Design 55
Trang 3Electronics Department
Ho Chi Minh City University of Technology, Vietnam 1
C SEQUENTIAL LOGIC/FSM MODELING 69
I Problem 69
II Problem analysis: 69
III Design 70
Trang 4ABOUT THE MANUAL
This document is intended to serve as a lab manual for students enrolled in Introduction to Computing Lab at HCMC University of Technology All the Lab Experiment is designed for students to:
- Implement combinational and sequential systems on testboard, using digital ICs.
- Implement digital systems on FPGA, using SystemVerilog.
There are 4 labs:
Lab 1 – Implementation of Boolean function on breadboard with Logic Gates and Functional ICs Lab 2 – Implementation of Boolean function on FPGA with Logic Gates and Functional Digital ICs Lab 3 – Implement Arithmetic Circuits and Sequential Circuit on breadboard.
Lab 4 – Implement Arithmetic Circuits and Sequential Circuit on FPGA.
In order to complete the lab on time, all students are required to do prelabs before each class.
Trang 5Lab 1: Implementation of Boolean function on breadboard with logic gates and functional ICs
Electronics Department
Ho Chi Minh City University of Technology, Vietnam 3
LAB 1:IMPLEMENTATION OF BOOLEAN FUNCTION ON BREADBOARD WITH LOGIC GATES AND FUNCTIONAL ICS
A PRELAB
I. IMPLEMENTATION OF DIGITAL CIRCUIT ON BREADBOARD
Breadboard is the component on which the circuits can be set up and external experimentscan be done The information about usage is given in Figure 1.1
Figure 1.1: Breadboard connections
Remember these points when implement digital circuits on breadboard :
- Inserting a DIP – Dual Inline Package:
Before you insert a DIP into the breadboard, make sure all pins are straight When youinsert a DIP in the breadboard, make sure that the pins on one side of the DIP are notconnected to the pins on the other side of the DIP This means that the DIP must straddleone of the long gaps that divide the breadboard into separate sections
- Providing access to the DIP:
Trang 6(a) (b) (c)
As you wire your circuit, be sure to leave yourself easy access to the DIP's pins so that youcan touch them with a probe and so that you can replace the DIP without disconnecting anywires In particular:
Never pass a wire over a DIP Instead, route the wires around the DIP
When you run wires to a DIP, use the breadboard holes farther away from the DIP beforeyou use the holes that are closer
- Removing a DIP:
Do not use your fingers to remove a DIP from the breadboard It's too easy for your fingers
to slip, causing the DIP to twist This results in bent pins Instead, use a chip puller to gentlypull the chip up from the board
- Input and output connections:
There are two logic levels of input data: HIGH (1) level and LOW (0) level In this course, almost digital ICs are TTL, in which HIGH level and LOW level are prescribed asbelow:
Input: the signal is called HIGH when the voltage is between 2V and 5V, and LOW
when the voltage is from 0 to 0.8V
Output: the signal is called HIGH when the voltage is between 2.7V and 5V, and
LOW when the voltage is from 0 to 0.5V
We usually apply 5V to implement HIGH level signal and 0V for LOW level signal
In this lab, DIP switches are used to supply input signal Several ways of input connectionsare shown in Figure 1.2; resistors in these circuits are usually chosen 10 Kohm It isrecommended that students implement input circuit as in Figure 1.2 (c), in which the signalequal 1 when the switch is at upper position and vice versa
Figure 1.2: Input connections
Trang 7Lab 1: Implementation of Boolean function on breadboard with logic gates and functional ICs
Electronics Department
Ho Chi Minh City University of Technology, Vietnam 4
Outputs are commonly displayed in LEDs, bar-LEDs, 7-segment LEDs,… Figure 1.3shows how to connect the output to LED; LEDs in the left circuit will be on when the signal is
1 while level 1 signal turn off the lights in the right circuit Resistors in output circuits areusually chosen 1 Kohm
Figure 1.3: Output connections
Example: Implement function �(�, � = � +)
Figure 1.4: Implementation of Boolean function F(a,b) = a + b
Trang 8Figure 1.5: Implementation of Boolean function F(a,b) = a + b – application circuit.
Trang 9II. QUESTIONS:
1 What is numbering principle in DIP IC?
2 Identify X, Y, Z, W in four circuits below:
3 If f1,f2,f3,f4 are respectively 0,1,1,0 Indentify status of each LEDs in below figure.
4 Hoàn thành bảng sau (xem datasheet của chúng)
74LS00 4 cổng NAND 14-VCC; 7-GND; 3 = 1 nand 2; 6 = 4 nand 5; …….
Trang 105 Compare IC 74LS125 and IC 74LS126 Explain the difference between these 2 ICs.
6 Implement boolean function �(�, �, �) = � +
�� : ICs and quantity:
Circuit implementation (remember to note pin numbers on ICs)
Trang 11Lab 1: Implementation of Boolean function on breadboard with logic gates and functional ICs
Electronics Department
Ho Chi Minh City University of Technology, Vietnam 8
7 Implement boolean function �(�, �, �) = � + �� using NAND2 gates (2-input
NAND gates).
Convert the function using NAND equivalents:
Circuit implementation (remember to note pin numbers on ICs)
8 Implement Boolean function �(�, �, � = ) m1 + m3 + m6 (z is LSB):
Trang 12Write F in SOP form:
List all ICs used to implement the circuit:
Circuit implementation (remember to note pin numbers on ICs)
9 Implement boolean function �(�, �, � = ) m1 + m3 + m6, using NOR2 gates (2-input NOR gates)
Convert the function using NOR equivalents:
Circuit implementation (remember to note pin numbers on ICs)
Trang 1310 Given following circuit:
Write �(�, �, �) expression in SOP
Circuit implementation (remember to note pin numbers on ICs)
Trang 1411 Implement � (�, �, � = ) ∑( 2,3,5,7 ) using IC 74LS151:
Draw the circuit that implement F using IC 74LS151 and logic gates:
Circuit implementation (remember to note pin numbers on ICs).
Trang 15Lab 1: Implementation of Boolean function on breadboard with logic gates and functional ICs
Electronics Department
Ho Chi Minh City University of Technology, Vietnam 12
12 Implement � (�, �, � = ) ∑( 0,3,4,7 ) using 74LS138:
Draw the circuit that implement F using IC 74LS138 and logic gates:
Circuit implementation (remember to note pin numbers on ICs).
Trang 16B LAB MANUAL:
- Getting familiar with TTL 74LS series IC.
- Implementation of simplified Boolean functions with different logic gate combinations.
- Getting to know functional combinational ICs
Students have to complete Prelab before class Students without lab preparation won’t
be allowed to join in the class
III. LAB INSTRUCTION:
EXPERIMENT 1
Objectives: Implementation of a function math �( ,� ,� �) = � + �� in AND – OR form
Equipments:
- Analog Discovery Studio
- Integrated Circuits (ICs) : 74LS04, 74LS08, 74LS32
- Connection wires.
Procedure:
- Construct the circuit and apply the power (remember to note pin numbers on ICs)
- Apply all possible combinations to the inputs; obtain the output values then take note of the output fTest in the Table 1.1.
Trang 17Student’s implementation on breadboard:
Draw the schematic that implement F using NAND equipvalents
NAND equipvalent circuit – application circuit
Trang 18- Construct the circuit and apply the power (remember to note pin numbers on ICs).
- Apply all possible combinations to the inputs and obtain and take note of the outputs fNAND in the Table 1.1
Student’s implementation on breadboard
EXPERIMENT 2
Objectives: Implementation of a boolean function given in the truth table (Figure 1.2)
Equipments:
- Analog Discovery Studio
- Integrated Circuits (ICs) : 74LS04, 74LS08, 74LS32
- Connection wires.
Procedure:
Trang 19- Construct the circuit and apply the power (remember to note pin numbers on ICs).
- Apply all possible combinations to the inputs; obtain the output values then take note of the output fTest in the Table 1.2.
- Write the Boolean expression: F =
Trang 20Student’s implementation on breadboard
Draw the schematic that implement F using NOR equipvalents
NOR equipvalent circuit – application circuit
Trang 21- Construct the circuit and apply the power (remember to note pin numbers on ICs).
- Apply all possible combinations to the inputs; obtain the output value then take note of the outputs f NOR in the Table 1.2.
Student’s implementation on breadboard
EXPERIMENT 3
Objectives: Implementation of a boolean function given in the following schematic
Figure 1.6
Equipments:
- Analog Discovery Studio
- Integrated Circuits (ICs) : 74LS04, 74LS08, 74LS32, 74LS86.
- Connection wires.
Procedure:
- Construct the circuit and apply the power (remember to note pin numbers on ICs)
- Apply all possible combinations to the inputs; obtain the output value then take note of the outputs F 1 in the Table 1.3.
x y z F1 F2
Trang 22Lab 1: Implementation of Boolean function on breadboard with logic gates and functional ICs
Student’s implementation on breadboard
Optimize boolean function F1 and draw the schematic: F2 =
Trang 23- Construct the circuit and apply the power (remember to note IC codes and their pin numbers).
- Apply all possible combinations to the input; obtain the output value then take note of the outputs F2 in the Table 1.3.
Student’s implementation on breadboard
Give your comments on F1 and F2 results:
Trang 24- Analog Discovery Studio
- Integrated Circuits (ICs): 74LS151, 74LS04.
- Connection wires.
Procedure:
Draw the schematic diagram to implement the boolean function using 74LS151
Application cicruit
Trang 25Lab 1: Implementation of Boolean function on breadboard with logic gates and functional ICs
Electronics Department
Ho Chi Minh City University of Technology, Vietnam 22
- Construct the circuit and apply the power (remember to note IC pin numbers).
- Apply all possible combinations to the inputs and obtain and take note of the outputs F Test in the Table 1.4.
Trang 26Student’s implementation on breadboard
EXPERIMENT 5
Objectives: Implementation of a Boolean function (�, �, � = ) ∑(2,3,5,7) by using a 3x8 Decoder
Equipments:
- Analog Discovery Studio
- Integrated Circuits (ICs): 74LS138, and other logic gates.
Trang 27Draw the schematic diagram to implement the boolean function using 74LS138
Application cicruit
Trang 28- Construct the circuit and apply the power (remember to note IC pin numbers).
- Apply all possible combinations to the inputs and obtain and take note of the outputs F Test in the Table 1.5.
Student’s implementation on breadboard
Trang 29Lab 2: Implementation of Boolean function with logic gates and functional ICs on FPGA
Electronics Department
Ho Chi Minh City University of Technology, Vietnam 26
LAB 2: IMPLEMENTATION OF BASIC LOGIC
GATES AND FUNCTIONAL ICs ON FPGA
Note, the top-level file of the project must be named the name of the header file, forexample "lab2tn1_wrapper", with the module "lab2tn1" being the module containing thecode describing the design of experiment 1
Ex: The experiment of writing hardware design in SystemVerilog language for the function
�(�, �, �) = x� � as experiment 1 of lab 2, we have the following SystemVerilog code:
Figure 2.1: Implementation of �(�, �, � = ) – module “lab2tn1”
Below is top level “lab2tn1_wrapper” that implement �(�, �, � = x� �) :
Trang 30Figure 2.2: Implementation of �( ,� ,� �) = – module “lab2tn1_wrapper”
Next, students perform the simulation, and load the Kit as instructed at Lab 0
For the experiments that require the use of IC 74LS151/74LS138, students write the code describing this IC and call that module as above
● Construct the truth table of �(�, �, �) = + ��� + ��
● Write the SystemVerilog code that describe �(�, �, � = ) + ��� + ��s
instructed in lab 0 with the following pin assignment:
○ Pins x, y, z assigned to SW2, SW1, SW0 and LEDR2, LEDR1, LEDR0respectively
○ Pin f assigned to LEDG0
● Compile and simulate the project The output waveform have to show all possible input combinations Capture the output waveform
Trang 31Truth table SystemVerilog code
Waveform:
PREPARATION 2
Objectives: Write SystemVerilog code to describe
the truth table in Table 2.1
Trang 32○ Pin f assigned to LEDG0.
● Compile and simulate the project The output waveform have to show all possible input combinations Capture the output waveform
Waveform:
Trang 33○ Pin f assigned to LEDG0.
● Compile and simulate the project The output waveform have to show all possible input combinations Capture the output waveform
Trang 34PREPARATION 4
Objective: Write SystemVerilog code to describe IC Multiplexer 74LS151 Implement
function �(�, �, � = ) ∑(1,2,4,7) using that multiplexer
Procedure:
● Write SystemVerilog code describe IC multiplexer 74LS151 operation
● Using above multiplexer, write SytemVerilog code implementing Boolean function
Trang 35Truth table SystemVerilog code
Waveform:
PREPARATION 5
Objective: Write SystemVerilog code to describe IC Decoder 74LS138 Implement function
�(�, �, � = ) ∑(0,2,5,7) using that decoder
Procedure:
● Write SystemVerilog code describe IC decoder 74LS138 operation
● Using above decoder, write SytemVerilog code implementing Boolean function
�(�, �, � = ) ∑(0,2,5,7):