共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 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| 基于MCP23S17的输入输出功能模块控制被打赏¥20元 | |
| 【S32K3XX】SPD 软件包使用Link文件修改被打赏¥22元 | |
| Switch-Case局部变量定义问题被打赏¥23元 | |
| 基于米尔TIAM62L开发板的串口通信及应用被打赏¥20元 | |
| PCF8574功能模块及其使用被打赏¥20元 | |
| 传感器LSM6DSO及LIS3MDL的功能检测被打赏¥18元 | |
| LPS25HB气压传感器及其检测被打赏¥18元 | |
| HTS221温湿度传感器及其检测被打赏¥18元 | |
| 【S32K3XX】HSE FW 版本更新被打赏¥21元 | |
| 基于ArduinoUNO开发板的AT24C02读写测试被打赏¥16元 | |
我要赚赏金
