- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
TRAFFIC_MUX.VHD
上传用户:dgjihui88
上传日期:2013-07-23
资源大小:43k
文件大小:1k
源码类别:
VHDL/FPGA/Verilog
开发平台:
MultiPlatform
- LIBRARY IEEE;
- USE IEEE.std_logic_1164.all;
- USE IEEE.std_logic_unsigned.all;
- USE IEEE.std_logic_arith.all;
- entity traffic_mux is
- port(reset: in std_logic;
- clk:in std_logic;
- ena_scan:in std_logic;
- recount:in std_logic;
- sign_state: in std_logic_vector(1 downto 0);
- load: out std_logic_vector(7 downto 0));
- end;
- --define the signal_structure and flow of the device
- architecture BEHAVIOR of traffic_mux is
- CONSTANT yellow0_time: integer := 5;
- CONSTANT green0_time: integer := 20;
- CONSTANT yellow1_time: integer := 5;
- CONSTANT green1_time : integer := 20;
- begin
- load_time:process(reset,clk)
- begin
- if reset='1' then
- load<="00000000";
- elsif (clk'event and clk='1') then
- if (ena_scan='1' and recount = '1') then
- CASE sign_state IS
- WHEN "00" =>
- load <= CONV_STD_LOGIC_VECTOR(green1_time,8);
- WHEN "01" =>
- load <= CONV_STD_LOGIC_VECTOR(yellow0_time,8);
- WHEN "10" =>
- load <= CONV_STD_LOGIC_VECTOR(green0_time,8);
- WHEN OTHERS =>
- load <= CONV_STD_LOGIC_VECTOR(yellow1_time,8);
- END CASE;
- end if;
- end if;
- end process;
- end BEHAVIOR;