lab5
lab5
Sequential Circuits
1 Lab Tasks
a) The customer asks you to build a circuit to display different numbers (0
to 7) on a seven-segment display. The circuit has the following modular
diagram. The user stores the number to display on first seven-segment dis-
4
1
3
num
sel 2
wr
clk
reset 7
1
Table 1: Input/Output Truth Table
OPERATION RESET SEL WR DATA D1 D2 D3 D4
RESET OPERATION 1 XX 0 X 0 0 0 0
0 00 1 1 1 OFF OFF OFF
0 01 1 2 OFF 2 OFF OFF
WRITE OPERATION
0 10 1 3 OFF OFF 3 OFF
0 11 1 4 OFF OFF OFF 4
READ OPERATION 0 XX 0 X 1 2 3 4
ON. Human eyes cannot perceive that a display is turning ON and OFF
if this switching happens for more than 24 times a second. To be on the
safe side, you can switch different displays ON and OFF at a rate of 100
times per second (100 Hz).
The lab requires that the circuit should have a time reference in it. The
starter kit board provides an on board clock signal of 50 MHz (see the
starter kit data sheet for more information). However, if you make a
circuit that switches different seven-segment displays at a rate of 50M
times per second, the seven-segment display drivers may not be able to
respond to such a high frequency change. Therefore, you will need to
bring the clock down to approximately 100 Hz as discussed above (Hint:
To bring the clock down to 100 Hz from 50 MHz, you may be able to use
a toggle flip-flop in a clever way. Look at the output of a toggle flip-flop
carefully.).
For information on seven-segment display, refer to the data sheet of the
starter kit.
You are NOT allowed to use latches in your design for the assignment.
b) Design a test bench for the circuit of part (a). The test bench should
simulate the way you test your hardware in the lab. For example, in the
start of the test bench, try writing to all memory locations and then start
the read operation instead of iterating through all the possible input data
patterns.
c) Synthesize the circuit for the starter kit available in the lab. Tie inputs to
the switches and outputs to the seven-segment displays available on the
board.
2 Questions
Answer the following questions:
a) Read the synthesis report and identify how many resources in the FPGA
such as lookup tables (LUTs), input/output (IOs), etc., has been utilized.
2
Is this resource usage equal to the resource usage of the circuit you de-
signed on paper?
b) If we increase or decrease the switching rate of different seven-segment
displays, what happens? Try changing the switching rate to 200, 50, and
10 Hz.
3 Instructions
a) A written report is required for this lab. The report should include the
following:
The lab manual is for the exclusive use of the students of University of Engineering and
Technology, Lahore. c 2019 UET Lahore.