return signed/unsigned <= shift_right/ shift_left (arg:
signed/unsigned; count: natural);
There are two types of shifts:
1- Logical
2- Arithmetic.
A logical
shift means that the new bits are replaced with zeros.
An Arithmetic
shift means that the replaced bits are substituted in order to maintain the sign of the original number.
* Shift functions are found in numeric_std
package file
* Type of shift depends on input to
function. Unsigned=Logical, Signed=Arithmetic
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library
declaration if using
-- arithmetic functions with Signed or
Unsigned values
use IEEE.NUMERIC_STD.ALL;
...
std_logic_vector <=
std_logic_vector(shift_right/shift_left (unsigned/signed (std_logic_vector), to_integer(unsigned(std_logic_vector))));
...