共1条
1/1 1 跳转至页
VHDL一问

我编了一个VHDL程序,由生成的时钟驱动计数器,但不知
: 伪钟事件无法实现,望哪位大虾给予帮助!
: 程序如下:
: library ieee;
: use ieee.std_logic_1164.all;
: use work.my_package.all;
: use work.my_clk.all;
: entity traffic is port(
: reset,clk,en:in std_logic;
: light_r,light_y,light_g:out std_logic);
: end traffic;
: architecture traffic of traffic is
: signal time:std_logic;
: begin
: u1:clock port map(clk,time);
: process(time,reset,en)
: variable count:integer:=0;
: variable choice:integer:=0;
: begin
: if(reset='1')then
: light_r<='1';
: light_y<='0';
: light_g<='0';
: choice:=1;
: if((en='1' and choice=1)or choice=0)then
: choice:=0;
: if(time'event and time='1')then
: ~~~~~~~~~~~~~~~~~~~~~~~
: if(count=129)then
: count:=0;
: else
: count:=count+1;
: end if;
: end if;
: case count is
: when 0 to 59 =>light_r<='1';
: light_y<='0';
: light_g<='0';
: when 60 to 69 =>light_r<='0';
: light_y<='1';
: light_g<='0';
: when 70 to 129=>light_r<='0';
: light_y<='0';
: light_g<='1';
: when others =>light_r<='1';
: light_y<='0';
: light_g<='0';
: end case;
: end if;
: end if;
: end process;
: end traffic;
关键词: 一问
共1条
1/1 1 跳转至页
回复
打赏帖 | |
---|---|
汽车+汽车地线之间连接处理被打赏20分 | |
【Zephyr】使用Zephyr外设初始化过程解析被打赏30分 | |
【S32K146】S32DS watchdog 配置使用被打赏20分 | |
【Zephyr】使用 IAR 调试 Zephyr 镜像被打赏20分 | |
赚取电动螺丝刀+电源电路理论知识分享1被打赏5分 | |
我想要一部加热台+分享常见运算放大器电路的应用被打赏5分 | |
【Zephyr】MCXN947 Zephyr 开发入门适配shell被打赏20分 | |
我想要一部加热台+常见的MOS管驱动电路被打赏5分 | |
【我要开发板】6.联合MATLAB记录数据被打赏50分 | |
【换取手持数字示波器】MicrochipMPLABHarmony框架下串口调试printf输出记录被打赏29分 |