Barrel Shifter
Overview
A barrel shifter is a combinational digital circuit that performs an arbitrary-direction, arbitrary-amount shift (or rotation) of a data word within a single clock cycle, without iterating over a shift count. It is commonly realized as a permutation network—layers of multiplexers (or transmission gates) that route each input bit to a chosen output position based on the shift amount.
Structure and Operation
According to the provided evidence, a barrel shifter can be built as a permutation network whose switching elements are transmission gates:
- "This framework is evaluated with a primitive permutation network - a barrel shifter." (arxiv 1711.05332v1)
- "BS-PUF is implemented using transmission gates; their characteristics ensure same-chip reproducibility, a necessary property of PUFs." (arxiv 1711.05332v1)
The evidence also indicates that, in the security-application design referenced, an 8-level barrel shifter was laid out using a common-centroid layout in 0.13 µm technology (arxiv 1711.05332v1).
Use as a Hardware Building Block
The public context describes barrel shifters (termed "B-shifters") as one of the basic combinational logic modules used to construct iterative numerical hardware:
- "This algorithm only uses the basic combinational logic modules such as adders, multiplexers, encoders, Barrel shifters (B-shifters), and comparators and does not use any lookup table." (arxiv 1707.05189v1)
- "The diagonal processor uses priority encoders, Barrel shifters, and comparators to calculate the rotation angles." (arxiv 1707.05189v1)
In that normalized singular value decomposition (SVD) architecture using Givens fast (approximate) rotations, the barrel shifter is used by the diagonal processor to compute the rotation angles, while both processors rely on adders to apply those angles, within a systolic array of diagonal and non-diagonal processors.
Integration in a RISC-V Processor Core
The EPEX verification paper (aab6a18d-bedb-40db-b992-eb4f6c5fc803) describes a case study in which a barrel shifter was integrated into a VexRiscv (RISC-V) core to speed up shifting. The design decomposes left shifts into a three-step sequence:
- Reverse the input.
- Perform a right shift by a variable number of steps.
- Reverse the output again (for left-shift operations).
A configuration option placed the final reverse operation in either the execute stage (to reduce logic depth) or the memory stage of the pipeline. The same source notes that a copy-and-paste error in this reverse step was detected by running an EPEX-generated equivalent program on the slli instruction, producing a mismatched register value t3 compared to the instruction-set simulator. Dedicated shift tests would also have caught the bug; the cited benefit of the verification flow is that existing tests are automatically broadened.
Application as a Physical Unclonable Function (BS-PUF)
Evidence describes a protocol that uses a barrel shifter as a commutative primitive for secure data transmission, exploiting manufacturing variability across its shift paths:
- "Parties each have a PUF used for encryption and decryption; this is facilitated by constraining the PUF to be commutative." (arxiv 1711.05332v1)
- "Barrel shifter (BS) PUF captures the delay of different shift paths. This delay is entangled with message bits before they are sent across an insecure channel." (arxiv 1711.05332v1)
Post-layout simulations reported in that work passed the selected NIST statistical randomness tests, exhibited stability similar to Ring Oscillator (RO) PUFs under environmental variation, and resisted logistic-regression modeling using 100,000 plaintext–ciphertext pairs.
Performance Notes from the SVD Architecture
The normalized SVD design using Givens fast rotations reports "2.83∼649 times better energy per matrix performance compared to the state of the art designs" without pipelining, with the authors stating that additional improvement is expected when pipelining is employed (arxiv 1707.05189v1). This figure pertains to the overall design rather than the barrel shifter alone.
Limitations of the Evidence
The provided sources do not contain a generic, self-contained definition of a barrel shifter; the description above is reconstructed from how the circuit is used and constructed in the cited works (multiplexer/transmission-gate permutation network, single-cycle multi-bit shift). No evidence in the provided chunks addresses general-purpose register, flag, or signed-shift semantics of barrel shifters, nor comparisons with logarithmic vs. linear shifter topologies.