Loading simulator…
Solution Explanation
UPV = ENTP · EXTP' · EMPTY'
DNV = ENTP' · EXTP · FULL'
UPV increases the available-space count when a vehicle exits, while DNV decreases it when a vehicle enters. If both sensors activate together, the counter holds its current value.
FULL = Q2' · Q1' · Q0'
EMPTY = Q2 · Q1 · Q0
FULL = 1 when the count is 000, meaning no parking spaces are available. EMPTY = 1 when the count is 111, meaning all seven spaces are available.
COUNTEN = UPV + DNV
COUNTEN becomes HIGH only when a valid entrance or exit event occurs.
T0 = COUNTEN
T1 = COUNTEN · (Q0 XNOR UPV)
T2 = COUNTEN · (Q0 XNOR UPV) · (Q1 XNOR UPV)
T0 toggles during every valid count. T1 and T2 toggle according to the current lower-bit states and the counting direction selected by UPV.
parking_full = FULL
parking_available = FULL'
The red parking_full LED turns ON when the count is 000. The green parking_available LED remains ON whenever at least one parking space is available.