Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Parking Entrance Light ( 8 points ) The entrance to a parking lot is a narrow bridge wide enough for only one car. In this
Parking Entrance Light points
The entrance to a parking lot is a narrow bridge wide enough for only one car. In this problem you will design a state machine to control traffic across the bridge so that only one car at a time uses the bridge. You must also not allow cars into the parking lot when it is full.
There are lights, LIN and LOUT, on both sides allowing cars to use the entranceexit There are also two sensors WIN and WOUT, which will be high when there is a car waiting to enter or exit, respectively. There are two sensors CIN and COUT, which will be high for one cycle after a car has entered or exited, respectively. In addition, you are provided with a counter which has an output signal FULL to indicate when the parking cannot hold any additional cars. You must increment and decrement the counter using the counter UP and DOWN inputs.
Your task is to control the two lights, LIN and LOUT, which allow cars to enter and exit respectively. You must also control the UP and DOWN counter inputs so that you will know when the parking lot is full. No cars should be allowed to enter when the parking lot is full. Your controller should be fair in that it alternates between letting cars in and out when both directions have cars waiting.
You must generate outputs to control the lights LIN and LOUT and the UP and DOWN to meet the following requirements:
Asserting LIN or LOUT results in a green light for cars entering exiting the parking lot.
Only one light should be green at a time and that light should remain green until the car has crossed over the bridge indicated by CIN or COUTThere is a sign that says only one car per green light.
Cars should not be allowed in if the parking lot is full.
In case of cars waiting on both sides, the side which did not have the last green light should win.
UP and DOWN should be assert once at a clock edge for the Counter to work properly.
If there are no cars waiting on both ends, both lights should be red.
Your controller has inputs and outputs as follows:
Draw a state diagram for your controller.
Using onehot encoding, write the next state and output logic equations for your controller.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started