-------------------------------------------------------------------------- -------------------------------------------------------------------------- -- File Name : elevator_control.v -- Author(s) : Jay(anta) Roy -- Affiliation : Laboratory for Digital Design Environments -- Department of Electrical & Computer Engineering -- University of Cincinnati -- Date Created : Sept 1990. -- Introduction : Behavioral description of the Elevator Controller -- written in a synthesizable subset of VHDL. -- Source : ISPS description from -- L. J. Hafer and A. C. Parker, -- ``Automated Synthesis of Digital Hardware'', -- IEEE Tran. Computers, Feb 1982. -- -- Disclaimer : This comes with absolutely no guarantees of any -- kind (just stating the obvious ...) -- -- Acknowledgement : The Distributed Synthesis Systems research at -- the Laboratory for Digital Design Environments, -- University of Cincinnati, is sponsored in part -- by the Defense Advanced Research Projects Agency -- under order number 7056 monitored by the Federal -- Bureau of Investigation under contract number -- J-FBI-89-094. -- -------------------------------------------------------------------------- -------------------------------------------------------------------------- package types is type BIT_ARRAY_15 is array (0 to 15) of BIT; -- type floor_range is range 0 to 8; end types; use Work.types.all; use Work.functions.all; entity elevator_control is port ( car_floor : in INTEGER; up_call, down_call, button : in BIT; car_call : out BIT_ARRAY_15 ); end elevator_control; architecture behavior of elevator_control is -- signal scan_floor : int_Wired_OR INTEGER := 0; signal scan_floor : INTEGER := 7; begin process begin -- scan_floor <= 0 after 2 ns; -- wait on scan_floor until scan_floor = 8; if (scan_floor = 7) then scan_floor <= 0 ; else scan_floor <= scan_floor + 1 ; end if; wait on scan_floor; end process ; process variable index : INTEGER := 0; begin wait on scan_floor; if up_call='1' then index := 7 + scan_floor; car_call(index) <= '1'; end if; if down_call='1' then car_call(scan_floor) <= '1'; end if; if button='1' then if car_floor > scan_floor then car_call(scan_floor) <= '1'; else index := 7 + scan_floor; car_call(index) <= '1'; end if; end if; -- wait on scan_floor; -- wait for 1 ns; -- scan_floor <= scan_floor + 1; -- if scan_floor = 8 then -- wait on scan_floor until scan_floor = 0; -- end if; end process; end behavior;