'Barrel shifter'에 해당되는 글 1건

  1. 2006/12/17 Barrel shifter

Barrel shifter

Development 2006/12/17 01:44
From Wikipedia, the free encyclopedia

A barrel shifter is a digital circuit that can shift a data word by any number of bits in a single cycle. It is implemented as a sequence of multiplexors: 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 multiplexors required is n*log2(n), where n is the computer's register size. Four common word sizes and the number of multiplexors needed are listed below:
  • 64-bit -- 64 * log2(64) = 64 * 6 = 384
  • 32-bit -- 32 * log2(32) = 32 * 5 = 160
Take for example a four-bit barrel shifter, with inputs A, B, C, and D. The shifter can cyclically after 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 combiation of A, B, C, and D). The barrel shifter has a variety of applications, including being a vital component in microprocessors (alongside the ALU).

The barrel shifter is used in floating-point arithmetic hardware. For a floating-point and or subtract operation, the fractions of the numbers must be aligned, which requires shifting the smaller number (in magnitude) 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.

Ref. University of Hamburg's Java Barrel shifter
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by Kyounghan