Parametrised Function Y = A.B + C.D

Implement y = (a AND b) OR (c AND d) bit by bit, for a bus width given by a parameter so the same module serves any width. The default WIDTH is 2, which is what the testbench instantiates.

Inputs: a, b, c, d, each WIDTH bits.
Output: y, WIDTH bits.

The testbench applies all 256 combinations of the four 2-bit inputs.

Contributed by Indicore

Compiler Output
Waveform Viewer