Well, AFAIU, apart from "barrel" meaning it can support rotations, what you've described is what I've always understood a barrel shifter to be. <shrug>Nick said:You don't have to go way back to find a CPU without barrel shifter. The Pentium 4 has a 'logarithm shifter'. It's a (conditional) 1-bit shifter followed by a 2-bit shifter, followed by a 4-bit shifter, ... , and finally a 16-bit shifter (for operands up to 32-bit). It works by taking the shift amount and using the first least significant bit (LSB) to determine whether the 1-bit shifter should shift or not, using the second LSB for the 2-bit shifter, etc. This way every combination can be made.
EG: An 8-bit shifter
As for speed/size it only requires O(N*Log2(N)) MUX units (and a short critical path) and so is relatively small - a multiplier, for example, is an O(N^2) device and has a pig of a critical path.
Last edited by a moderator: