⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 switch.v

📁 Traffic light written with Verilog
💻 V
字号:
//as switch==1, stop counter
//and then as switch goes from 1 to 0,  change the state


module Switch( s_clk, s_sw, s_diswork, s_change );
input s_clk, s_sw;
output s_diswork, s_change;
reg s_diswork, s_change;

always @( posedge s_clk )
 begin
	if( (s_sw==0) && (s_diswork==1) )
		s_change=1;
	else
		s_change=0;

	if( s_sw==1 )
		s_diswork=1;
	else
		s_diswork=0;

 end
endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -