Parallel Link Monitor
A safety-critical backplane carries the same 8-bit word on two parallel links, A and B. Your monitor compares them lane by lane and raises one clean verdict. Lanes flagged as "under maintenance" must never trigger it, because a technician is allowed to disturb those wires.
Interface
| Port | Direction | Type | Description |
|---|---|---|---|
a_i | in | 8-bit vector | Word as received on link A |
b_i | in | 8-bit vector | Word as received on link B |
maint_i | in | 8-bit vector | '1' on each lane currently under maintenance |
diff_o | out | 8-bit vector | '1' on each lane where the links disagree |
ok_o | out | 1 bit | High when every lane agrees |
alert_o | out | 1 bit | High when any monitored lane disagrees |
Behavior
diff_omarks disagreement per lane: bit n is '1' exactly when bit n ofa_idiffers from bit n ofb_iok_ois high when all eight lanes agree, that is, when no bit ofdiff_ois high- For
alert_o, each lane contributes only when itsdiff_obit is '1' and itsmaint_ibit is '0'. Then combine all eight contributions into one verdict - A disagreement on a maintained lane therefore drops
ok_obut leavesalert_olow; the testbench checks this case explicitly
diff_o bit | maint_i bit | This lane contributes to alert_o |
|---|---|---|
| '0' | either value | '0' |
| '1' | '1' (under maintenance) | '0' |
| '1' | '0' (monitored) | '1' |
Constraints
OPERATORS: only the bitwise operators
and,or,xor, andnot, plus reduction operators.
STRUCTURE: one assignment outside a procedural block per output; no procedural blocks.
Loading editor...
Click Run to execute your code. Output will appear here.