Beginning FPGA Programming - Partie31
Beginning FPGA Programming - Partie31
8.
The following two windows should pop up (see Figure 8-11 and 8-12)
144
Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables
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.
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
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
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