DDCO lab manual part 1
DDCO lab manual part 1
Syllabus
Semester 3
DigitalDesign and Computer Organization
Course Code BCS302 CIE Marks 50
SEE Marks 50
Teaching Hours/Week (L:T:P:S) 3:0:2:0 Total Marks 100
Total Hours of Pedagogy 40 hours Theory +20 Hours of Practicals
Credits 04 Exam Hours 3
sBmulate the
1. Given a 4-variable logic expression, simplify it using appropriate technique and
sameusing basic gates.
2. Design a 4 bit fulladder and subtractor and simulate the same using basic gates.
3. Design Verilog HDL to implement simple circuits using structural, Data flow and
Behavioural model.
8. Design Verilog program for implementing various types of Flip-Flops such as SR, IK and D.
Course outcomes (Course Skill Set):
At the end of the course, the student willbe able to
CO1 Apply the K-Map techniques to simplify various Boolean expressions.
C02: Desgn difterent types of combinational and sequentialcircuits along with Verilog
programs.
cO3 Describe the fundamentals of machine instructions, addressing modes and Processor
performance
C04 Explan the approaches involved in achieving communication between processor and
/o devices
c05 Analyzeinternal Organization of Memory and Impact of cache/Pipelining on Processor
erforThance
Digital Design and Computer Organization BCS302
Name of Experiments
Page No.
S. No.
using appropriate
Given a 4-variable logic expression,simplify it
1
1
technique and simulate the same using basic gates.
and simulate the same using 3
Design a 4-bit fulladder and subtractor
2
basic gates.
simple circuits using structural, 14
3
Design Verilog HDL to implement
model.
Data flow and Behavioural
32
of De-Multiplexer.
7 Design Verilog program to implement types
AB X 4 X
2
AB 1
6
5
AB 1 1 X
13 i5
AB 1
10
8
2 A'B'C'D m1 0011 1 0 0 0
3 A'B'CD' m2 00 101 1 0 1 1 1 0 1
4 3 A'B'CD m3 0 0 11|1 1 00 0 1 0
5 4 A'BC'D' m4 1|0 01 0 1 1 0
6 5 A'BC'D m5 0 1 loooooolooo
01| 0 0 0 0
7 6 A'BCD' m6 01 0O 1 0
8 A'BCD m7 1 1 1 0O0 0 0
9 A'B'C'D' m8 1 00 1 1 1 1 1 0 1
10 9 AB'C'D m9 1 10 1 1 0 1 1
11 10 AB'CD m10 1 0 1 00 1 01 0
12 11 AB'CD m11 1 01 10 1 00 0 1
13 12 ABCD' m12 0000 1 0
14 13 ABC'D m13 010 0 1
15 14 ABCD' m14 1 1 o1
16 15 ABCD m15 1 1 10oo0 1
BCS302
Digital Design and Computer Organization
module plverilog(a,b,c,d,y);
inputa;
input b;
input c;
input d;
output y;
reg y;
begin
y=(~a &~d) |(~b &~c) | (~b &d) | (a &d);
end
endmodule
OUTPUT:
/plveriog/d
sipnals
S1 939 ps
O ps to 1412096 ps
Slart
BCS302
Digital Design and Computer Organization
2. Design a4-bit full adder and subtractor and simulate the same using
basicgates.
Full adder
BOOLEAN EXPRESSIONS:
sum= A B C
Hull adode
Sun= AOB c
Bai
To be implkmentd ainT
A
O)
(RB+AE)e +(76+AB)
+ AB+A B
A8 +AB
(a+).(7+a))et
ABE+ ABe
Sun AB+ABLt
carry=AB+ BC+ AC
TRUTH TABLE:
INPUTS
2 OUTPUTS
A B C Sum carry
0 0
0 |---
1
1 0 0
1
1 1 1
1 1
BCS302
Digital Design and Computer Organization
IMPLEMENTATION OF FUL ADDER USING BASIC GATES :
SU
CARRY
C
PA FAo
FA FA
Full adder: -
Step 1
module p2updated (a,b,sum,carry,c);
input [3:0] a;
input (3:0]b;
output [3:0] sum;
output carry;
Digital Design and Computer Organization BCS302
input c;
wire c1,c2,c3;
fa FAO(sum[0],c1, a[0],b[0],c);:
fa FA1(sum[1],c2,a[1],b[1],c1);
fa FA2(sum[2],c3,a[2],b[2],c2);:
fa FA3(sum[3],carry,a[3],b[3],c3);
endmodule
Xilinx -Project Navigator - C:\Copyofp2up datedp2updated. npl [p2updaled.v]
Fle Edr View Project Source Process Wndow Help
12
ta FAZ (sum[2) , c3,a[2) ,b[2]) , c2) :
13
ta FA3 (sum[3),carry, a[3) ,b[3), c3):
14 enduodule
47
Simlator"
Launchng Apphcathon lor proces "Launch ModeSm
start
Step 2 (create the file fa.v under the main module p2updated.v)
i)right click on main module p2updated.v
ii)select new source ->Verilog module ->enter file name as fa.v
ii)fa.v sub module gets created under the main module as seen in the process window
iv)type the code in the sub module fa.vand save.
v)compile both the main module p2updated.v and sub module fa.v
5
BCS302
Digital Design and Computer Organization
module fa(sum,carry,a,b, cin);
output sum;
output carry;
input a;
input b;
input cin;
endmodule
Digital Design and Computer Organization BCS302
wire
U1, u2, w3, w4, v5, w6, u7, U8, u9, u10;
not G1 (v1, a);
1C not G2 (u2,b) :
1 not G3 (v3,c1n):
and G4 (v4,a,b,cin):
13 and G5 (v5, v1, u2, cin) :
and G6 ( v6, u1, b, u3):
BMoguie Viem Snapshot ViewLrey Yiew 1 and G7 (v7, a, u2,u3):
16 and G8 (v8, a, b):
17 and G9 (v9, b,c1n):
1e and G10 (v10, a, cin);
Processes for Souce 'p2updaied 1 or G11 (sun, v4, v5, v6, w7)
Desgn Entry Utätes 20 Or G12 (carry, v8, v9, v10) :
Create Schemac Symbal
21
Lanch ModeSm Siato endnodule
22
Vew Command Lire Log Fie 23
View Veriog Instartialon Templal
User Constants
Creae Tng Const ant:
Atig Paect oe Pins
Ed Congtran: (Text)
Imclement Desgn
O? SyheizeXST
Dpupdated v la
BtProces Vies
Smdalor'
Laurchng Apphcaton lor peoces "Lonch Moden
nings ÀErors/
EEConsole Firdnfes Ln 21 Col 21
Process launt otalSmSstrr s up to dot
M/eity
start
Stepl output
wave delaul
Copre os Forr rdove
e C Cus0 Zo
1111
tpdye
1000
dis
siRnas
Fte Ek vew Wndow
1U11
t001
sim /p2updated
22450 p:
Ops to 106 ns
starnt
7
BCS302
Digital Design and Computer Organization
Step2 output
Fermo
alon S1
signals
Fle Ed View Wndow
S1
St1
S1
Cr
C10
S10
Sim./fa
99555 ps
g9050 ps to 101808 ps
Vsh
BO-Frot-ct ang
start
Digital Design and Computer Organization BCS302
BOOLEAN EXPRESSIONS:
Full'subtractor
diff=A@BOC
Jul Substrate
Bas
To be imblcmatd
(A e)6
(A6B) + CA88)
TRUTH TABLE
INPUTS OUTPUTS
A B C diff borr
0 0
0 1
1 0
1
1 0 0
1 1
9
Digital Design and Computer Organization BCS302
Full subtractor: -
ImpLEMENTATION DF FULL SUASTRACTOR USING 8ASIC GATES!
FS, FS, FS
B4 B0
diil
BCS302
Digital Design and Computer Organization
Changes to be made for full subtractor
Step1
moduleps(diff,B4,a,b, B0);
input [3:0] a;
inpst [3:0]b;
input B0;
output [3:0] diff;
output B4;
step2
module fs (diff, borr,a,b,cin);
input a;
input b;
input cin;
output diff;
output borr;
i t e 1 , 2, , ,s6,, 10s
tot G1 (W1,8)
pa v fay
Prooess Vies
Output:
wave delault
Fle Edt Cusor Zoom Compare Bouknar Foruet Window
signals
Fle Edit View Window
|1111
|0101
1010
B4
B1
B2
sin:/ps
400000:p:
270221 ps
Ops to 816838 ps
Hstart W2 Microsoft oifice linx Project Naviga. - vish 001 PM
BCS302
Organization
Digital Design and Computer
Design VerilogHDL to inplement simple circuitsusing structural, Data
3. model.
flow and Behavioural
Structural Model 1
module p3structural(a,b,c,d,e,y);
input a;
input b;
input c;
input d;
input e;
output y:
wire Y1,Y2;
and G1(Y1,a,b);
and G2(Y2,c,d,e);
or G3(Y,Y1,Y2);
endmodule OUTPUT: -
wane
p31/y
apnak
|S
sim /p31
29353
Ops lo 7066E0 pe
starn
BCS302
Digital Design and Computer Organization
DataFlow Model
module p31(a,b,c,d,e,y):
input a;
input b;
inputc;
input d;
input e;
output y;
wire Y1,Y2;
as_ign Y1 =a & b;
assign Y2= c&d&e;
assign y= Y1|Y2;
endmodule
OUTPUT: -
sipnals
Fla E View Window
SIO
Sim:/p31
300000 ps
Ops to 706048 ps
stan
BCS302
ComputerOrganization
DigitalDesign and
Behavioral Model
module p3behavioral(a,b,c,d,e,y);
input a;
input b;
input c;
input d;
input e;
output y;
reg y;
always @(a,b,c,d,e)
begin
y= (a &b) | (c &d &e);
end
endmodule
OUTPUT: -
wavodelnút
o lp3behovoal
sipnals
Al Edt Vew Window
226911 ps
Digital Design and Computer Organization BCS302
BOOLEAN EXPRESSIONS:
sum=A B
cout=AB
TRUTH TABLE
INPUTS OUTPUTS
A B sum cout
1 1
1 1 0
-
1 1
module p4addsub(a,b,sum,cout);
input a;
input b;
output sum;
output cout;
reg sum,cout;
always @(a,b)
begin
Sum = a ^ b:
Cout = a & b;
end
endmodule
BCS302
Digital Design and Computer Organization
OUTPUT:
SPnals
4start
BCS302
Digital Design and Computer Organization
Half Subtractor
BOOLEAN EXPRESSIONS:
Diff =A B
Borr =
TRUTH TABLE
INPUTS OUTPUTS
A B Diff Borr
0 0
1 1
0 1 0
1 1
module p4hs(a,b,Diff,Borr);
input a;
input b;
output Diff;
output Borr;
endmodule
Digital Design and Computer Organization BCS302
OUTPUT: -
esignak
Fie EA Ve Wndo
Ops to 7H48 ps
4star
Digital Design and Computer Organization BCS302
FullAdder
BOOLEAN EXPRESSIONS
Sum= A B Cin
INPUTS OUTPUTS
A B Cin sum cout
0 0
0 1
0 1
1 1
0 0 0
1
1 0
0 1
1 1
module p4fa(a,b,cin,sum,cout);:
input a;
input b;
input cin;
output sum;
output cout;
reg sum, cout;
always @(a,b,cin)
begin
sum =a^b^cin;
endmodule
BCS302
Digital Design and Computer Organization
oUTPUT:
E e Wt
sim /p4fa
300000 ps
Ops to 706046 ps