I have to make a CPLD based VHDL project. So My idea is to make AUTOMATED CAR PARKING PROTOTYPE. I hav written the code as per the required algorithm. CAn ny1 chk it for me? i dont hav VHDL software on my PC or else i wud have chked it on my own. please help.
Entity ABCD is
Port (
CurrentStatus : IN BIT_VECTOR(0 to 3);
S1,GND,FIRST : IN BIT;
LEDOUT : OUT BIT_VECTOR(0to3)
);
End ABCD;
Architecture A of ABCD is
Begin
Process (S1)
Variable : SavedStatus_GND : BIT_vector(0to3);
Variable : SavedStatus_FIRST : BIT_vector(0to3);
Begin
If (GND’event and GND=’1’ ) then
LEDOUT<= SavedStatus_GND;
If (S1’event and S1=’0’ ) then
SavedStatus_GND := CurrentStatus;
End if;
End if;
Wait for 10 ns;
LEDOUT<=”0000”;
If (FIRST’event and FIRST=’1’ ) then
LEDOUT<= SavedStatus_FIRST;
If (S1’event and S1=’0’ ) then
SavedStatus_FIRSt := CurrentStatus;
End if;
End if;
Wait for 10 ns;
LEDOUT<=”0000”;
End process ;
End A ;
-new user wil make s1 on
- he will decide gnd floor or first floor wid the help of switch GND nd FIRST
- led status will correspond to saved positions
- on led corresponds to occupied place n off says place is empty
-user will take the car to empty place n will make corresponding status i/p HIGH
-also he will turn s1 off before leaving his car
-when d nxt user arrives he will follow d same procedure.
Everything seems ok, but then why is the output a 3 bit vector? Any particular reason? Cant it be a 1 bit output?
Why do you have to use variables when there are only if statements? The assignment doesn't create an error due to time-delay, you can as well assign LEDOUT<=current_status
Oh and use an if-else statement to chose between the two floors.