This is an old revision of the document!
Code für die Abstimmungsschaltung
- cntsw.vhd
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; -- Count the number of switches -- This is done in a direct lookup table entity cntsw is port ( switch_i: in std_ulogic_vector(4 downto 0); cnt_o: out unsigned(2 downto 0) ); end; architecture rtl of cntsw is begin process(switch_i) begin -- here we go... end process; end; -- architecture
- decide.vhd
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; -- Add the counted switches from both switch decoders -- and decide if the led should switch on. entity decide is port ( swcnt1_i: in unsigned(2 downto 0); swcnt2_i: in unsigned(2 downto 0); sum_o: out unsigned(3 downto 0); led_o: out std_logic ); end; architecture rtl of decide is begin end; -- architecture