Learn

Practice

Press Safety Interlock

A press has two guard-door sensors. Write the logic that enables it only when both sensors report closed and power is on. The warning lamp and sensor-fault indicator have different jobs, so work out each output separately. This exercise models the logic only; a real machine needs a safety-rated control system.

Interface

PortDirectionTypeDescription
power_iin1 bitPower switch is on
guard_a_iin1 bitSensor A reads "guard closed"
guard_b_iin1 bitSensor B reads "guard closed"
run_oout1 bitPress is allowed to run
alert_oout1 bitOperator warning light
fault_oout1 bitSensor fault indicator

Behavior

  • run_o is high only when the power is on and both sensors read closed
  • alert_o is high when the power is on but the guard is not fully confirmed closed; that is, at least one sensor reads open
  • fault_o is high whenever the two sensors disagree, regardless of power

Power is off. The sensors disagree.

Question 1 of 1

The testbench sweeps all eight input combinations and checks all three outputs on every row.

Constraints

STRUCTURE: one assignment outside a procedural block per output, using only and, or, xor, and not. No procedural blocks; this is pure combinational wiring.

Loading editor...

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