Barrel shifter

Barrel shifter

A barrel shifter is a digital circuit that can shift a data word by a specified number of bits in one clock cycle. It can be implemented as a sequence of multiplexers (MUX), and in such an implementation the output of one MUX is connected to the input of the next MUX in a way that depends on the shift distance. The number of multiplexers required for an "n"-bit word is n imeslog_2(n). Four common word sizes and the number of multiplexers needed are listed below:

* 64-bit — 64 imeslog_2(64) = 64 imes6 = 384
* 32-bit — 32 imeslog_2(32) = 32 imes5 = 160
* 16-bit — 16 imeslog_2(16) = 16 imes4 = 64
* 8-bit — 8 imeslog_2(8) = 8 imes3 = 24

For example, take a 4-bit barrel shifter, with inputs A, B, C and D. The shifter can cycle the order of the bits ABCD, such as DABC, or CDAB; in this case, no bits are lost. That is, it can 'shift' all of the outputs up to three positions to the right (and thus make any cyclic combination of A, B, C and D). The barrel shifter has a variety of applications, including being a vital component in microprocessors (alongside the ALU).

Implementation

A barrel shifter is often implemented as a cascade of parallel 2×1 multiplexers. For a 4-bit barrel shifter, an intermediate signal is used which shifts by two bits, or passes the same data, based on the value of S [1] . This signal is then shifted by another multiplexer, which is controlled by S [0] :

im = IN, if S [1] = 0 = IN << 2, if S [1] = 1

OUT = im, if S [0] = 0 = im << 1, if S [0] = 1

Larger barrel shifters have additional stages.

Uses

A common usage of a barrel shifter is in the hardware implementation of floating-point arithmetic. For a floating-point add or subtract operation, the mantissa of the two numbers must be aligned, which requires shifting the smaller number to the right, increasing its exponent, until it matches the exponent of the larger number. This is done by subtracting the exponents, and using the barrel shifter to shift the smaller number to the right by the difference, in one cycle. If a simple shifter were used, shifting by "n" bit positions would require "n" clock cycles.

External links

* [http://answers.google.com/answers/threadview?id=388350 Google Answers] has a good explanation, and collection of links
* [http://tams-www.informatik.uni-hamburg.de/applets/hades/webdemos/10-gates/60-barrel/shifter8.html University of Hamburg] for a useful Java Barrel shifter.

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Barrel-Shifter — Ein Barrel Shifter ist ein Bauteil aus der Digitaltechnik. Es handelt sich dabei um eine spezielle Art einer kombinatorischen Schaltung, mit der binäre Verschiebungen oder Rotationen um eine beliebige, einstellbare Anzahl von Stellen erfolgen… …   Deutsch Wikipedia

  • Barrel shifter — Принцип действия устройства быстрого сдвига …   Википедия

  • Barrel-shifter — Ein Barrel shifter ist ein Bauteil aus der Digitaltechnik. Es handelt sich dabei um eine Schiebelogikschaltung. Er besteht aus 2 auf 1 Multiplexern und Dekodern. Im Unterschied zu gewöhnlichen Schieberegistern kann ein Barrel shifter in einem… …   Deutsch Wikipedia

  • Barrel shifter — Ein Barrel shifter ist ein Bauteil aus der Digitaltechnik. Es handelt sich dabei um eine Schiebelogikschaltung. Er besteht aus 2 auf 1 Multiplexern und Dekodern. Im Unterschied zu gewöhnlichen Schieberegistern kann ein Barrel shifter in einem… …   Deutsch Wikipedia

  • barrel shifter — ● ►en /bar ail (ch)if t*r/ loc. m. ►PUCE câblage interne à un microprocesseur lui permettant de réaliser plusieurs shifts en un seul cycle machine (jusqu à 8 d un coup sur certains processeurs Motorola). Extrêmement rapidement, donc …   Dictionnaire d'informatique francophone

  • Barrel rotator — Ein Barrel shifter ist ein Bauteil aus der Digitaltechnik. Es handelt sich dabei um eine Schiebelogikschaltung. Er besteht aus 2 auf 1 Multiplexern und Dekodern. Im Unterschied zu gewöhnlichen Schieberegistern kann ein Barrel shifter in einem… …   Deutsch Wikipedia

  • FPU — Gleitkommaeinheit ist ein Begriff aus der Computertechnik und bezeichnet einen speziellen Prozessor, der mathematische Funktionen oder Gleitkommazahlen verarbeitet. Bei vielen modernen CPUs ist die FPU als Koprozessor realisiert. FPU oder NPU… …   Deutsch Wikipedia

  • Floating Point Unit — 80287, FPU einer 80286 CPU mit 6 MHz. Gleitkommaeinheit ist ein Begriff aus der Computertechnik und bezeichnet einen speziellen Prozessor, der mathematische Funktionen oder Gleitkommazahlen verarbeitet. Bei vielen modernen CPUs ist die FPU als… …   Deutsch Wikipedia

  • Gleitkomma-Einheit — 80287, FPU einer 80286 CPU mit 6 MHz. Gleitkommaeinheit ist ein Begriff aus der Computertechnik und bezeichnet einen speziellen Prozessor, der mathematische Funktionen oder Gleitkommazahlen verarbeitet. Bei vielen modernen CPUs ist die FPU als… …   Deutsch Wikipedia

  • Gleitkommazahl-Koprozessor — 80287, FPU einer 80286 CPU mit 6 MHz. Gleitkommaeinheit ist ein Begriff aus der Computertechnik und bezeichnet einen speziellen Prozessor, der mathematische Funktionen oder Gleitkommazahlen verarbeitet. Bei vielen modernen CPUs ist die FPU als… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”