📄 wsm.v
字号:
module wsm(key1,key2.key3,key4,hz1,hz1kstart,sound);
begin
input key1,key2,key3,key4,start,hz1,hz1k;
output sound;
reg cnt,tt,st,ps,ts,W;
always @(posedge hz1)
begin
if (start==1)
begin
if (key1==1)
begin
if (cnt<30)
cnt=cnt+1;
else
begin
cnt=0;
key1==0;
W=1
end
end
if (key2==1)
begin
if (cnt<20)
cnt=cnt+1;
else
begin
cnt=0;
key2==0;
W=1
end
end
if (key3==1)
begin
if (cnt<10)
cnt=cnt+1;
else
begin
cnt=0;
key3==0;
W=1
end
end
if (key4==1)
begin
if ( cnt<3)
cnt=cnt+1;
else
begin
cnt=0;
start=0;
key4=0;
end
end
if (W==1 and cnt<3)
cnt=cnt+1;
else
begin
cnt=0;
W=0;
end
if (tt!=2 and W==0 )
begin
if (s==1 )
begin
if(cnt<2 and st!=1)
begin
cnt=cnt+1;
sound=hz1k;
end
else
begin
sound=0;
cnt=0;
st=1;
s=0;
end
end
if (cnt<5 and px==0 and st==1)
cnt=cnt+1;
else
begin
cnt=0;
px=1;
end
if (px==1 and cnt<3 and ts==0)
cnt=cnt+1;
else
begin
cnt=0;
tt=tt+1;
st=0;
px=0;
end
end
if(tt==2)
start=0;
end
end
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -