Notes prepared by Prof. Wang for ECE2411 students 06 - 15 – 2015


The following notes are prepared for ECE2411 students to learn how to use Modelsim to simulate sequential circuits.
Example 1: A counter counts from 0, 1, 2, 3, 4, 5, then repeat this sequence

This page describes how to setup and run a simulation using Modelsim SE.

Run Modelsim, Click on "Jump Start" and select "Create a Project". Start by entering the project name and a project locator as shown below. We type counter_5 as project name

Click "OK". On the "Add Items to the Project" screen, click on "Add Existing Files" and enter a file name. We add four files: DFF.v TFF.v counter_5.v t_counter_5.v

Repeat four times to add four files. Then we have the following window.


Click Compile, then select Compile All. If no errors, after compilation, the ? becomes a green ck sign.

Click Simulate, click Start Simulation. We have the following screen.

Click work, select t_counter_5, for simulation, disable Enable optimization as shown in the following screen.


Click OK, we have the following screen. We have sim window, objects window, Waveform window and Transcript window.

Right click t_counter_5, select Add Wave to the waveform window.

Click Simulate, select Run, click run 100, (it means run 100 ns) or you can type run 400ns in the transcript window. We have the following screen

Move the mouse on top the waveform, right click, select Zoom Cursor, several times, until you can see the waveform clearly. Also choose radix in decimal

After simulation, click Simulate, click End simulation.

You can also edit your code as shown below by click on Project tab in the left window.

Lab: Design and simulate a counter which counts from 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 using Modelsim