module mux4in8b title '4-input, 8-bit wide multiplexer PLD J. Wakerly, Stanford University' " Input and output pins !G pin; " Output enable for Y bus S1..S0 pin; " Select inputs, 0-3 ==> A-D A1..A8, B1..B8, C1..C8, D1..D8 pin; " 8-bit input buses A, B, C, D Y1..Y8 pin istype 'com'; " 8-bit three-state output bus " Sets SEL = [S1..S0]; A = [A1..A8]; B = [B1..B8]; C = [C1..C8]; D = [D1..D8]; Y = [Y1..Y8]; equations "Y.OE = G; WHEN (SEL == 0) THEN Y = A; ELSE WHEN (SEL == 1) THEN Y = B; ELSE WHEN (SEL == 2) THEN Y = C; ELSE WHEN (SEL == 3) THEN Y = D; end mux4in8b