Lab2_031359 1
Lab2_031359 1
R
1. Latch
2. Flip-Flop
H
Each of these elements can store 1-bit of data. We can combine multiple flip-flops to store a word
(data of width more than 1) and the resulting storage element is called a register.
,L
In this session, we will learn about the behavior of these basic memory elements and their SV
descriptions.
3. Register Files
The testbench design for a synchronous circuit is different from a combinational circuit as all the
outputs are changed wrt the synchronizing clock’s edge. As a result, the test signals that we need
to apply to synchronous circuits should also be synchronized to the clock. In this section, we will
learn how to design stimulus for synchronous circuits.Design and SV Description of Finite-State
Machines
We start from the design of synchronous circuits using finite-state machine (FSM) and will discuss
its two types: Mealy and Moore. We will further discuss how the two state machines differ in their
timing and finally learn their SV description.
Tasks
1. A 8-bit parallel-input serial-output shift register takes in 8-bit parallel values as input and
takes out one bit at a time starting from the LSB. A block diagram with input/output
specifications is given below:
Copyright © 2022 “University of Engineering and Technology, Lahore” All rights reserved.
7
The input data_i is loaded into the shift register and when shift_i is asserted, one bit
comes out of the serial_out_o pin with LSB first.
R
2. Write SystemVerilog description of a 8-bit parallel-input serial-output shift register.
3. Verify the 8-bit shift register by applying random inputs and observing the output.
4. Write a SystemVerilog description of the following state-transition graph (STG).
H
,L
ET
U
EE
5. Design the UART Tx module using the FSM created in the above task as its controller and
the following datapath.
Copyright © 2022 “University of Engineering and Technology, Lahore” All rights reserved.
8
R
H
References
[1] Harris, Sarah L., and David Harris. Digital Design and Computer Architecture, RISC-V Edition. Morgan
Kaufmann, 2021.
,L
ET
U
EE
Copyright © 2022 “University of Engineering and Technology, Lahore” All rights reserved.