barrel shifter using multiplexer: how to go about it
Each multiplexer produces one output bit, so the number of multiplexers you need is equal to the width of the output bus.

The number of inputs on each multiplexer is equal to the number of different shifts you want to create. A fully-general barrel shifter would use multiplexers that have an input for each bit of the input bus.

Here's a simple example for a 4-bit input and output buses:







simulate this circuit &ndash; Schematic created using CircuitLab

This kind of barrel shifter has the minimum delay from any Dn input to any Yn output (2 levels of logic). The delay from any Sn input to any Yn output is slightly greater (3 levels of logic).