- 7
- 0
- 约2.29万字
- 约 18页
- 2017-06-29 发布于浙江
- 举报
cpld电子钟交通灯抢答器16路彩灯课设参考程序
1.16 路彩灯控制器参考程序
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity caideng is
port( rst: in std_logic; --复位信号
clk: in std_logic; --输入时钟50MHz
key: in std_logic; --频率快慢选择信号
led: out std_logic_vector( 15 downto 0)); --16路彩灯输出
end caideng;
architecture Behavioral of caideng is
signal clk1: std_logic;
signal cnt: std_logic_vector( 24 downto 0);
type state is (s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16);
signal current_state,next_state: state;
constant f1: std_logic_vec
原创力文档

文档评论(0)