DDCO Lab Manual
DDCO Lab Manual
Subject
Digital Design and Computer Organization Lab
IPCC
Semester: 3rd
Course Code
BCS302
Scheme 2022
Faculty handling
Dr.Ryan Dias
Year 2023-2024
1
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
VISION
To create a centre of excellence in teaching, learning and professional environment in the
discipline of Computer Science and Engineering addressing emerging and existing challenges
striving to meet the requirement of both industry and society.
MISSION
M1:To provide value-based quality technical education and training with continuous improvement
in the discipline of Computer Science and Engineering.
M2:To develop professionals to meet the requirements of industry and society.
M3:To promote innovation, dedication, and hard work with ethically and professionally
responsible behaviour.
2
PROGRAM SPECIFIC OUTCOMES(PSO)
Engineering Graduates will be able to:
PSO1: Identify the Problem, analyze, design, develop, test and implement solution using
appropriate tools and technologies
PSO2: Apply the knowledge to carry out innovative projects and transform ideas into working
modules following the professional ethics and engineering principles
3
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader
in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive
clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
4
syllabus and the second test after covering 85-90% of the syllabus.
● Scaled-down marks of the sum of two tests and other assessment methods will be CIE marks for
the theory component of IPCC (that is for 25 marks).
● The student has to secure 40% of 25 marks to qualify in the CIE of the theory component of
IPCC.
● 15 marks for the conduction of the experiment and preparation of laboratory record, and 10
marks for the test to be conducted after the completion of all the laboratory sessions.
● The CIE marks awarded in the case of the Practical component shall be based on the continuous
evaluation of the laboratory report. Each experiment report can be evaluated for 10 marks. Marks
of all experiments’ write-ups are added and scaled down to 15 marks.
● The laboratory test (duration 02/03 hours) after completion of all the experiments shall be
conducted for 50 marks and scaled down to 10 marks. Scaled-down marks of write-up evaluations
and tests added will be CIE marks for the laboratory component of IPCC for 25 marks.
● The student has to secure 40% of 25 marks to qualify in the CIE of the practical component of
the IPCC.
Theory SEE will be conducted by University as per the scheduled timetable, with common
question
1. The question paper will have ten questions. Each question is set for 20 marks.
2. There will be 2 questions from each module. Each of the two questions under a module (with a
The theory portion of the IPCC shall be for both CIE and SEE, whereas the practical portion will
have a CIE component only. Questions mentioned in the SEE paper may include questions from
Contents
Sl.No Experiments Pg.no
1. Given a 4-variable logic expression, simplify it using appropriate
7
technique and simulate the same using basic gates.
2. Design a 4 bit full adder and subtractor and simulate the same using basic
12
gates.
3. Design Verilog HDL to implement simple circuits using structural, Data
15
flow and Behavioural model.
4. Design Verilog HDL to implement Binary Adder-Subtractor – Half and
26
Full Adder, Half and Full Subtractor.
5. Design Verilog HDL to implement Decimal adder. 40
6. Design Verilog program to implement Different types of multiplexer like
44
2:1, 4:1 and 8:1.
7. Design Verilog program to implement types of De-Multiplexer. 56
8. Design Verilog program for implementing various types of Flip-Flops 57
such as SR, JK and D.
6
Experiment 1:
AIM: Given a 4-variable logic expression, simplify it using appropriate technique and
simulate the same using basic gates.
Tool used: Xilinx 13.1
̅
̅+𝒄̅.b)𝒅
1) y=(𝒂
Theory :
RTL Diagram:
Program1:
7
module exp2(
input a,b,c,d,
output y
);
assign y=((~a)|((~c)|b)&(~d));
endmodule
Test Bench :
module exp2_test;
// Inputs
reg a;
reg b;
reg c;
reg d;
// Outputs
wire y;
// Instantiate the Unit Under Test (UUT)
exp2 uut (
.a(a),
.b(b),
.c(c),
.d(d),
.y(y)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
c = 0;
d = 0;
8
b = 0;
c = 1;
d = 0;
a = 0;
b = 0;
c = 1;
d = 1;
9
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 0;
c = 0;
d = 1;
10
c = 1;
d = 1;
end
endmodule
Simulation Output:
Conclusion :
11
Experiment :2
AIM:- Design a 4 bit full adder and subtractor and simulate the same using basic gates.
Verilog code:
module fadder (A, B, Cin, Sum, Cout);
input A, B;
input Cin;
output Sum;
output Cout;
wire t1,t2,t3,t4;
xor x1(t1,A,B);
xor x2(Sum,t1,Cin);
and g1(t2,A,B);
and g2(t3,B,Cin);
and g3(t4,Cin,A);
or g4(Cout,t2,t3,t4);
endmodule
12
*Test bench:
module add_sub_4_tb;
reg [3:0] A,B;
reg In;
wire [3:0] Res;
wire Out;
add_sub_4 tb(A,B,In,Res,Out);
initial
begin
In=0; A=4'b1010; B=4'b0101;
#50 In=1;
#50 In=0; A=4'b0101; B=4'b1010;
#50 In=1;
#50 In=0; A=4'b0001; B=4'b0001;
end
endmodule
*RTL Diagrams:-
13
*Simulation Output:
14
Experiment 3:
AIM:- Design Verilog HDL to implement simple circuits using structural, Data flow and
Behavioural model.
1)Using data flow :-
Verilog code:-
module Full_Adder(
input a,b,c,
output sum,cary
);
assign sum=(a&(~b)&(~c))|((~a)&(~b)&c)|(a&b&c)|((~a)&b&(~c));
assign cary=b&c|a&c|a&b;
endmodule
*Test bench:-
module full_test;
// Inputs
reg a;
reg b;
reg c;
// Outputs
wire sum;
wire cary;
// Instantiate the Unit Under Test (UUT)
Full_Adder uut (
.a(a),
.b(b),
.c(c),
.sum(sum),
.cary(cary)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
c = 0;
// Wait 100 ns for global reset to finish
#50;
15
c = 1;
// Wait 100 ns for global reset to finish
#50;
a = 0;
b = 1;
c = 0;
// Wait 100 ns for global reset to finish
#50;
a = 0;
b = 1;
c = 1;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 0;
c = 0;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 0;
c = 1;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 1;
c = 0;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 1;
c = 1;
// Wait 100 ns for global reset to finish
#50;
end
endmodule
16
*RTL diagrams:
17
*Simulation Output:
18
end
else if(a==1 && b==1 && c==0)
begin
sum=0; cout=1;
end
else if(a==1 && b==1 && c==1)
begin
sum=1; cout=1;
end
end
endmodule
*Test bench:
module full_test;
// Inputs
reg a;
reg b;
reg c;
// Outputs
wire sum;
wire cout;
// Instantiate the Unit Under Test (UUT)
full_adder uut (
.a(a),
.b(b),
.c(c),
.sum(sum),
.cout(cout)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
c = 0;
// Wait 100 ns for global reset to finish
#50;
19
b = 1;
c = 0;
// Wait 100 ns for global reset to finish
#50;
a = 0;
b = 1;
c = 1;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 0;
c = 0;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 0;
c = 1;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 1;
c = 0;
// Wait 100 ns for global reset to finish
#50;
a = 1;
b = 1;
c = 1;
// Wait 100 ns for global reset to finish
#50;
end
endmodule
20
*RTL diagrams:
21
*Simulation Output:
*Test bench:
module testbench_fulladder;
reg a,b,c;
wire sum,cout;
full_adder f1(a,b,c,sum,cout);
initial begin
a = 1'b0;
b = 1'b0;
c = 1'b0;
#50;
a = 1'b0;
b = 1'b0;
c = 1'b1;
#50;
a = 1'b0;
22
b = 1'b1;
c = 1'b0;
#50;
a = 1'b0;
b = 1'b1;
c = 1'b1;
#50;
a = 1'b1;
b = 1'b0;
c = 1'b0;
#50;
a = 1'b1;
b = 1'b0;
c = 1'b1;
#50;
a = 1'b1;
b = 1'b1;
c = 1'b0;
#50;
a = 1'b1;
b = 1'b1;
c = 1'b1;
#50;
end
endmodule
23
*RTL Diagrams:
24
*Simulation Output:-
25
Experiment 4
AIM: Design Verilog HDL to implement Binary Adder-Subtractor – Half and Full Adder,
Half and Full Subtractor.
1)Half adder:
Code:
module half_adder(
input a,b,
output cary,sum
);
assign sum=((~a)&b)|((~b)&a);
assign cary=a&b;
endmodule
Test bench:
module halfAdder_test;
// Inputs
reg a;
reg b;
// Outputs
wire cary;
wire sum;
initial begin
// Initialize Inputs
a = 0;
b = 0;
26
// Wait 50 ns for global reset to finish
#50;
a = 1;
b = 0;
// Wait 50 ns for global reset to finish
#50;
a = 1;
b = 1;
endmodule
*RTL Diagram:
27
Output
2)Full Adder
Code:
module Full_Adder(
input a,b,c,
output sum,cary
);
assign sum=(a&(~b)&(~c))|((~a)&(~b)&c)|(a&b&c)|((~a)&b&(~c));
assign cary=b&c|a&c|a&b;
endmodule
Test Bench:
module full_test;
// Inputs
28
reg a;
reg b;
reg c;
// Outputs
wire sum;
wire cary;
// Instantiate the Unit Under Test (UUT)
Full_Adder uut (
.a(a),
.b(b),
.c(c),
.sum(sum),
.cary(cary)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
c = 0;
29
a = 1;
b = 0;
c = 0;
end
endmodule
RTL:
30
31
32
Simulation Output:
3)Half Subtractor:
Code:
module half_sub(
input a,b,
output dif,borrow
);
assign dif=((~a)&b)|((~b)&a);
assign borrow=(~a)&b;
endmodule
Test Bench:
module halfSub_test;
// Inputs
reg a;
reg b;
// Outputs
wire dif;
wire borrow;
// Instantiate the Unit Under Test (UUT)
half_sub uut (
.a(a),
.b(b),
.dif(dif),
.borrow(borrow)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
33
#50;
RTL:
34
*Simulation Output
35
4)Full subtractor:
*code:
module Full_sub(
input a,b,c,
output diff,borrow
);
assign diff=(a&(~b)&(~c))|((~a)&(~b)&c)|(a&b&c)|((~a)&b&(~c));
assign borrow=(~a)&c|b&c|(~a)&b;
endmodule
*Test bench:-
module full_test_sub;
// Inputs
reg a;
reg b;
reg c;
// Outputs
wire diff;
wire borrow;
initial begin
// Initialize Inputs
a = 0;
b = 0;
c = 0;
36
#50;
a = 0;
b = 1;
c = 0;
37
*RTL :
38
*Simulation output
39
Experiment 5
*Test bench:-
module tb_bcdadder;
40
// Inputs
reg [3:0] a;
reg [3:0] b;
reg carry_in;
// Outputs
wire [3:0] sum;
wire carry;
// Instantiate the Unit Under Test (UUT)
bcd_adder uut (
.a(a),
.b(b),
.carry_in(carry_in),
.sum(sum),
.carry(carry)
);
initial begin
// Apply Inputs
a = 0; b = 0; carry_in = 0; #50;
a = 6; b = 9; carry_in = 0; #50;
a = 3; b = 3; carry_in = 1; #50;
a = 4; b = 5; carry_in = 0; #50;
a = 8; b = 2; carry_in = 0; #50;
a = 9; b = 9; carry_in = 1; #50;
end
endmodule
*RTL Diagrams:-
41
42
*Simulation output:-
43
Experiment 6:-
AIM: Design Verilog program to implement Different types of multiplexer like 2:1, 4:1
and 8:1.
1)Multiplexer 2x1
*Code:
module mux2_1(
input i0 , i1 , s,
output y
);
assign y = (~s) & i0 | s & i1 ;
endmodule
*test bench:
module mux2_1_test;
// Inputs
reg i0;
reg i1;
reg s;
// Outputs
wire y;
// Instantiate the Unit Under Test (UUT)
mux2_1 uut (
.i0(i0),
.i1(i1),
.s(s),
.y(y)
);
initial begin
// Initialize Inputs
i0 = 0;
i1 = 0;
s = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
i0 = 1;
i1 = 0;
s = 0;
44
// Wait 100 ns for global reset to finish
#100;
i0 = 0;
i1 = 0;
s = 1;
// Wait 100 ns for global reset to finish
#100;
i0 = 0;
i1 = 1;
s = 1;
// Wait 100 ns for global reset to finish
#100;
end
endmodule
45
*OUTPUT:
46
2)Multiplexer 4x1
*Code:
module mux41_dataflow(
input s0,s1,
input I0,I1,I2,I3,
output y
);
assign y=(((~s0)&(~s1)&I0)|(I1&(~s0)&s1)|(s0&(~s1)&I2)|(s0&s1&I3));
endmodule
*Test Bench:
module mux4_1test;
// Inputs
reg [2:0] select;
reg i0;
reg i1;
reg i2;
reg i3;
// Outputs
wire y;
// Instantiate the Unit Under Test (UUT)
mux4_1 uut (
.select(select),
.i0(i0),
.i1(i1),
.i2(i2),
.i3(i3),
.y(y)
);
initial begin
/*// Initialize Inputs
select[0] = 0;
select[1]=0
i0 = 1;
i1 = 0;
i2 = 0;
i3 = 0;
// Wait 100 ns for global reset to finish
#50;
// Add stimulus here
select[0] = 0;
47
select[1]=1;
i0 = 0;
i1 = 1;
i2 = 0;
i3 = 0;
#50;
select[0] = 1;
select[1]=0;
i0 = 0;
i1 = 0;
i2 = 1;
i3 = 0;
#50;
select[0] = 1;
select[1]=1;
i0 = 0;
i1 = 0;
i2 = 0;
i3 = 1;
#50;
end
endmodule
RTL Diagram
48
49
Simulation Output :
3)Multiplexer 8x1:-
*Code:-
module mux8_1(
input [2:0] select,
input [7:0]i,
output reg y
);
always @(select,i)
case(select)
3'b111:y=i[7];
3'b110: y=i[6];
3'b101: y=i[5];
3'b100: y=i[4];
3'b011: y=i[3];
3'b010: y=i[2];
3'b001: y=i[1];
3'b000: y=i[0];
endcase
endmodule
*Test bench:-
module mux8_test;
// Inputs
reg [2:0] select;
50
reg [7:0] i;
// Outputs
wire y;
// Instantiate the Unit Under Test (UUT)
mux8_1 uut (
.select(select),
.i(i),
.y(y)
);
initial begin
// Initialize Inputs
select[0] = 0;
select[1]=0;
select[2]=0;
i[0] = 1;
i[1] = 0;
i[2] = 0;
i[3] = 0;
i[4] = 0;
i[5] = 0;
i[6] = 0;
i[7] = 0;
// Wait 100 ns for global reset to finish
#50;
select[0] = 1;
select[1]=0;
select[2]=0;
i[0] = 0;
i[1] = 1;
i[2] = 0;
i[3] = 0;
i[4] = 0;
i[5] = 0;
i[6] = 0;
i[7] = 0;
// Wait 100 ns for global reset to finish
#50;
select[0] = 0;
select[1]=1;
select[2]=0;
i[0] = 0;
i[1] = 0;
i[2] = 1;
51
i[3] = 0;
i[4] = 0;
i[5] = 0;
i[6] = 0;
i[7] = 0;
// Wait 100 ns for global reset to finish
#50;
select[0] = 1;
select[1]=1;
select[1]=0;
i[0] = 0;
i[1] = 0;
i[2] = 0;
i[3] = 1;
i[4] = 0;
i[5] = 0;
i[6] = 0;
i[7] = 0;
// Wait 100 ns for global reset to finish
#50;
select[0] = 0;
select[1]=0;
select[2]=1;
i[0] = 0;
i[1] = 0;
i[2] = 0;
i[3] = 0;
i[4] = 1;
i[5] = 0;
i[6] = 0;
i[7] = 0;
// Wait 100 ns for global reset to finish
#50;
select[0] = 1;
select[1]=0;
select[2]=1;
i[0] = 0;
i[1] = 0;
i[2] = 0;
i[3] = 0;
i[4] = 0;
i[5] = 1;
i[6] = 0;
52
i[7] = 0;
// Wait 100 ns for global reset to finish
#50;
select[0] =0;
select[1]=1;
select[2]=1;
i[0] = 0;
i[1] = 0;
i[2] = 0;
i[3] = 0;
i[4] = 0;
i[5] = 0;
i[6] = 1;
i[7] = 0;
// Wait 100 ns for global reset to finish
#50;
select[0] = 1;
select[1]=1;
select[2]=1;
i[0] = 0;
i[1] = 0;
i[2] = 0;
i[3] = 0;
i[4] = 0;
i[5] = 0;
i[6] = 0;
i[7] = 1;
// Wait 100 ns for global reset to finish
#50;
end
endmodule
*RTL diagram
53
54
*Simulation Waveform Output
55
Experimet 7:
AIM:Design verilog program to implement different types of de-multiplexers.
Code:
module Demux1_4(
input d,
output y0,y1,y2,y3,
input s1,s0
);
assign y0=(d&~s1&~s0);
assign y1=(d&~s1&s0);
assign y2=(d&s1&~s0);
assign y3=(d&s1&s0);
endmodule
Test bench:
module demux4_1test;
// Inputs
reg d;
reg s1;
reg s0;
// Outputs
wire y0;
wire y1;
wire y2;
wire y3;
// Instantiate the Unit Under Test (UUT)
Demux1_4 uut (
.d(d),
.y0(y0),
56
.y1(y1),
.y2(y2),
.y3(y3),
.s1(s1),
.s0(s0)
);
initial begin
// Initialize Inputs
d = 1;
s1 = 0;
s0 = 0;
// Wait 100 ns for global reset to finish
#100; // Add stimulus here
d = 1;
s1 = 0;
s0 = 1;
// Wait 100 ns for global reset to finish
#100;
d = 1;
s1 = 1;
s0 = 0;
// Wait 100 ns for global reset to finish
#100;
d = 1;
s1 = 1;
s0 = 1;
57
#100;
end
endmodule
RTL:
58
Simulation Output
59
2)demux1_2:
Code:
module demux1_2(
input d,s0,E,
output y1,y2 );
assign y1=(E&d&(~s0));
assign y2=(E&d&s0);
endmodule
Test bench:-
module demux1_2_test;
// Inputs
reg d;
reg s0;
reg E;
// Outputs
wire y1;
wire y2;
// Instantiate the Unit Under Test (UUT)
demux1_2 uut (
.d(d),
.s0(s0), .E(E), .y1(y1), .y2(y2)
);
initial begin
#000 E=1'b0; d=1'bx; s0=1'bx;
#100 E=1'b1; d=1'b0; s0=1'b0;
#100 E=1'b1; d=1'b1; s0=1'b0;
#100 E=1'b1; d=1'b0; s0=1'b1;
60
#100 E=1'b1; d=1'b1; s0=1'b1;
end
endmodule
RTL and graph:
61
*Simulation Output:
3)demux 8x1:-
Code:
62
module Demux8(
input s0,s1,s2,D,
output y0,y1,y2,y3,y4,y5,y6,y7
);
assign y0=(~s0)&(~s1)&(~s2)&(D);
assign y1=(~s0)&(~s1)&(s2)&(D);
assign y2=(~s0)&(s1)&(~s2)&(D);
assign y3=(~s0)&(s1)&(s2)&(D);
assign y4=(s0)&(~s1)&(~s2)&(D);
assign y5=(s0)&(~s1)&(s2)&(D);
assign y6=(s0)&(s1)&(~s2)&(D);
assign y7=(s0)&(s1)&(s2)&(D);
endmodule
Test bench:
module Demuxt8;
// Inputs
reg s0;
reg s1;
reg s2;
reg D;
// Outputs
wire y0;
wire y1;
wire y2;
wire y3;
wire y4;
wire y5;
wire y6;
wire y7;
initial begin
// Initialize Inputs
s0 = 0;
s1 = 0;
s2 = 0;
63
D = 1;
// Wait 100 ns for global reset to finish
#100;
s0 = 0;
s1 = 0;
s2 = 1;
D = 1;
// Wait 100 ns for global reset to finish
#100;
s0 = 0;
s1 = 1;
s2 = 0;
D = 1;
// Wait 100 ns for global reset to finish
#100;
s0 = 0;
s1 = 1;
s2 = 1;
D = 1;
// Wait 100 ns for global reset to finish
#100;
s0 = 1;
s1 = 0;
s2 = 0;
D = 1;
// Wait 100 ns for global reset to finish
#100;
s0 = 1;
s1 = 0;
s2 = 1;
D = 1;
// Wait 100 ns for global reset to finish
#100;
s0 = 1;
s1 = 1;
s2 = 0;
D = 1;
// Wait 100 ns for global reset to finish
#100;
s0 = 1;
s1 = 1;
s2 = 1;
D = 1;
// Wait 100 ns for global reset to finish
#100;
end
64
endmodule
65
Simulation Output :
66
Experiment 8:
*AIM:- Design Verilog program for implementing various types of Flip-Flops such as SR, JK
and D.
1) D_Flipflop :
*Verilog code:-
module D_ff(d,clk,reset,q,qb);
input d;
input clk;
input reset;
output q;
output qb;
reg q,qb;
always@(posedge clk)
begin
if(reset==1'b1)
begin
q<=1'b0;
qb<=1'b1;
end
else
begin
q<=d;
qb<=~d;
end
end
endmodule
*Test bench:-
module D_fft;
// Inputs
reg d;
reg clk;
reg reset;
// Outputs
wire q;
wire qb;
// Instantiate the Unit Under Test (UUT)
D_ff uut (
.d(d),
.clk(clk),
67
.reset(reset),
.q(q),
.qb(qb)
);
initial begin
// Initialize Inputs
d = 0;
clk = 0;
reset = 1;
*RTL Diagram:-
68
69
*Simulation For D_flipflop:
2)JK filp-flop:-
*Verilog code:-
module JK_ff(JK,clk,reset,q,qb);
input [1:0] JK;
input clk;
input reset;
output q,qb;
regq,qb;
always@(posedgeclk)
begin
if (reset==1’b1)
q = 1'd0 ;
else
begin
case(JK)
2'b00 : q = q ;
2'b01 : q = 1'd0 ;
2'b10 : q = 1'd1 ;
2'b11 : q = ~ q ;
endcase
end
qb = ~q;
end
endmodule
70
*Test bench:-
Module JKtest();
JK = 00;
clk = 0;
reset = 1;
// Wait 100 ns for global reset to finish
#100;
JK = 00;
clk = 1;
reset = 0;
// Wait 100 ns for global reset to finish
#100;
JK = 01;
clk = 1;
reset = 0;
// Wait 100 ns for global reset to finish
#100;
JK = 01;
clk = 0;
reset = 1;
// Wait 100 ns for global reset to finish
#100;
JK = 10;
clk = 1;
reset = 1;
72
*Simulation Output :-
73
3. Verify the functionality of T Flip Flop using HDL.
VERILOG Code:
module T_ff(clk,reset,t,q,qb);
input clk;
input reset;
input t;
output q;
output qb;
reg q,qb;
always@(posedge clk)
begin
if (reset==1'b1)
begin
q=1'b0;
qb=1'b1;
end
else
begin
if(t==1'b1)
q = ~q;
else
q = q;
74
end
qb=~q;
end
endmodule
75
76