全文预览

数电_电子课设__交通灯课程设计报告3兼程序

上传者:塑料瓶子 |  格式:doc  |  页数:18 |  大小:0KB

文档介绍
q :integer range 0 to1; begin if(rising_edge(clk)) then if(emerge='1') then --紧急状态时南北向到计数在全零跟当天状态间交替显示 if(q=0) then q:=1; btime<=bregtime; else q:=q-1; btime<=0; end if; else t>=35) then bregtime <= cnt-35; t>=5) then bregtime <= cnt-5; elsif (cnt>=0) then bregtime <= cnt-0; end if; btime<=bregtime; end if; end if; end process; process(atime) --将东西向二进制码转换成两位 BCD 码 begin if(atime>=90) then EWH <=9; EWL<=atime-90; elsif (atime>=80) then EWH <=8; EWL<=atime-80; elsif (atime>=70) then EWH <=7; EWL<=atime-70; elsif (atime>=60) then EWH <=6; EWL<=atime-60; elsif (atime>=50) then EWH<=5; EWL<=atime-50; elsif (atime>=40) then EWH <=4; EWL<=atime-40; elsif (atime>=30) then EWH<=3; EWL<=atime-30; elsif (atime>=20) then EWH<=2; EWL<=atime-20; elsif (atime>=10) then EWH<=1; EWL<=atime-10; else EWH<=0;

收藏

分享

举报
下载此文档