Learn

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

Practice

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

PortDirectionTypeDescription
a_iin8-bit vectorWord as received on link A
b_iin8-bit vectorWord as received on link B
maint_iin8-bit vector'1' on each lane currently under maintenance
diff_oout8-bit vector'1' on each lane where the links disagree
ok_oout1 bitHigh when every lane agrees
alert_oout1 bitHigh when any monitored lane disagrees

Behavior

  • diff_o marks disagreement per lane: bit n is '1' exactly when bit n of a_i differs from bit n of b_i
  • ok_o is high when all eight lanes agree, that is, when no bit of diff_o is high
  • For alert_o, each lane contributes only when its diff_o bit is '1' and its maint_i bit is '0'. Then combine all eight contributions into one verdict
  • A disagreement on a maintained lane therefore drops ok_o but leaves alert_o low; the testbench checks this case explicitly
diff_o bitmaint_i bitThis 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, and not, 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.