Learn
0/8
0/6
0/6
0/6
0/6
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
| Port | Direction | Type | Description |
|---|---|---|---|
power_i | in | 1 bit | Power switch is on |
guard_a_i | in | 1 bit | Sensor A reads "guard closed" |
guard_b_i | in | 1 bit | Sensor B reads "guard closed" |
run_o | out | 1 bit | Press is allowed to run |
alert_o | out | 1 bit | Operator warning light |
fault_o | out | 1 bit | Sensor fault indicator |
Behavior
run_ois high only when the power is on and both sensors read closedalert_ois high when the power is on but the guard is not fully confirmed closed; that is, at least one sensor reads openfault_ois 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, andnot. No procedural blocks; this is pure combinational wiring.
Loading editor...
Click Run to execute your code. Output will appear here.