SHIFT

Scicos Block
fr - eng

##
SHIFT Shift Bits

### Contents

- SHIFT Shift Bits
  - Palette
  - Description
  - Dialog box
  - Default properties
  - Interfacing function
  - Computational function
  - See also
  - Authors

### Palette

- Integer - Integer palette

### Description

This block shifts the bits of the input signal. In this operation the digits are moved to the right or to the left. The user can choose the rule to shifts the bits. It can be normal or cycle by setting the "Shifttype" parameter to "0" or "1".
When the Shifttype is 0, an arithmetic shift is applied to the input signal. In this case, the bits that are shifted out of either end are discarded. Zeros are shifted in on the right, in the case of left shift; in the case of right shifts, copies of the sign bit is shifted in on the left.
When the "Shifttype" is 1,a circular shift is applied to the input signal. In this case, the bits are rotated as if the left and right ends of the register are joined. The value that is shifted in on the right during a left-shift is whatever values was shifted out on the left, and vice versa.

### Dialog box

- Datatype (3=int32 4=int16 5=int8 ...)
  It indicates the type of the input/output data. It support all the integer datatype, number must be between 3 and 8.
  Properties : Type 'vec' of size 1.

- Number of bits to shift left (use negative number to shift right)
  It indicates the number of bits the input signal is shifted. A positive value indicates a shift left, negative values indicates shift right.
  Properties : Type 'vec' of size 1.

- Shifttype(0=Arithmetic 1=Circular)
  It indicate the rule used to shift the bits. It can be arithmetic or circular. When the Shifttype is normal, an arithmetic shift is applied to the input signal. In this case, the bits that are shifted.
  Properties : Type 'vec' of size 1.

### Default properties

- always active: no
- direct-feedthrough: yes
- zero-crossing: no
- mode: no
- regular inputs:
  - port 1 : size [-1,-2] / type 3
- regular outputs:
  - port 1 : size [-1,-2] / type 3
- number/sizes of activation inputs: 0
- number/sizes of activation outputs: 0
- continuous-time state: no
- discrete-time state: no
- object discrete-time state: no
- name of computational function: shift_32_LA

### Interfacing function

- SCI/macros/scicos_blocks/IntegerOp/SHIFT.sci [view code]

### Computational function

- SCI/routines/scicos/shift_32_LA.c [view code]
- SCI/routines/scicos/shift_32_LC.c [view code]
- SCI/routines/scicos/shift_32_RA.c [view code]
- SCI/routines/scicos/shift_u32_RA.c [view code]
- SCI/routines/scicos/shift_32_RC.c [view code]
- SCI/routines/scicos/shift_16_LA.c [view code]
- SCI/routines/scicos/shift_16_LC.c [view code]
- SCI/routines/scicos/shift_16_RA.c [view code]
- SCI/routines/scicos/shift_u16_RA.c [view code]
- SCI/routines/scicos/shift_16_RC.c [view code]
- SCI/routines/scicos/shift_8_LA.c [view code]
- SCI/routines/scicos/shift_8_LC.c [view code]
- SCI/routines/scicos/shift_8_RA.c [view code]
- SCI/routines/scicos/shift_u8_RA.c [view code]
- SCI/routines/scicos/shift_8_RC.c [view code]

### See also

- BITSET - BITSET Set a Bit (Scicos Block)
- BITCLEAR - BITCLEAR Clear a Bit (Scicos Block)

### Authors

Fady NASSIF INRIA