BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help
Not What You Meant?  There are 18 definitions for Shift.

Barrel shifter

Print-Friendly
About 1 pages (429 words)

Bookmark and Share Questions on this topic? Just ask!

A barrel shifter is a digital circuit that can shift a data word by a specified number of bits. It can be implemented as a sequence of multiplexers. In this 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 is n*log2(n), for an n bit word. Four common word sizes and the number of multiplexers needed are listed below:

  • 64-bit — <math>64*\log_2(64) = 64*6 = 384</math>
  • 32-bit — <math>32*\log_2(32) = 32*5 = 160</math>
  • 16-bit — <math>16*\log_2(16) = 16*4 = 64</math>
  • 8-bit — <math>8*\log_2(8) = 8*3 = 24</math>

For example a four-bit barrel shifter, with inputs A, B, C and D. The shifter can cycle the order of the bits ABCD. 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).

Contents

Implementation

Often, the barrel shifter is implemented as a cascade of parallel 2x1 multiplexers. For a four-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

The barrel shifter is used in floating-point arithmetic hardware. For a floating-point add or subtract operation, the mantissae of the 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

References

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.

View More Summaries on Barrel shifter
 
Ask any question on Barrel shifter and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Barrel shifter from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy