3. Headlight Control
Your aid is needed in developing the next-generation automatic headlight control system for Fjord Motors. You must design an FSM that monitors the
current ambient light level, provided to your FSM as a 2-bit unsigned number L, and automatically turns the headlights on/off through an output H (H=1
means the headlights are on).
Your design should turn the headlights on whenever the light level L has been 1 or less for two consecutive cycles, and should turn the headlights off
whenever the light level L has been 2 or more for two consecutive cycles (remember that L is a 2-bit unsigned number, hence ranges from 0 to 3).
a. Complete the abstract state transition diagram below by adding transitions labeled as DARK and LIGHT from each state. These labels correspond to L<
2 and L ≥ 2, respectively.
LIGHT
DAY
/OFF
LIGHTER
/ON
DARKER
/OFF
NIGHT
/ON
DARK
b. Now choose a representation for the states. The "DAY" state should use $S_1S_0 = 00$. If possible, choose bit patterns such that all transitions change only
one state bit rather than changing both state bits.
c. Write a truth table for the output H in terms of the current state $S_1S_0$, and a next-state table for the next state bits $S_1^+$ and $S_0^+$ in terms of the ambient
light level $L = L_1L_0$ and the current state $S_1S_0$.
d. Copy the truth table and next-state table from part (c) into separate K-maps (one for H and one for each next-state variable).
e. Use the K-maps from part (d) to find expressions for each output and next-state variable with minimal area. (Minimize each variable independently-do
not try to share gates for implementations.) You must consider both minimal SOP and minimal POS solutions, but you should only circle the better of the
two choices (SOP or POS) on your K-maps and write the corresponding expressions when handing in your homework.
f. For the luxury model of Fjord's new vehicle, the driver has a control knob to adjust the automatic headlights' light-level threshold. This knob produces
an 8-bit unsigned number T. The light sensor L has also been upgraded to produce an 8-bit unsigned value (instead of a 2-bit value). The values L and T are
fed into an 8-bit unsigned comparator that produces a signal X whenever L < T. In other words, X=1 when L < T, and X=0 when L ≥ T. Explain how to
integrate your FSM design with the comparator for the luxury version of the vehicle. Hint: You should not need to change your design's structure.