Functions
SHIFT_DATA_LEFT

Overview

The SHIFT_DATA_LEFT procedure call is used to shift input data (std_logic or std_logic_vector) to the left by a specified number of bits. For std_logic type inputs, left shifting is typically used for serial to parallel conversion and NUM_BITS is set to 1. Internally, the shifting is performed by using a framework shift register. When the optional shift_enable parameter is asserted to logic '1', the input data will be padded on the right side by zeros and the shifted data will be available after 1 clock cycle on the state_reg_rec(M).shift_left register.

The SHIFT_DATA_LEFT procedure call is most often used in conjunction with either the CONFIGURE_COUNTER or TRANSITION procedure call inside the same state of a state machine. This is because shifting procedures are incapable of counting the total number of bits shifted and cannot schedule a state machine transition on their own. When a shifter is used in conjunction with a counter, the counter value.done signal is used as the shift_enable and the counter schedules a state machine once the desired number of bits are shifted.

The data width of shift_left register is set by data_width parameter inside the config_file and any input data placed on data_in must be less than or equal to data_width bits minus NUM_BITS. This is because left shifted data will grow larger than the input data by NUM_BITS due to padding zeros on the right. In order to be flexible, the SHIFT_DATA_LEFT is procedure call is overloaded to perform some operations that are somewhat related to shifting but do not cause the initial bit width to grow to the left. If the option parameter is set to 'rotate', the data_in the bits will be rotated to the left by NUM_BITS. If the BIT_OPTION parameter is set to reverse_bits, then the SHIFT_DATA_LEFT procedure will perform a bit reversal of data_in instead of a shift.

Usage Example

Todo:
Add Example Usage

Example API Call(s):

SHIFT_DATA_LEFT( input_vector, 8, next_state_rec, state_reg_rec );
SHIFT_DATA_LEFT( input_vector, 8, next_state_rec, state_reg_rec, rotate );

Call Data [ 6 parameters (4 mandatory) ]

Parameters
[in]data_in[1] input data to be shifted
[in]NUM_BITS/BIT_OPTION[2] number of elements to shift the input data or (reverse_bits|zero_pad|sign_extend)
[out]next_state_rec[3]
[in]state_reg_rec[4]
[in]shift_enable[5] enable signal for the shifter
[in]shift_option/START_INDEX[6] Option to enable or rotate data_in (optional) (<std_logic>|rotate)

Return Data

Parameters
[in]state_reg_rec(M).shift_left: [1] [std_logic_vector] registered shifted data

Command Reference

Voice and Hotkey Commands:

See also
Shift Data Left Command

Command Parameter Mapping

Parameters
[in]data_in[1] "data <std_logic_vector>"
[in]NUM_BITS/BIT_OPTION[2] "count <integer>" or "shift <integer>"
[out]next_state_rec[3]
[in]state_reg_rec[4]
[in]shift_enable[5] "enable (<std_logic> )"
[in]shift_option/START_INDEX[6] "option rotate"

Command Return Data

Parameters
[in]state_reg_rec(M).shift_left: [1] [std_logic_vector] "left shift"

Voice/HotKey Command Sequence

SHIFT_DATA_LEFT( srr.fifo_data, 4, next_state_rec, state_reg_rec );

Voice Command HotKey Sequence
"shift data left" sdl
"shift eight" shift 8

Notes and Warnings

Note
1) The caller of SHIFT_DATA_LEFT is required to extract the range of bits that it is expecting from a subset of shift_left(data_width -1 downto 0).
2) When BIT_OPTION is specified instead of NUM_BITS, the SHIFT_DATA_LEFT procedure does not perform a shift, instead the shift_left register will reflect the requested bit operation.

See also
RESET_LEFT_SHIFTER
SHIFT_DATA_RIGHT

Procedures

  SHIFT_DATA_LEFT(
data_in: std_logic_vector
NUM_BITS: natural
signal next_state_rec: out NSR
state_reg_rec: in SRR
shift_enable: std_logic ' 1 '
shift_option: SHIFT_TYPE NORMAL_SHIFT
)
  SHIFT_DATA_LEFT(
data_in: std_logic_vector
NUM_BITS: natural
signal next_state_rec: out NSR_ARRAY
state_reg_rec: in SRR_ARRAY
shift_enable: std_logic ' 1 '
shift_option: SHIFT_TYPE NORMAL_SHIFT
)
 overloaded for rotate array interface. Optional enable or SHIFT_TYPE