---------------------------------------------------------------------------------- -- Company: -- Engineer: Andrew Der -- -- Create Date: 12:28:14 11/21/2014 -- Design Name: -- Module Name: input_checkSIMON - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- ---------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity input_checkSIMON is Port ( NUMBER : in STD_LOGIC_VECTOR (4 downto 0); clock: in STD_LOGIC; ButtonZ : in STD_LOGIC; Button1 : in STD_LOGIC; Button2 : in STD_LOGIC; Button3 : in STD_LOGIC; result : out STD_LOGIC:='0'; Enable : in STD_LOGIC); end input_checkSIMON; architecture Behavioral of input_checkSIMON is --signal declaration signal n0:std_logic; signal n1:std_logic; signal n2:std_logic; signal n3:std_logic; begin Correct: process( clock, ButtonZ, Button1, Button2, Button3, NUMBER) begin n0 <= '0'; n1 <= '0'; n2 <= '0'; n3 <= '0'; if ((NUMBER >= "00001") and (NUMBER <= "01000")) then n0 <= '1'; elsif ((NUMBER >= "01001") and (NUMBER <= "10001")) then n1 <= '1'; elsif ((NUMBER >= "10010") and (NUMBER <= "11001")) then n2 <= '1'; elsif ((NUMBER >= "11010") and (NUMBER <= "11111")) then n3 <= '1'; end if; if (rising_edge(clock)) then if (enable = '1') then if (n0 ='1') then if (ButtonZ = '1') then result <= '1'; elsif (Button1 = '1') then result <= '0'; elsif (Button2 = '1') then result <= '0'; elsif (Button3 = '1') then result <= '0'; end if; elsif (n1 ='1') then if (ButtonZ = '1') then result <= '0'; elsif (Button1 = '1') then result <= '1'; elsif (Button2 = '1') then result <= '0'; elsif (Button3 = '1') then result <= '0'; end if; elsif (n2 ='1') then if (ButtonZ = '1') then result <= '0'; elsif (Button1 = '1') then result <= '0'; elsif (Button2 = '1') then result <= '1'; elsif (Button3 = '1') then result <= '0'; end if; elsif (n3 ='1') then if (ButtonZ = '1') then result <= '0'; elsif (Button1 = '1') then result <= '0'; elsif (Button2 = '1') then result <= '0'; elsif (Button3 = '1') then result <= '1'; end if; end if; elsif (enable = '0') then result <= '0'; end if; end if; end process correct; end Behavioral;