开发者

Designing an edge-triggered barrel shifter/rotator in Verilog

I made a combinational barrel shifter/rotator. Now I have to make an edge triggered one. If you use the control signals to tell the edge-triggered shifter开发者_开发百科/rotator to shift right by one bit, then if you don't change the controls, will the output eventually go to 0?

I'm supposed to design it by using a combinational shifter/rotator and a D register. Why is a D register needed?


From what I understand, if you're just shifting, bits will fall off and zeros will fill the empty bit positions. If you're rotating, bits can never fall off and are instead tacked on to the other end. Here is a rotation of the bits ABCD one bit position, twice: ABCD DABC CDAB. You can see that if the control is stuck in rotate, the bits will just keep cycling. Here is a shift of one bit position, three times: ABCD 0ABC 00AB 000A, and you can see this case will eventually go to zero if the control is unchanged. As far as the use of a D Register, here's my guess: registers are memory elements and must store bit values, and so a D register is a register composed of D flip flops to store its elements, and you use D flip flops since D flip flops are edge triggered devices. You could very well have a J-K register that uses J-K flip flops to store memory elements. Hope this helps.


It doesn't eventually go to 0, because the output doesn't get fed back in as an input. A D-register is needed in order to provide sensitivity to the rising edge of the clock since a combinational shifter/rotator isn't sensitive to it. On the rising edge the D-register will dump whatever it's holding into the shifter/rotator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜