module amux4in3 title 'Specialized 4-input, 3-bit Multiplexer' "amux4in3 device 'P16L8'; " Input and output pins S2..S0 pin 16..18; " Select inputs A0..A2, B0..B2, C0..C2, D0..D2 pin 1..9, 11, 13, 14; " Bus inputs F0..F2 pin 19, 15, 12 istype 'com'; " Bus outputs " Sets SEL = [S2..S0]; A = [A0..A2]; B = [B0..B2]; C = [C0..C2]; D = [D0..D2]; F = [F0..F2]; equations WHEN (SEL== 0) # (SEL== 2) # (SEL== 4) # (SEL== 6) THEN F = A; ELSE WHEN (SEL== 1) # (SEL== 7) THEN F = B; ELSE WHEN (SEL== 3) THEN F = C; ELSE WHEN (SEL== 5) THEN F = D; end amux4in3