O'Reilly logo

Verilog Designer’s Library by Cupertino CA Bob Zeidman - Zeidman Consulting

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7 The Shift Register

A shift register is another common building block for many designs. In this chapter, we look at an 8-bit barrel shifter that can shift any number of bits either left or right. This function can be useful for aligning microprocessor buses of different sizes.

7.1 Behavioral Code

The following behavioral code makes use of the fact that the load input takes priority over the other control inputs. An always block is used to look for changes in the load input. If the load input is asserted, the always block is executed, which then looks for the next rising clock edge. If the load input is still asserted at the clock edge, it forces the output to the value of the input. If the load gets deasserted, the always block will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required