Professional Documents
Culture Documents
Beginning FPGA Programming - Partie33
Beginning FPGA Programming - Partie33
3.
In the Project Navigator, select Files. Right-click the file four_bit_adder.vhd and
click Set as Top-Level Entity.
4.
Click Processing ➤ Start ➤ Start Analysis & Elaboration from the Quartus
Prime menu or click on the blue triangle with green tick box in the tool bar to
start analysis & elaboration.
5.
Click Tools ➤ Run Simulation Tool ➤ RTL Simulation from the Quartus Prime
menu to start simulation.
6.
In the ModelSim transcript type the following to run simulation
a. ModelSim ➤ vsim work.four_bit_adder
7.
Type add wave -position insertpoint sim:/four_bit_adder/* in the transcript
box. The wave windows should show as Figure 8-22.
8.
Copy the tcl to transcript (Listing 8-5) and hit Enter.
9.
Wave windows will show all the calculation results from the four-bit adder
(Figure 8-23). All the input and output are in binary number (Figure 8-24).
Select D1, D2, and Sum with Ctrl key and then right-click it to select unsigned
(Figure 8-25).
155
Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables
156
Chapter 8 ■ Telling the Truth: Boolean Algebra and Truth Tables
A FPGA designer usually uses Boolean equations to build combination logic. They are simple and clear;
however, they may not provide the best performance (speed) design.
8.4 Summary
Boolean algebra is used to model simple true/false operations with AND/OR/NOT. In VHDL, the IEEE
provides a std_logic_1164 library to add more features on Boolean algebra in std_logic and std_logic_vector
data types.
This chapter also teaches you how to call modules from another module. It is one of the main reasons
you are using HDL to design hardware—you can reuse your modules!
■■Tip Break down big problems into small pieces and solve them one small piece at a time.
“Logic will get you from A to B. Imagination will take you everywhere.”
—Albert Einstein
158