共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 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| 片外存储Flash使用方法(Arduino IDE环境)被打赏¥22元 | |
| 三分钟快速上手ESP-NOW(ArduinoIDE环境)被打赏¥23元 | |
| 【S32K3XX】LPSPI参数配置说明被打赏¥21元 | |
| 在WT9932C61-TINY上实现超声波测距被打赏¥22元 | |
| 基于WT9932C61-TINY的环境构建及OLED屏驱动测试被打赏¥20元 | |
| 【S32K3XX】Core-to-Core 中断使用被打赏¥21元 | |
| 「AI编程记录--含源码」用一晚上的时间写一个esp32的示波器被打赏¥19元 | |
| STM32C0116DK开发探索记(3)被打赏¥30元 | |
| STM32C0116DK开发探索记(2)被打赏¥24元 | |
| STM32C0116DK开发探索记(1)被打赏¥29元 | |
我要赚赏金
