0% found this document useful (0 votes)
45 views

Beginning FPGA Programming - Partie31

This document describes how to use ModelSim software to simulate and visualize the output of a boolean algebra example circuit. It includes steps to open the boolean algebra example file in ModelSim, add signals to the waveform window to view their values over time, force specific input signals high or low, and run a TCL script to automatically toggle the inputs and observe the resulting output. The output stays low until one input is low, matching the boolean equation. Figures are provided with each step to show the ModelSim windows and signal values.

Uploaded by

ali alilou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Beginning FPGA Programming - Partie31

This document describes how to use ModelSim software to simulate and visualize the output of a boolean algebra example circuit. It includes steps to open the boolean algebra example file in ModelSim, add signals to the waveform window to view their values over time, force specific input signals high or low, and run a TCL script to automatically toggle the inputs and observe the resulting output. The output stays low until one input is low, matching the boolean equation. Figures are provided with each step to show the ModelSim windows and signal values.

Uploaded by

ali alilou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables

Figure 8-10.  Select Simulation Language

8.
The following two windows should pop up (see Figure 8-11 and 8-12)

Figure 8-11.  ModelSim Main window

144
Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables

Figure 8-12.  ModelSim waveform window

9.
In the Library Window, click the cross next to the work library and right-click
on boolean_algebra_example2. Click Simulate. Or type vsim work.boolean_
algebra_example2 in the transcript box shown in Figure 8-13. ModelSim should
show something like Figure 8-14. It will have Sim, Transcript, Processes, and
Objects windows.

Figure 8-13.  Start simulation

145
Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables

Figure 8-14.  New section started in ModelSim when simulation was started

10.
We need to add signals to the wave windows to see what is happening. Right-
click boolean_algebra_example2 in the sim window and select Add Wave. Or
type add wave -position insertpoint sim:/boolean_algebra_example2/* in the
transcript (tool command language (tcl) window). See Figure 8-15. Figure 8-16
shows all of the signals in the design (A, B, C, Result, and temp)

146
Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables

Figure 8-15.  Adding signals to the wave windows

Figure 8-16.  Wave window shows all the signals

11.
Right-click A signal and select Force…. Force Selected Signal window pop-up
(Figure 8-17). Change the Value from U to 1 (Figure 8-18) and click OK. Or type
force -freeze sim:/boolean_algebra_example2/A 1 0 in the transcript (tcl
window).

147
Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables

Figure 8-17.  Force signal A to high (1)

Figure 8-18.  Force signal A to high (1)

12.
To speed up the process, please run the following tcl script (Listing 8-3) in the
Transcript window. See Figure 9-19 for the waveform window. This tcl set all
inputs (A, B, and C) to high and changes the inputs one by one to low every 100
ns. The output (Result) stays low until 300 ns, when it changes to high. It matches
our Boolean algebra equation.

148

You might also like