N
narasimha k
Guest
i am using icaura verilog, problem :is vcd file is not genarating these are my design and testbench please any one explain thi
s
my design is
====================================
module fulladder(a,b,c,sum,carry);
input a,b,c;
output sum,carry;
reg sum,carry;
always@(*)
begin
sum = a^b^c;
carry = (a&b)|(b&c)|(c&a);
end
endmodule
========================================
and my test bench is
---------------------------------------
module fulladder_tb;
reg a,b,c;
wire sum,carry;
fulladder DUT(a,b,c,sum,carry);
initial
begin
a=0;b=0;c=0;
#10;
a=0;b=0;c=1;
#10;
a=0;b=1;c=0;
#10;
a=0;b=1;c=1;
#10;
a=1;b=0;c=0;
#10;
a=1;b=0;c=1;
#10;
a=1;b=1;c=0;
#10;
a=1;b=1;c=1;
#10;
end
initial begin
$display("+++++++++++++++++++++++++++++++++++++++++");
$display("------FULL-ADDER TRUTH TABLE-------------");
$display("+++++++++++++++++++++++++++++++++++++++++");
$display(" A B C SUM CARRY");
$monitor(" %b %b %b %b %b",a,b,c,sum,carry);
end
initial begin
$dumpfile ("fulladde.vcd");
$dumpvars (0, fulladde);
#50;
$finish;
end
endmodule
s
my design is
====================================
module fulladder(a,b,c,sum,carry);
input a,b,c;
output sum,carry;
reg sum,carry;
always@(*)
begin
sum = a^b^c;
carry = (a&b)|(b&c)|(c&a);
end
endmodule
========================================
and my test bench is
---------------------------------------
module fulladder_tb;
reg a,b,c;
wire sum,carry;
fulladder DUT(a,b,c,sum,carry);
initial
begin
a=0;b=0;c=0;
#10;
a=0;b=0;c=1;
#10;
a=0;b=1;c=0;
#10;
a=0;b=1;c=1;
#10;
a=1;b=0;c=0;
#10;
a=1;b=0;c=1;
#10;
a=1;b=1;c=0;
#10;
a=1;b=1;c=1;
#10;
end
initial begin
$display("+++++++++++++++++++++++++++++++++++++++++");
$display("------FULL-ADDER TRUTH TABLE-------------");
$display("+++++++++++++++++++++++++++++++++++++++++");
$display(" A B C SUM CARRY");
$monitor(" %b %b %b %b %b",a,b,c,sum,carry);
end
initial begin
$dumpfile ("fulladde.vcd");
$dumpvars (0, fulladde);
#50;
$finish;
end
endmodule