This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Difference between revisions of "Right rotation"
(Created page with " <div style="float:right;margin:5px;"> {|class="cannytable" width="350px" |- !colspan="2" style="background-color:#AFEEEE;"|Внешний вид |- |colspan="2" align="cent...") |
|||
(6 intermediate revisions by 3 users not shown) | |||
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;"|[[File:5_4_8_2.png]] |
|- | |- | ||
− | !colspan="2" style="background-color:#AFEEEE;"| | + | !colspan="2" style="background-color:#AFEEEE;"|Symbol |
|- | |- | ||
|colspan="2" align="center"|RSR | |colspan="2" align="center"|RSR | ||
|- | |- | ||
− | !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 37: | Line 37: | ||
<div style="min-height:100%;display:block;"> | <div style="min-height:100%;display:block;"> | ||
<div style="float:left;width:70px;"> | <div style="float:left;width:70px;"> | ||
− | [[ | + | [[File:5_4_8_1.png|left|Icon]] |
</div> | </div> | ||
<div> | <div> | ||
− | + | Circular shift to the right. Set the output result as the logical right shift in binary representation of the input "Value", the number of bits to shift specified by the input "Shift, bits", while leaving bit appears in place of free pop spot on the other end of the number. | |
</div> | </div> | ||
</div> | </div> | ||
<br clear="left"> | <br clear="left"> | ||
− | In other words, the result is equivalent to the result of copying each bit in binary representation of input "value" to its | + | In other words, the result is equivalent to the result of copying each bit in binary representation of input "value" to its right position, to the number of times specified by the value of the input "Shift, bits". Thus, the most significant (left-most) bit in the binary representation each time will have a value equal to the outgoing (least significant, extending to the right) bit of input value. |
− | + | ||
− | + | For example: | |
{|border="0" style="border-collapse:collapse;" | {|border="0" style="border-collapse:collapse;" | ||
|- | |- | ||
− | |style="padding:5px;"| | + | |style="padding:5px;"|Value |
|style="padding:5px;"|= | |style="padding:5px;"|= | ||
|style="padding:5px;"|51000 | |style="padding:5px;"|51000 | ||
Line 60: | Line 59: | ||
|style="padding:5px;"|0b1100011100111000 | |style="padding:5px;"|0b1100011100111000 | ||
|- | |- | ||
− | |style="padding:5px;"| | + | |style="padding:5px;"|Shift, bits |
|style="padding:5px;"|= | |style="padding:5px;"|= | ||
|align="center"|2 | |align="center"|2 | ||
|align="center"| | |align="center"| | ||
|- | |- | ||
− | |style="padding:5px;"| | + | |style="padding:5px;"|Result |
|style="padding:5px;"|= | |style="padding:5px;"|= | ||
|style="padding:5px;"|12750 | |style="padding:5px;"|12750 | ||
Line 74: | Line 73: | ||
|} | |} | ||
− | == | + | == Features == |
− | + | Circular shift of 16-bit value in either direction for 8-bit, reverses its upper and lower bytes. | |
− | == | + | == Examples == |
{| | {| | ||
− | |[[ | + | |[[File:5_4_8_3.png|thumb|400px|As decimal]] |
− | |[[ | + | |[[File:5_4_8_4.png|thumb|500px|As binary]] |
|} | |} | ||
− | == | + | == See also == |
− | [[ | + | [[Bitwise AND]] |
− | [[ | + | [[Bitwise OR]] |
− | [[ | + | [[Bitwise exclusive OR]] |
− | [[ | + | [[Bitwise Inversion]] |
− | [[ | + | [[Right shift]] |
− | [[ | + | [[Left shift]] |
− | [[ | + | [[Left rotation]] |
− | [[ | + | [[Built-in_Function_Blocks | Built-in Function Blocks]] |
Latest revision as of 18:31, 23 November 2015
Appearance | |
---|---|
Symbol | |
RSR | |
Group | |
Bitwise operators | |
Inputs | |
Value: | Integer |
Shift, bits: | Integer |
outputs | |
Result: | Integer |
Version CANNY Lab | |
from 1.8b |
Circular shift to the right. Set the output result as the logical right shift in binary representation of the input "Value", the number of bits to shift specified by the input "Shift, bits", 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 right position, to the number of times specified by the value of the input "Shift, bits". Thus, the most significant (left-most) bit in the binary representation each time will have a value equal to the outgoing (least significant, extending to the right) bit of input value.
For example:
Value | = | 51000 | = | 0xC738 | = | 0b1100011100111000 |
Shift, bits | = | 2 | ||||
Result | = | 12750 | = | 0x31CE | = | 0b0011000111001110 |
Features
Circular shift of 16-bit value in either direction for 8-bit, reverses its upper and lower bytes.