Professional Documents
Culture Documents
Exercise Problems
initial
begin
a=1'b0;
b=1'b0;
$monitor("Time:%0t a=%b
b=%b c=%b",$time, a, b, c);
#5 a=1'b0; b=1'b0;
#5 a=1'b0; b=1'b1;
#5 a=1'b1; b=1'b0;
#5 a=1'b1; b=1'b1;
end
endmodule
Page 1 of 5
2. Write a verilog code to implement AND gate in data flow modeling
initial
begin
a=1'b0;
b=1'b0;
$monitor("Time:%0t a=%b
b=%b c=%b",$time, a, b, c);
#5 a=1'b0; b=1'b0;
#5 a=1'b0; b=1'b1;
#5 a=1'b1; b=1'b0;
#5 a=1'b1; b=1'b1;
end
endmodule
Page 2 of 5
4. Write a verilog code to implement 5 inputs AND gate in gate level modeling
initial
begin
in1=1'b0; in2=1'b0;
in3=1'b0; in4=1'b0; in5=1'b0;
$monitor("Time:%0t
in=%b%b%b%b%b out=%b",$time,
in1, in2, in3, in4, in5, out);
#5 in1=1'b0; in2=1'b0;
in3=1'b0; in4=1'b0; in5=1'b0;
#5 in1=1'b0; in2=1'b0;
in3=1'b1; in4=1'b0; in5=1'b1;
#5 in1=1'b1; in2=1'b1;
in3=1'b1; in4=1'b1; in5=1'b1;
end
endmodule
Page 3 of 5
5. Write a verilog code to implement below logic circuit using gate level modeling
Page 4 of 5
Assignment
1. Write a verilog code to implement following gate in data flow level modeling
a. OR
b. NAND
c. EXOR (XOR)
2. Write a verilog code to implement the below logic circuit using gate level and data flow
modeling
Note: Each question should have unique file name. file name for each
“CSE19001_2.v”
Page 5 of 5