written 5.8 years ago by |
A barrel shift is a particularly useful circuit structure to implement a shift or rotate. Firstly, barrel shifter circuit can be defined by considering the circuit diagram of a general-purpose bus multiplexer for a 4-bit data path as shown in fig. Sixteen pass transistors are required in this multiplexer circuit to permit connection of any bit line to any other bit line. Sixteen control lines would be needed, if each pass transistor could be choosen individually. Only four shift possibilities are actually required due to most requirements are for parallel shifts with all bits moved the same number of bit positions.
A better circuit with the pass transistors connected in group of four as shown in fig. 4.12, in which the control line requirements is decreased from 16 to 4 separate control lines S0 – S3. To derive a 2-to-4 decoder circuit, a particular control line might be chosen by encoding a 2-bit control field. The output of individual decoder would provide the suitable shift control line. 1024 pass transistors are required for a 32-bit data path to permit the desired shift operations. In only parallel shifts 32 control lines chosen by a 5-bit encoded control field are enough.
some interesting observations are as follows –
If the data path runs horizontally, it is required to give a vertical path for control to implements the shift function. Sometimes, this vertical path connection is used to insert or extract external data to or from the data path along D4 – D6 or D0 – D3. It should be noted that control signals S0 –S3 for the data path are given vertically, the vertical path of the barrel shifter is used to insert data that is part of the data path control instruction. Normally, data that is part of the data path instruction is known as literal or immediate data.
The action of the barrel shifter structure simplicity suggests that the vertical pitch of the data path layout will certainly be limited by the vertical pitch of the register array or the arithmetic logic unit rather than by the barrel shifter. This observation provides maximization of the vertical dimension of a barrel shifter whereas the horizontal dimension is minimized to match the rest of the data path to acquire the area efficiency of the layout.