5.1 Lab Assignment # 5
5.1 Lab Assignment # 5
Q3. A half-adder is used to add two single bit inputs. It produces a single bit output and a possible carry bit.
Below is the truth table for the same.
(i) Develop the Boolean expression and logic circuit for the given truth table.
(ii) Write a Verilog module for Universal NOR gate. Utilize the instances of NOR gate only to write a structural
Verilog code for Half adder.
(iii) Verify it with respective testbench code.
School of Computer Science Engineering and Technology
Q.4 The half adder in the previous question can only add two one-bit numbers when there is no carry bit,
which is not sufficient in many cases. While a full-adder has two one-bit inputs, a carry-in input, a sum output,
and a carry-out output. Below truth table represents a full adder.
(i) Utilize the above truth table to design the Boolean expression and digital circuit for the full adder.
(ii) Write the behavioral Verilog code for the full adder.
(iii) Verify it with respective Testbench code.
Submission Instructions:
Prepare the submission file according to the following process:
1. Copy the Verilog code, the Test Bench Code in a Word File.
2. Take the ScreenShot of Waveform and paste into the same word file.
3. Repeat Step 1 and 2 for all the programs.
4. Copy and Paste all the Verilog code, Testbench Code and Waveform into a
single word file as 1_verilog, 1_TestBench, 1_Waveform, 2_verilog, 2_TestBench,
2_Waveform… etc.
5. Convert it into pdf file, name it as RollNo_Assignment# (Example: E20CSE001_
Assignment3.pdf).
6. Submit your file on LMS within the deadline.
Write your Name and Roll No. as comment before starting of each program. Keep in
mind this is Mandatory. Failing which you may lose your marks.
Make it sure that in each program, you have mentioned enough comments regarding
the explanation of program instructions.
Each student will submit their assignment on their corresponding group slot only.
Late submission will lead to penalty.
Any form of plagiarism/copying from peer or internet sources will lead penalty.
Following of all instructions at submission time is mandatory. Missing of any
instructions at submission time will lead penalty.