Lab Assignment 10 Sequential Circuits and 7 Segment Displays
Lab Assignment 10 Sequential Circuits and 7 Segment Displays
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 modular diagram shown in
Figure 1. The user stores the number to display on first seven-segment display
The lab manual is exclusively for the students of the University of Engineering and Tech-
nology, Lahore.
©2020 UET Lahore.
1
by choosing sel = 2’b00, num in = desired number and turning the switch
wr ON and then OFF. Similarly, the user stores the numbers to display on other
three seven-segment display by following the same method except choosing a
different memory location with the help of sel signal. At the end of the writing
process, with WR=0, all the seven-segment displays should show all the stored
numbers at the same time.
Table 1 explains the operations in the circuit in more detail. We will first use
the write operation to store the four values corresponding to different seven-
segment displays. After the write operation, we will read the stored numbers
using WR=0 only.
All the seven-segment displays share the same data wires. Therefore, at any
point in time, we are limited to display only one number on a single display.
However, if we enable different seven-segment displays fast enough, it can create
an illusion that all seven-segment displays are turned 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 FPGA
board provides an on board clock signal of 50 MHz. 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.).
b) Design a test-bench for the circuit of part (a). The test bench should simulate
every possible input combination. 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) Develop a proper “layout” and “format” for the simulated waveform. If
needed, use multiple screen captures to make the 6-bit output patterns visible.
To get full credits, the input and output signals should be properly arranged
and represented in a proper format so that the simulation result can be easily
understood.
2
2 Instructions
a) Prepare a report for everything that you have done in “Lab Tasks”. The
report should include the following:
• A hand-sketched design partition of the system. The design partition
should include multiplexers, demultiplexers, encoders, decoders, flip-flops,
and should avoid gates as much as possible.
• Verilog code for the main module named as lab10 seq 7seg.
• Verilog code for the test-bench tb lab10 seq 7seg.
• Screen captures of ModelSim simulation waveform (you must include your
registration number on the top right side of every capture).