barrel shifter, logarthmic shifter and funnel shifter

1,shifter小集合

(1) simple shift

左移或右移补0

(2) arthmetic shift

左移补0,右移补符号位

(3) barrel shifter

桶型,顾名思义,应该头尾衔接,但实际应用时也有左移补0的例子

可以把barrel shifter想象成一个圆形转钮

barrel shifter, logarthmic shifter and funnel shifter

按逆时针方向转动

(4) funnel shifter

漏斗,运算结果是从一个长集合里取出一个短集合

2,barrel shifter

(1) 优点

相对于使用触发器的移位寄存器,barrel shifter的延时几乎是固定的,因为它使用的是组合逻辑。

理论上,barrel shifter的延时是固定的一级传输门,与移位级数无关;当然实际上随着级数增加,传输电容也会增大。

(2) 实现

一般有两种实现方法。

a) 在cross-bar上用CMOS实现

barrel shifter, logarthmic shifter and funnel shifter

(图片来自*;X是输入,Y是输出)

barrel shifter, logarthmic shifter and funnel shifter

b) 对于硬件描述语言,可以用多个2选1 MUX实现

barrel shifter, logarthmic shifter and funnel shifter

说明可看:https://tams.informatik.uni-hamburg.de/applets/hades/webdemos/10-gates/60-barrel/shifter8.html

以8-bit barrel shifter为例,连线规则是:

 int1  = IN       , if S[2] == 0
       = IN   << 4, if S[2] == 1
 int2  = int1     , if S[1] == 0
       = int1 << 2, if S[1] == 1
 OUT   = int2     , if S[0] == 0
       = int2 << 1, if S[0] == 1
S[0]是第一级,S[n]是最后一级。
上述例子只有左移补0,没有头尾衔接的循环。想改进也很简单:第一级把b[7]连到b[0],依此类推即可。
(3) 资源消耗
n-bit barrel shifter消耗的MUX数量为: nlog2(n).
(4) 应用
barrel shifter常在硬件实现浮点运算时用到。
3,logarthmic shifter
逻辑数学运算,实际上是移位运算的特殊应用。
barrel shifter, logarthmic shifter and funnel shifter
4, funnel shifter
funnel shifter可以实现上述所有的shifter。
barrel shifter, logarthmic shifter and funnel shifter
根据A与B的关系,funnel shifter可实现的不同功能:
barrel shifter, logarthmic shifter and funnel shifter
funnel shifter的两种实现方法:
(1) 
barrel shifter, logarthmic shifter and funnel shifter
(2) 
barrel shifter, logarthmic shifter and funnel shifter