Verilog Sequential
Verilog Sequential
(ECE/EEE/INSTR F215 )
Verilog-Sequential
1
Behavioral modeling
module dff(q,d,clk,reset);
input d,clk,reset;
output q;
reg q;
always@(negedge clk)
if(reset)
q <=1'b0;
else
q <=d;
endmodule
◉Starts at time 0.
initial
x= 1’b0; //single statement does not need to be grouped
initial
begin
#5 a=1’b1; // multiple statements need to be grouped
#20 b=2’b01;
end
initial
begin
#10 x=1’b1;
#20 y=1’b0;
end
9/14/2024 Anita Agrawal CS/ECE/EEE/INSTR F215 8
Initial…..contd
initial
#50 $finish;
endmodule
always
#20 clk = ~clk;
initial
#500 $finish;
endmodule
◉ always @ (A or B or C)
will initiate execution if a change appears in A or
B or C.
◉Blocking (=)
◉Non-Blocking (<=)
◉B=A
◉ C = B+1
◉B<= A
◉C<=B+1