← ProblemsCircuits / Combinational Logic / Multiplexers
256-to-1 multiplexer
36%muxvectorsBuild a 1-bit wide, 256-to-1 multiplexer. The 256 data inputs arrive packed into a single 256-bit vector in, and the 8-bit sel picks one bit:
sel = 0selectsin[0],sel = 1selectsin[1], …sel = 255selectsin[255].
A 256-way case statement would be miserable to write — there is a much shorter way.