Escolar Documentos
Profissional Documentos
Cultura Documentos
LAB 4
Multiplexer Description
Using Truth Table Entry
upt@coreel.com
CG-CoreEl
Introduction
This lab introduces the Truth Table entry feature of the FPGA Advantage. In this lab you will
describe an 8:1 multiplexer using Truth Table entry. After completing this lab you will have an
understanding of using truth table entry for describing the block such as multiplexer, comb logic etc.
This lab comprises three primary steps:
1. Create a new project
2. Graphically describe the behavior of a multiplexer using truth table entry.
3. Convert the truth table into HDL.
Following each general instruction for a given procedure, you will find accompanying step-by-step
directions and illustrated figures that provide more detail for performing the general instruction. If
you feel confident about a specific instruction, feel free to skip the step-by-step directions and move
on to the next general instruction in the procedure.
Step 1
Launch the FPGA Advantage HDL Designer and create a new project.
Select File New Project, New Project Wizard opens (Figure 1.1)
: multiplexer
: 8:1 multiplexer
: C:/training/labs/lab4
: work
: Unchecked
upt@coreel.com
CG-CoreEl
C
Create a new truth table entry design using File Creation Wizard.
After Clicking Next in the New Project Wizard, File Creation Wizard will appear (figure 1.2),
Select Create new design Files and Click finish
In the Design Content Creation Wizard select Graphic View in Categories, Truth Table in the
File Types and VHDL for language option. (Refer to figure 1.3) and click Next.
Enter the following Details in the Design Specification wizard (refer to Fig 1.4) and Click Next
o Library
: work
o Entity Name : multiplexer
o Architecture : rtl
upt@coreel.com
CG-CoreEl
Specify Interface wizard appears, enter the following ports for the design (Figure 1.5) and click
Finish.
Port
Direction
Type
Bounds
data_in
IN
std_logic_vector
(7:0)
sel
IN
std_logic_vector
(2:0)
data_out
OUT
std_logic
upt@coreel.com
CG-CoreEl
Truth Table Entry
Step 2
Delete a column and add more rows to default view of Truth Table Entry window.
Analyze the Default view of Truth Table Entry Wizard (Figure 2.1).
Since the data_in column is not required, delete the data_in column. To delete the data_in column
right click on it and select delete column option.
Add 5 more ROWS to truth table by right clicking on the truth table and selecting Add Row 5
times. Refer to figure 2.2
Describe the 8:1 multiplexer logic in truth table entry window as shown in figure 2.3.
Sel
000
001
010
011
100
101
Truth Table Entry Lab
Data_out
data_in(0)
data_in(1)
data_in(2)
data_in(3)
data_in(4)
data_in(5)
upt@coreel.com
CG-CoreEl
110
111
data_in(6)
data_in(7)
X
To enter a value to a cell, double click on it and enter the value. Figure 2.4.
Add the values as shown in the figure 2.3 & complete the truth table. After completion, save the
design. Figure 2.5 shows the completed design.
upt@coreel.com
CG-CoreEl
Convert Truth Table entry to HDL
Step 3
Convert the truth table entry to HDL and view generated HDL.
Select Table Truth table properties to set the HDL style of Implementation.
It opens the Truth Table properties window, select if as HDL Implementation Style.
To generate the HDL equivalent of the truth table, in the tool bar click Generate button. Refer to
Figure 3.2.
The Generate plug-in checks for the correctness of the truth table and then generates the
equivalent HDL code. If any errors were found, it reports them. (Figure 3.3 Example).
upt@coreel.com
CG-CoreEl
After completing the Generation process, Generate process shows Generation Process
completed successfully message in Log Window.
After successful generation of HDL code, Click on View Generated HDL option in the HDL
menu.
This opens the generated HDL code in Design Pad as shown in Figure 3.5. Analyze the code and
note the if-else style of implementation. After analyzing close the Design Pad.
upt@coreel.com
CG-CoreEl
Change to the HDL style to case in the Truth Table Properties window and generate the
HDL.
Launch Truth Table properties and change the HDL Style to CASE and click ok to close the
Truth Table properties window.
Save the Design and Generate the HDL code for the design using Generate plug-in.
View the Generated HDL using View Generated HDL option. This will open the HDL code in
the Design pad. Note that the multiplexer is described in case style.
upt@coreel.com
CG-CoreEl
Conclusion
In this demonstration, you completed the major stages of the Graphical Design Entry in HDL
Designer: creating a project, Using Truth table entry, generating the HDL code and controlling the
HDL conversion.
In the next module, you will understand the State Diagram Entry in HDL Designer
upt@coreel.com