欢迎来到天天文库
浏览记录
ID:15271279
大小:219.00 KB
页数:9页
时间:2018-08-02
《交通灯信号控制器vhdl文本输入设计》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、交通灯信号控制器VHDL文本输入设计--Cnt05s.vhdLIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYCNT05SISPORT(CLK,EN05M,EN05B:INSTD_LOGIC;DOUT5:OUTSTD_LOGIC_VECTOR(7DOWNTO0));ENDENTITYCNT05S;ARCHITECTUREARTOFCNT05SISSIGNALCNT3B:STD_LOGIC_VECTOR
2、(2DOWNTO0);BEGINPROCESS(CLK,EN05M,EN05B)ISBEGINIF(CLK'EVENTANDCLK='1')THENIFEN05M='1'THENCNT3B<=CNT3B+1;ELSIFEN05B='1'THENCNT3B<=CNT3B+1;ELSIFEN05B='0'THENCNT3B<=CNT3B-CNT3B-1;ENDIF;ENDIF;ENDPROCESS;PROCESS(CNT3B)ISBEGINCASECNT3BISWHEN"000"=>DOUT5<="000
3、00101";WHEN"001"=>DOUT5<="00000100";WHEN"010"=>DOUT5<="00000011";WHEN"011"=>DOUT5<="00000010";WHEN"100"=>DOUT5<="00000001";WHENOTHERS=>DOUT5<="00000000";ENDCASE;ENDPROCESS;ENDARCHITECTUREART;--Cnt25s.vhdLIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD
4、_LOGIC_UNSIGNED.ALL;ENTITYCNT25SISPORT(SB,SM,CLK,EN25:INSTD_LOGIC;DOUT25M,DOUT25B:OUTSTD_LOGIC_VECTOR(7DOWNTO0));ENDENTITYCNT25S;ARCHITECTUREARTOFCNT25SISSIGNALCNT5B:STD_LOGIC_VECTOR(4DOWNTO0);BEGINPROCESS(SB,SM,CLK,EN25)ISBEGINIF(SB='0'ORSM='0')THENCNT
5、5B<=CNT5B-CNT5B-1;ELSIF(CLK'EVENTANDCLK='1')THENIFEN25='1'THENCNT5B<=CNT5B+1;ELSIFEN25='0'THENCNT5B<=CNT5B-CNT5B-1;ENDIF;ENDIF;ENDPROCESS;PROCESS(CNT5B)ISBEGINCASECNT5BISWHEN"00000"=>DOUT25M<="00100101";DOUT25B<="00110000";WHEN"00001"=>DOUT25M<="0010010
6、0";DOUT25B<="00101001";WHEN"00010"=>DOUT25M<="00100011";DOUT25B<="00101000";WHEN"00011"=>DOUT25M<="00100010";DOUT25B<="00100111";WHEN"00100"=>DOUT25M<="00100001";DOUT25B<="00100110";WHEN"00101"=>DOUT25M<="00100000";DOUT25B<="00100101";WHEN"00110"=>DOUT2
7、5M<="00011001";DOUT25B<="00100100";WHEN"00111"=>DOUT25M<="00011000";DOUT25B<="00100011";WHEN"01000"=>DOUT25M<="00010111";DOUT25B<="00100010";WHEN"01001"=>DOUT25M<="00010110";DOUT25B<="00100001";WHEN"01010"=>DOUT25M<="00010101";DOUT25B<="00100000";WHEN"0
8、1011"=>DOUT25M<="00010100";DOUT25B<="00011001";WHEN"01100"=>DOUT25M<="00010011";DOUT25B<="00011000";WHEN"01101"=>DOUT25M<="00010010";DOUT25B<="00010111";WHEN"01110"=>DOUT25M<="00010001";DOUT25B<="00010110";WHEN"01111"=>DOUT25M<="
此文档下载收益归作者所有