FPGA LAB 2 solved
FPGA LAB 2 solved
Marks
Obtained
Group Member Group Member
1 2
NAME MAHNOOR
REGISTRATION # 220701002
LAB REPORT 2
PERFORMANCE
TOTAL MARKS
DEADLINE: 10-03-2025
DATE OF SUBMISSION: 10-03-2025
________________________________________________________________________
Experiment # 02 Page 1 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Objectives:
Introduction
________________________________________________________________________
Experiment # 02 Page 2 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Click on next
________________________________________________________________________
Experiment # 02 Page 3 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Tick on RTL Project and tick do not specify spicify source at this time
For simulation puropose you can choose any random settengs. For hardware
implementatation you need to select according to the hardware
________________________________________________________________________
Experiment # 02 Page 4 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Click on finish
________________________________________________________________________
Experiment # 02 Page 5 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Add sources
________________________________________________________________________
Experiment # 02 Page 6 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
________________________________________________________________________
Experiment # 02 Page 7 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
________________________________________________________________________
Experiment # 02 Page 8 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Now go to the force clock to set the clock for each input:
For input A:
________________________________________________________________________
Experiment # 02 Page 9 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
For input B:
________________________________________________________________________
Experiment # 02 Page 10 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Tasks
1. Explain the timings digram as shown above.
As the truth table for XOR gate is:
a b c =a xor b
0 0 0
0 1 1
1 0 1
1 1 0
In XOR gate when the inputs are odd or if 1 input is 1 and other is zero then output
occurs.so form timing diagram we see that when the input A is 0 and input B is 1 so
output C is 1.it is shown in the timing diagram. This verifies that the XOR gate was
correctly implemented and simulated.
Timing diagram:
Analysis:
a b c =a AND b
0 0 0
0 1 0
1 0 0
1 1 1
________________________________________________________________________
Experiment # 02 Page 11 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Here, the AND gate was designed and simulated. The expected behavior of the AND
gate is that the output remains low (0) unless both inputs are high (1). The timing
diagram correctly represented this behavior, with the output turning high only when
both inputs were simultaneously set to 1. This confirmed the proper working of the
AND gate logic.
OR GATE:
Code:
Timing diagram
Analysis:
a b c =a OR b
0 0 0
0 1 1
1 0 1
1 1 1
Here we have focused on the OR gate implementation, where the output was expected
to be high (1) if at least one of the inputs was high. The waveform analysis supported
this, showing transitions at the correct times, ensuring that the OR gate functioned as
intended. The consistent results with the theoretical truth table indicated that the
simulation was successful.
________________________________________________________________________
Experiment # 02 Page 12 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
NOT gate:
Code:
Timing diagram:
Analysis:
a c= NOT a
0 1
1 0
Here we have focused on the NOT gate, which is the simplest of all logic gates as it
inverts the input signal. The simulation results demonstrated that when the input was
low (0), the output was high (1), and when the input was high (1), the output was low
(0). The timing diagram displayed a perfect inversion of the input signal, confirming
the correct functionality of the NOT gate.
________________________________________________________________________
Experiment # 02 Page 13 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN
_________________________________________________________________________
Conclusion:
From this lab, we have learned:
• How to design and implement basic logic gates (AND, OR, XOR, NOT) using
Verilog in Vivado Design Suite.
• The importance of testbenches and simulation in verifying the functionality
of digital circuits.
• How to analyze timing diagrams to validate gate operations against expected
truth tables.
• The role of FPGA-based digital design in developing and testing
combinational logic circuits efficiently.
________________________________________________________________________
Experiment # 02 Page 14 of 14
FPGA BASED EMBEDDED SYSTEM DESIGN