Professional Documents
Culture Documents
EEE-241
Registration CIIT/FA19-BCE-050/ISB
Number
Class BCE-2A
Pre-lab Task:
Design a code converter that converts a 4-bit binary number to a 4-bit Gray code.
By Hand:
For X: (By K-MAP Solver)
By Hand:
For Y: (By K-MAP Solver)
By Hand:
For Z: (By K-MAP Solver)
By Hand:
Gate-Level Circuit Diagram of Simplified Equation:
W=A
X = a’b + ab’
Y = b’c + bc’
Z = c’d + cd’
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.
Post-Lab Task:
Analyze the circuit implementation of In-lab Task 1 and In-lab Task 2
in terms of resources utilization and critical path delay.
In this lab we learned, how to convert binary code to grey code. We learned the
data flow and gate level coding for binary to grey code. We also learnt a new
coding technique in Hardware Descriptive Language known as Behavioral level
coding. At the end, we came to know about the design summary of behavioral and
gate level coding.
LAB #07: Design and Implementation of n-bit
Adder/Subtractor on FPGA
Pre-lab Task:
1. Using Gate-level models, write a Verilog description of a Half-Adder.
Bit
V Calculated Cout Cin
3 2 1 0
A 0 0 0 0 0
B 0 0 0 0 0
1 Sum 0 0 0 0 0 0
Difference 1 0 0 0 0 1
A 0 0 1 1 0
B 0 0 1 1 0
2 Sum 0 0 1 1 0 0
Difference 1 0 1 1 0 1
A 1 0 1 0 1
B 1 0 1 0 1
3 Sum 1 0 1 0 0 0
Difference 0 0 1 1 0 1
A 1 1 1 1 1
B 1 1 1 1 1
4 Sum 1 1 1 1 0 0
Difference 1 0 0 0 1 1
4-bit Magnitude Comparator:
Post-Lab Task:
Using Behavioral model, write a Verilog description of n-bit Adder / Subtractor.
o Make one stimulus for two different parameter values and show the wave
forms result.
Critical Analysis:
In this lab i learned about binary Adder/Subtractor, their implementation on
Verilog. I also learned a new keyword known as Parameter used to write n-bit
codes on Verilog.
I also wrote 4-bit Adder/Subtractor codes on Verilog and checked their output on
Xilinx.
LAB #08: Design and Implementation of n-bit
Binary Multiplier on FPGA
Pre-Lab Task:
Structural level code for 2 bit by 2 bit multiplier:
Test-Bench for 2 bit by 2 bit multiplier:
Post-Lab Task:
1. Using Behavioral model, write a Verilog description of parametrized Multiplier.
o Make one stimulus for two different parameter values and show the wave
forms results.
2. Analyze the circuits’ implementation of Structural Binary Multiplier and Behavioral-
Level Multiplier, in terms of resource utilization and critical path delay.
Critical Analysis:
In this lab I learned the implementation of n-bit multiplier on Verilog. I learned the structural
and behavioral level coding technique for multiplier on Verilog. I also learned the
implementation of n-bit multiplier using parametrized Verilog description. Then I did a
simulation of multiplier code on Proteus.
LAB #09: Design and Implementation of BCD
to 7-Segment Decoder on FPGA
In-Lab Task:
Proteus Simulation of BCD to 7-Segment Display:
BCD 7-Segment
D C B A a b c d e f g DP Hex
0 0 0 0 0 0 0 0 0 0 1 1 0
0 0 0 1 1 0 0 1 1 1 1 1 1
0 0 1 0 0 0 1 0 0 1 0 1 2
0 0 1 1 0 0 0 0 1 1 0 1 3
0 1 0 0 1 0 0 1 1 0 0 1 4
0 1 0 1 0 1 0 0 1 0 0 1 5
0 1 1 0 0 1 0 0 0 0 0 1 6
0 1 1 1 0 0 0 1 1 1 1 1 7
1 0 0 0 0 0 0 0 0 0 0 1 8
1 0 0 1 0 0 0 1 1 0 0 1 9
Post-Lab Task:
BCD to 7-Segment Display Verilog Code:
Test-Bench for BCD to 7-Segment Display:
Critical Analysis:
In this lab I came to know about 7-segment display and its use in electronics. I learned the
conversion of BCD to 7-Segment display using Verilog and also simulated it on Proteus. Also, I
learned the use of CASE statements in the conversion BCD to 7-Segment display.