Beruflich Dokumente
Kultur Dokumente
Introduction
Dataand signals can be represented in various forms. Previously, we have studied and exercised in Pre-
Lab that typing an architecture for an entity is by assigning a signal and data to a certain port declared as
in a dataflow process.In fact the forms of behavioral written formats can either be concurrent or sequential
.Below we will discuss the types of approach that can be used to type a VHDL behavioral approach in
the architecture.
A VHDL architecture contains a set of concurrent statements. Each statement defines one of the connect
ed block or processes that describe the overall behavior or structure of a design. For a structured stateme
nt, we use the port mapping techniques and instantiation declarations as described in Pre-Lab.
When we say concurrent, this means that for each block or process are done and executed cont
inuously. The modeling choices for a behavioral approach can be described as follows:
Both of these styles are the two main concurrent statements and can either be apart or nested together in
side an architecture. Nesting of statements:
For the purpose of this lab we will learn some of the modeling techniques commonly used.
1. If statement
Page | 2
Process (sensitivity_list, [sensitivity_list])
Begin
If condition then
{sequential statement;}
Elsif condition then
{sequential statement;}
Else
sequential statement;}
End if;
End process;
2. Case statement
Example: ALU Design (Please perform this part before attending lab session)
One essential function of most computers and calculators is the performance of arithmetic operations.
These operations are all performed in the Arithmetic Logic Unit or ALU inside the CPU of a computer,
where logic gates and registers are combined so that they can add, subtract, multiply and divide binary
numbers.
Figure 1
Figure 1 illustrates a block diagram of major elements included for atypical ALU. The main purpose of the
ALU is to accept binary data that are stored in the memory and to execute arithmetic and logic operations
according to instructions from the control unit as in Figure 2.
Page | 3
Figure 2
The VHDL model (Figure 2) for the function table (Table 1) can be designed as follows:
Figure 3
Task / Assignment:
Design an 8 bit Arithmetic Logic Unit (ALU) that could perform the operation list in the Table 1:
Write down the VHDL code and generate the waveform. Verify your work by demonstrate the
coding and waveform to Lab Instructor.
* You are advice to save your work as you will use back the design later
LAB REPORT
Cover page
Introduction (describe briefly on ALU less than 200 words)
Objectives
Methodology: VHDL Model/Coding & explanation
Results & discussion
Example: ALU design (4-bit ALU)
Waveform
RTL Viewer
Task/Assignment (8-bit ALU)
Waveforms
RTL Viewer
Conclusion
REMINDER
Please uses Lab Report Template as provided in Portal.
Please submit lab report within ONE (1) week after your lab session.
If you failed to follow the rules, Deduction Mark Penalty will be applied.