Lab 9 (Group 4) - 1
Lab 9 (Group 4) - 1
Lab 9 (Group 4) - 1
Group No.:4
Lab 09: Excess-3 to Gray Code Conversion using Nand Gates (Open Ended
Lab)
Muhammad 410884
Abubaker
This Open ended Lab has been divided into two parts:
In first part you are required to design and implement a Excess-3 to gray code converter.
The next part is the Verilog Modeling and Simulation of the Circuit you implemented in you first
part.
Objectives:
Lab Instructions
✓ This lab activity comprises three parts, namely Pre-lab, Lab tasks, and Post-Lab
Viva session.
✓ The lab report will be uploaded on LMS three days before scheduled lab date. The
students will get hard copy of lab report, complete the Pre-lab task before coming to
the lab and deposit it with teacher/lab engineer for necessary evaluation.
✓ The students will start lab task and demonstrate design steps separately for step-
wise evaluation(course instructor/lab engineer will sign each step after ascertaining
functional verification).
✓ Remember that a neat logic diagram with pins numbered coupled with nicely
patched circuit will simplify trouble-shooting process.
✓ After the lab, students are expected to unwire the circuit and deposit back
components before leaving.
✓ The students will complete lab task and submit complete report to Lab Engineer
before leaving lab.
✓ There are related questions at the end of this activity. Give complete answers.
1. In the lab you would be implementing an Excess-3 to gray code converter. Make a truth
table for both the codes by filling in the following tables and Simplify the expressions for
W,X,Y,Z in terms of A,B,C,D.( Use backside of the page if necessary). Use unused
combinations as don’t care conditions. Hint, u can take help from
http://engineeringproblemsandanswers.blogspot.com/2015/03/logic-circuits-1-digit-decimal-in-
excess-3-to-gray-code-converter.html
Proteus:
Proteus:
Proteus:
Lab Task 1:
Implement Excess-3 to gray code converter using only NAND gates on hardware. Paste the
complete circuit diagram, depicting hardware results. (5 Marks - Analysis)
Hardware:
Design and simulate the circuit k-map equations you obtained in Pre-lab task 1 in Verilog
dataflow modeling. Give the code and testbench and waveform in the space provided below.
Data flow code: (3Marks – Modern tool usage)
module converter(w,x,y,z,A,B,C,D);
input A,B,C,D;
output w,x,y,z;
assign w=(A&B)|(A&C&D);
assign x=A|(B&C&D);
assign y=(B&D)|(B&C)|(~B&~C&~D);
assign z=~C;
endmodule
module test1;
reg A,B,C,D;
wire w,x,y,z;
converter t1(w,x,y,z,A,B,C,D);
initial
begin
#100 A=1'b0;B=1'b0;C=1'b0;D=1'b0;
#100 A=1'b0;B=1'b0;C=1'b0;D=1'b1;
#100 A=1'b0;B=1'b0;C=1'b1;D=1'b0;
#100 A=1'b0;B=1'b0;C=1'b1;D=1'b1;
#100 A=1'b0;B=1'b1;C=1'b0;D=1'b0;
#100 A=1'b0;B=1'b1;C=1'b0;D=1'b1;
#100 A=1'b0;B=1'b1;C=1'b1;D=1'b0;
#100 A=1'b0;B=1'b1;C=1'b1;D=1'b1;
#100 A=1'b1;B=1'b0;C=1'b0;D=1'b0;
#100 A=1'b1;B=1'b0;C=1'b0;D=1'b1;
#100 A=1'b1;B=1'b0;C=1'b1;D=1'b0;
#100 A=1'b1;B=1'b0;C=1'b1;D=1'b1;
#100 A=1'b1;B=1'b1;C=1'b0;D=1'b0;
#100 A=1'b1;B=1'b1;C=1'b0;D=1'b1;
#100 A=1'b1;B=1'b1;C=1'b1;D=1'b0;
#100 A=1'b1;B=1'b1;C=1'b1;D=1'b1;
end
endmodule
Conclusion:
In this we preform the different operations on the logic gates. We deal
with OR gates and AND gates and NOT gates also. we use in the Only NAND in one
task. And one specific task require the only NOR gate. We work hardware on it and
make clean circuit on board. Make simulation on the Proteus software and we make
the Verilog code on the Model sim software. We make the truth table of gates. We
draw the waveform on the Model Sim software. In this lab we learn the conversions
with NAND gates connections how we will join the gates and take easy work from the
gates. We converted the excess-3 to gray code. We learnt it.