Learn

0/8
0/6
0/6
0/6

Practice

One Lamp, One Driver

The BUSY lamp should light when the heater, the pump, or both are running. The supplied design works when both are off and when both are on. It fails when only one is running.

Run the template and inspect one failing case. What does the lamp's value tell you about the problem? Fix it, then use a single-driver type for the internal lamp signal so the compiler can catch the same mistake next time.

Interface

PortDirectionTypeDescription
heater_on_iin1 bitHeater is running
pump_on_iin1 bitPump is running
lamp_oout1 bitBUSY lamp: high while anything runs

All ports are std_logic.

Behavior

  • lamp_o is '1' when heater_on_i is '1', when pump_on_i is '1', and when both are
  • lamp_o is '0' only when both inputs are '0'
  • All four input combinations are checked; no 'X' may appear anywhere

Constraints

SINGLE DRIVER: the lamp line stays a named internal signal with exactly one driver, and lamp_o keeps reading it.

  • The final declaration uses the strict std_ulogic kind. The testbench checks values only, so the declaration is your guard. The unfixed code must stop at compile time

  • Expect the first run to fail on the mixed rows; that 'X' in the waveform is the bug you're hunting

Loading editor...

Click Run to execute your code. Output will appear here.