Professional Documents
Culture Documents
Objective
Part 1
In this lab, we learn about the Xilinx software design flow with FPGA. Introduction of
Behavioral modelling with Verilog is also included.
Part 2
Implement different examples on FPGA, e.g., Implementation of Gray code on FPGA
evaluation Kit (Diligent Nexys2 Board).
Pre-Lab:
Background Theory:
In the coding, when numbers, letters or words are represented by a specific group of symbols,
it is said that the number, letter or word is being encoded. The group of symbols is called as a
code. The digital data is represented, stored and transmitted as group of binary bits. This
group is also called as binary code. The binary code is represented by the number as well as
alphanumeric letter e.g., Binary Coded Decimal (BCD), 2421 code, Excess-3 and Gray code.
Gray Code
It is the non-weighted code and it is not arithmetic code. That means there are no specific
weights assigned to the bit position. It has a very special feature that, only one bit will change
each time the decimal number is incremented as shown in Table 6.1. As only one bit changes
at a time, the gray code is called as a unit distance code. The gray code is a cyclic code. Gray
code cannot be used for arithmetic operation.
The Gray code is used in many applications in which the normal sequence of binary numbers
may produce an ambiguity or error during the transition from one number to the next. For
example, from 011 to 100 (which but will change first?) may produce an intermediate
erroneous number 101 if the value of least significant bit takes longer time to change than the
other two bits value change. As only one bit changes its value during any transition between
two number in Gray code, therefore, this problem is eliminated by the usage of Gray code.
A B C D w x y z
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
Pre-Lab Task:
1. Design a code converter that converts a 4-bit binary number to a 4-bit Gray code.
a. Provide K-Map solution and Boolean expressions
b. Provide gate-level circuit diagram
In-Lab:
always @ (sensitivity
list) begin
The sensitivity list specifies which signals should trigger the elements inside the always block
//body of an always block
toend
be updated. In combinational circuits, normally all the inputs are the part of sensitivity list.
Also “*” symbol is used in the sensitivity list, which includes all the inputs in the sensitivity
list. However, for synchronous sequential circuits the sensitivity list consists of edge
triggered clock and reset.
Bit file will be generated after the completion of ‘Generate Programming File’
process
After identification succeeded; browse the desired project’s bit file and click on
‘Open’ button
After the “Program Succeeded” message comes, test the output on FPGA by
changing different input values
In-Lab Task:
1. Using Gate-level model, write a Verilog description of binary to gray converter.
2. Using Behavioral model, write a Verilog description of binary to gray converter.
3. Implement above tasks on FPGA.
Post-Lab Task:
1. Analyse the circuits implementation of In-lab Task 1 and In-lab Task 2 in terms of
resource utilization and critical path delay.
Critical Analysis/Conclusion
Lab Assessment
Pre-Lab /1
In-Lab /5
Data
Analysis
/4 /10
Data
Post-Lab /4 /4
Presentation
Writing
/4
Style