Professional Documents
Culture Documents
Lab 5 Sem 2 22 - 23
Lab 5 Sem 2 22 - 23
Faculty of Engineering
Universiti Putra Malaysia
43400 UPM Serdang
Selangor
Objectives:
1. To design, implement and test a three-bit wide 5-to-1 multiplexer and a finite
state machine for a sequence counter using Verilog design entry.
2. To implement testbenches and simulate the designs using ModelSim
software.
List of Equipment / Components:
NO. EQUIPMENT
QTY
Computer – Quartus Prime and
1 ModelSim-Intel FPGA Starter Edition 1
software
2 Terasic DE1-SoC Board 1
Introduction:
In this lab, students are required to design a multiplexer and a finite state machine
using Verilog. The design will be simulated using ModelSim-Intel FPGA software
and tested on the DE1-SoC board.
Procedures:
A. Multiplexer
2
module fivemux (S, U, V, W, X, Y, M);
input [2:0] S, U, V, W, X, Y;
output [2:0] M;
//your code here
endmodule
Listing 1: Verilog code for a three-bit wide 5-to-1 multiplexer
3) Compile and verify the design. Fix any errors that exist.
4) Implement a testbench file (tfivemux.v) for the 5-to-1 multiplexer using
Verilog. Test all possible input to the multiplexer.
5) Simulate the 5-to-1 multiplexer using ModelSim-Intel FPGA. Observe and
record the waveform.
6) Test the functionality of the three-bit wide, 5-to-1 multiplexer by downloading the
circuit into the FPGA chip on DE1-SoC board. Use switches as inputs and LEDs
as outputs.
3) Compile and verify the design. Fix any errors that exist.
3
4) Simulate the sequence counter using ModelSim-Intel FPGA by creating a
testbench file using Verilog. Observe and record the waveform.
5) Test the functionality of the sequence counter by downloading the circuit into
the FPGA chip on DE1-SoC board. Use push buttons as inputs and LEDs as
outputs.
endmodule
Listing 2: Verilog code for a sequence counter
Discussion / Conclusion:
Discuss all your experimental results and compare them with the simulation results.
Conclude the findings of your experiment.