SHIFT - Shift/Rotates Bits (original) (raw)

Scilab 5.3.3

Please note that the recommended version of Scilab is 2026.0.1. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Xcos > palettes > Integer palette > SHIFT

Block Screenshot

Contents

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 that can be normal or cycle by setting the Shift Type parameter to 0 or 1. The number and the direction of the shifts are set with the Number of Bits to Shift Left. If this number is positive the input is shifted to the left, otherwise it is shifted to the right.

When the Shift Type parameter is :

The shift register makes a multiplication by 2n (arithmetic left shift) or an integer division by 2n (arithmetic right shift), where n is the number of bit shifts. It can also be used to serialize data or to create a memory buffer.

Data types

The block supports the following types :

Dialog box

Default properties

Example

In this example the Super block is a binary counter with 3 bits output. In order to obtain the corresponding decimal value, the outputs Q1 and Q2 of the counter are respectively shifted left of one bit and of two bits. Finally the Q0 output, and the shifted outputs are added.

To better see the output change, set the parameter Real Time Scale to 0.5 in the Settings menu item of the Simulation menu.Open this example in Xcos

Below the details of the binary counter.

Computational function

Authors

Fady NASSIF - INRIA