S
Sridhar_Gadda
Guest
Hi,
I have written a simple code for D flipflop and output is feedback to
input but the results are not the same ...I suppose for every positive
edge clk. q = d , which means output is connected back to input. but q
graph always shows zero.......can anybody comment on what am I doing wrong
here
module d_flipflop_in_loop (q, d, clk);
output q;
input d, clk;
reg q;
always @(posedge clk)
q <= d;
endmodule
module test_d_flipflop_in_loop;
reg Q, D, CLK;
d_flipflop_in_loop dff( , D, CLK);
initial
begin
D = 1'b1;
CLK = 1'b0;
end
always
#5 CLK = ~CLK;
initial
#100 $finish;
endmodule
with regards ,
sridhar
I have written a simple code for D flipflop and output is feedback to
input but the results are not the same ...I suppose for every positive
edge clk. q = d , which means output is connected back to input. but q
graph always shows zero.......can anybody comment on what am I doing wrong
here
module d_flipflop_in_loop (q, d, clk);
output q;
input d, clk;
reg q;
always @(posedge clk)
q <= d;
endmodule
module test_d_flipflop_in_loop;
reg Q, D, CLK;
d_flipflop_in_loop dff( , D, CLK);
initial
begin
D = 1'b1;
CLK = 1'b0;
end
always
#5 CLK = ~CLK;
initial
#100 $finish;
endmodule
with regards ,
sridhar