Search code examples
vhdl

What does SHR stand for in VHDL and how do you use it to shift to a number of bits


What does the "SHR" stand for, am i right to assume that in "VHDL" it means shift to the right by 16 bits? My second question is how would i shift this to the right by 10 bits or to be honest by any btis


Solution

  • It stands for shift right/left. It shifts for the specified amount of bits, not a constant 16 as you assumed.

    These functions are defined for signed and unsigned. The problem is, it is defined in the library IEEE.std_logic_arith, which is not part of the VHDL standard. The equivalent standard library is IEEE.numeric_std, which defines shift_left and shift_right.

    As MTCoster suggested, you can look up this question.