Lab 3
Lab 3
WEEK 3
Sequential Logic Circuit
1 Introduction
1.1 Aims
• Practice in designing sequential logic circuits using Verilog HDL behavioral model.
• Understand the blocking/non-blocking assignment to design a combinational/sequential circuit.
• Understand finite state machine models and practice in model FSMs using Verilog HDL.
1.2 Preparation
2 Exercises
2.1 Exercise 1
Board to make it blink interleave with each other (turn on for 0.5s - turn off for 0.5s). Know that the
input clock frequency is 125 MHz.
Write test benches to simulate the circuits.
Test the circuits on FPGA board using LEDs and RGB LED.
2.2 Exercise 2
clk
in
1 cycle
out
The output is active HIGH in 1 cycle of clock when a rising edge occurs in input signal. Delay is within
0-2 clock cycles.
Write RTL code and test benches to simulate the circuit.
NOTICE: This circuit is very important. Please complete it regardless of whether you can do it by
deadline or not.
b. Write a 4-bit binary counter that counts up 1 unit when a button is pushed. Use the edge detection
circuit to generate an enable signal for the counter when pushing the button. Test the design on FPGA
board.
2.3 Exercise 3
• Button 1: Mode Circular Shift Left Ring : Shift 4-bit string to left in a ring every 1s.
• Button 2: Mode Circular Shift Right Ring: Shift 4-bit string to right in a ring every 1s.
Draw a state diagram to illustrate the designed FSM. Student can use Moore or Mealy model.
Write a test bench to simulate the circuit and test the circuit on the Arty-Z7 board.
• Partitioning the design into blocks, may draw a block diagram. Separate the state machine and the
string display logic.
• Define the inputs, outputs of the FSM, then design the FSM.
• Modeling the FSM using Verilog HDL. Use the FSM’s outputs to control the string display.