← ProblemsCircuits / Combinational Logic / Multiplexers

256-to-1 multiplexer

36%muxvectors

Build 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 = 0 selects in[0], sel = 1 selects in[1], … sel = 255 selects in[255].

A 256-way case statement would be miserable to write — there is a much shorter way.