I need to create a code in vhdl to control 3 elevators in a building of 15 floors.
At first everyone is in position 0 and only the elevator E1_POS should be called , the other lifts will stand .
The data from these ports are :
Clock , Reset : IN STD_LOGIC ;
C_orig : IN INTEGER RANGE 0 TO 15 ;
C_dest : IN INTEGER RANGE 0 TO 15 ;
E1_pos , E2_pos , E3_pos : OUT INTEGER RANGE 1 TO 15 ;
E1_load , E2_load , E3_load : OUT INTEGER RANGE 0 TO 15
Clock Reset and need no introduction . C_orig and C_dest are from the call buttons on each floor . Normally have the value 0 ( inactive) . When a passenger calls the elevator, the floor of origin of the call appears in C_orig , and the desired destination C_dest . Both signals are activated simultaneously , and only one clock cycle .
E1 ... 3_pos are registers that indicate the current position of each lift ( floor number ) . E1 ... 3_load who indicate each elevator is carrying at the time , being 0 when empty , or 1 ... 15 when busy - in this case the number must indicate the floor of origin of the person being transported . These two groups of registers are sufficient for checking the function of our system .
code :
Building control for an elevator ( E1 ), while others stopped. Make him answer calls and take passengers to their destinations , obeying the rules specified
Expand control for the three lifts . Define a logical decision on which lift should meet that call, according to some simple criteria.