Learn

Practice

Press Safety Interlock

An industrial press may only operate with its guard door closed. Because a single stuck sensor could be fatal, the door carries two independent sensors that should always agree. You are writing the interlock logic: three gate expressions, computing in parallel, deciding what the press does.

Interface

PortDirectionTypeDescription
powerin1 bitPower switch is on
guard_ain1 bitSensor A reads "guard closed"
guard_bin1 bitSensor B reads "guard closed"
runout1 bitPress is allowed to run
alertout1 bitOperator warning light
faultout1 bitSensor fault indicator

Behavior

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

Spelled out for all eight input rows:

powerguard_aguard_brunalertfault
000000
001001
010001
011000
100010
101011
110011
111100

Notice the rows where alert and fault are high together. They are independent indicators answering different questions, not exclusive status categories.

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

Constraints

STRUCTURE

one concurrent assignment per output, using only and, or, xor, and not (&, |, ^, ~). No processes or always blocks; this is pure combinational wiring.

Loading editor...

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