TRAFFIC_LIB.VHD
上传用户:dgjihui88
上传日期:2013-07-23
资源大小:43k
文件大小:1k
源码类别:

VHDL/FPGA/Verilog

开发平台:

MultiPlatform

  1. --declaraction of package traffic_lib including component "clk_gen" 
  2. --"traffic_mux" "count_down" "traffic_fsm"
  3. library ieee;
  4. use ieee.std_logic_1164.all;
  5. package traffic_lib is
  6.   component clk_gen 
  7.    port(reset: in std_logic;
  8.         clk:in std_logic;
  9.         ena_scan:out std_logic;
  10.         ena_1Hz:out std_logic;
  11.         flash_1Hz: out std_logic);
  12.   end component;
  13.   
  14.   component traffic_mux
  15.   port(reset: in std_logic;
  16.        clk:in std_logic;
  17.        ena_scan:in std_logic;
  18.        recount:in std_logic; 
  19.        sign_state: in std_logic_vector(1 downto 0);
  20.        load: out std_logic_vector(7 downto 0));
  21.   end component;
  22.   
  23.   component count_down
  24.     port(reset: in std_logic;
  25.          clk:in std_logic;
  26.          ena_1Hz:in std_logic;
  27.          recount:in std_logic;
  28.          load: in std_logic_vector(7 downto 0);
  29.          seg7:out std_logic_vector(15 downto 0);
  30.          next_state: out std_logic);
  31.   end component;
  32.   
  33.   component traffic_fsm
  34.   port(reset:in std_logic;
  35.        clk:in std_logic;
  36.        ena_scan:in std_logic;
  37.        ena_1Hz:in std_logic;
  38.        flash_1Hz:in std_logic;
  39.        a_m:in std_logic;
  40.        st_butt:in std_logic;
  41.        next_state: in std_logic;
  42.        recount: out std_logic;
  43.        sign_state: out std_logic_vector(1 downto 0);
  44.        red: out std_logic_vector(1 downto 0);
  45.        green: out std_logic_vector(1 downto 0);
  46.        yellow: out std_logic_vector(1 downto 0));
  47.   end component;
  48. end traffic_lib;
  49.