This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Difference between revisions of "Left rotation"
[unchecked revision] | [unchecked revision] |
Line 4: | Line 4: | ||
{|class="cannytable" width="350px" | {|class="cannytable" width="350px" | ||
|- | |- | ||
− | !colspan="2" style="background-color:#AFEEEE;"| | + | !colspan="2" style="background-color:#AFEEEE;"|Appearance |
|- | |- | ||
− | |colspan="2" align="center" style="padding:10px;"|[[Изображение: | + | |colspan="2" align="center" style="padding:10px;"|[[Изображение:5_4_5_2.png]] |
|- | |- | ||
− | !colspan="2" style="background-color:#AFEEEE;"| | + | !colspan="2" style="background-color:#AFEEEE;"|Symbol |
|- | |- | ||
|colspan="2" align="center"|RSL | |colspan="2" align="center"|RSL | ||
|- | |- | ||
− | !colspan="2" style="background-color:#AFEEEE;"| | + | !colspan="2" style="background-color:#AFEEEE;"|Group |
|- | |- | ||
− | |colspan="2" align="center"|[[Built-in Function Blocks | Bitwise | + | |colspan="2" align="center"|[[Built-in Function Blocks#Bitwise operators | Bitwise operators]] |
|- | |- | ||
− | !colspan="2" style="background-color:#AFEEEE;"| | + | !colspan="2" style="background-color:#AFEEEE;"|Inputs |
|- | |- | ||
− | |style="padding-left:1em;"| | + | |style="padding-left:1em;"|Value: |
− | |style="padding-left:1em;"|[[ | + | |style="padding-left:1em;"|[[CFD Language#Data|Integer]] |
|- | |- | ||
− | |style="padding-left:1em;"| | + | |style="padding-left:1em;"|Shift, bits: |
− | |style="padding-left:1em;"|[[ | + | |style="padding-left:1em;"|[[CFD Language#Data|Integer]] |
|- | |- | ||
− | !colspan="2" style="background-color:#AFEEEE;"| | + | !colspan="2" style="background-color:#AFEEEE;"|outputs |
|- | |- | ||
− | |style="padding-left:1em;"| | + | |style="padding-left:1em;"|Result: |
− | |style="padding-left:1em;"|[[ | + | |style="padding-left:1em;"|[[CFD Language#Data|Integer]] |
|- | |- | ||
− | !colspan="2" style="background-color:#AFEEEE;"| | + | !colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]] |
|- | |- | ||
− | |colspan="2" align="center"| | + | |colspan="2" align="center"|from 1.8b |
|} | |} | ||
</div> | </div> | ||
Line 99: | Line 99: | ||
[[Right rotation]] | [[Right rotation]] | ||
− | [[ | + | [[Built-in_Function_Blocks | Built-in Function Blocks]] |
Revision as of 21:29, 19 November 2015
Appearance | |
---|---|
Изображение:5_4_5_2.png | |
Symbol | |
RSL | |
Group | |
Bitwise operators | |
Inputs | |
Value: | Integer |
Shift, bits: | Integer |
outputs | |
Result: | Integer |
Version CANNY Lab | |
from 1.8b |
Logical shift to the left. Set the output result as the logical left shift in binary representation of the input "Value", the number of bits to shift specified by the input "Shift, bit", while leaving bit appears in place of free pop spot on the other end of the number .
In other words, the result is equivalent to the result of copying each bit in binary representation of input "value" to its left position, to the number of times specified by the value of the input "Shift, bit". Thus, least significant (right-most) bit in the binary representation each time will have a value equal to the outgoing (most significant, extending to the left) bit of input value.
For example:
Value | = | 51000 | = | 0xC738 | = | 0b1100011100111000 |
Shift, bit | = | 2 | ||||
Result | = | 7395 | = | 0x1CE3 | = | 0b0001110011100011 |
Features
Cyclic shift of 16-bit value in either direction for 8-bit, reverses its upper and lower bytes.
Examples
thumb|400px|Десятичное представление | thumb|500px|Десятичное представление |