entity ELEVATOR_CONTROL is port(FB1, CALL1, FB2, CALL2, FS1, FS2, DC : in std_logic; N1, N2 , CLK: in std_logic; R1, R2, UP, DOWN, DO : out std_logic); end ELEVATOR_CONTROL; architecture BEHAV of ELEVATOR_CONTROL; type STATE_TYPE is (F12, F22, F21, F11); signal CURRENT_STATE, NEXT_STATE : STATE_TYPE; begin process (FB1, CALL1, FB2, CALL2, FS1, FS2, DC, N1, N2, CURRENT_STATE) begin if (CURRENT_STATE = F12) then if (FS2 = ‘0’) then UP <= ‘1’; NEXT_STATE else R2 <= ‘1’; DO <= ‘1’; elsif (CURRENT_STATE = F22) then NEXT_STATE <= F22; if (N2 = ‘1’) then R2 <= ‘1’; DO <= ‘1’; elsif (N1 = ‘1’) then if (DC = ‘1’) then DOWN <= ‘1’; NEXT_STATE <= F21; End if; End if; Elsif (CURRENT_STATE = F21) then If (FS1 = ‘1’) then R1 <= ‘1’; DO <= ‘1’; NEXT_STATE <= F11; Else DOWN <= ‘1’; NEXT_STATE <= F21; Elsif (CURRENT_STATE = F11) then NEXT_STATE <= F11; If (N1 = ‘1’) then R1 <= ‘1’; DO <= ‘1’; Elsif (N2 = ‘1’) then If (DC = ‘1’) then UP <= ‘1’; NEXT_STATE <= F12; End if; End if; End if;