我想得到一个脉冲:
module cs(rst,clk);
input clk;
input rst;
reg[27:0] cnt;
reg js;
always@(posedge clk or posedge rst)
begin
if(rst)
begin
cnt<=28'd0;
js<=0;
end
else
begin
if(cnt==28'd10)
begin
cnt<=28'd0;
js<=1;
end
else
begin
cnt<=cnt+1;
js<=0;
end
end
endmodule |