Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

One of the green parking lots has only one entrance gate and can accommodate onl

ID: 3813360 • Letter: O

Question

One of the green parking lots has only one entrance gate and can accommodate only 10 cars. Only one car can pass through the entrance gate (either exit or enter) at a time.
Two light sensors, separated by 1 meter, detect whether the car is entering or leaving.
During entrance, there will be a sign with FULL or FREE.

a. Derive the state diagram for the problem.
b. Using Xilinx ISE, write and simulate a VHDL/Verilog description to correctly command the lights according to the occupancy of the parking lot.
c. Write a test bench to simulate the above operation.
d. Provide synthesis report.

Explanation / Answer

State Diagram

In addition to graphical symbols, tables or equations, flip-flops can also be represented graphically by a state diagram. In this diagram, a state is represented by a circle, and the transition between states is indicated by directed lines (or arcs) connecting the circles. An example of a state diagram is shown in Figure 3 below.sd.gif (6231 bytes)  
Figure 3. State Diagram

The binary number inside each circle identifies the state the circle represents. The directed lines are labelled with two binary numbers separated by a slash (/). The input value that causes the state transition is labelled first. The number after the slash symbol / gives the value of the output. For example, the directed line from state 00 to 01 is labelled 1/0, meaning that, if the sequential circuit is in a present state and the input is 1, then the next state is 01 and the output is 0. If it is in a present state 00 and the input is 0, it will remain in that state. A directed line connecting a circle with itself indicates that no change of state occurs. The state diagram provides exactly the same information as the state table and is obtained directly from the state table.

Example: This example is taken from P. K. Lala, Practical Digital Logic Design and Testing, Prentice Hall, 1996, p.155.

Consider a sequential circuit shown in Figure 4. It has one input x, one output Z and two state variables Q1Q2 (thus having four possible present states 00, 01, 10, 11).

sq-expl.gif (4827 bytes)  
Figure 4. A Sequential Circuit

The behaviour of the circuit is determined by the following Boolean expressions:

Z = x*Q1
D1 = x' + Q1
D2 = x*Q2' + x'*Q1'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote