122-32000 Parallax Inc, 122-32000 Datasheet - Page 266

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
This would store the decoded value of
Bitwise Encode ‘
The Bitwise Encode operator encodes a 32-bit long value into the value (0 – 32) that
represents the highest bit set, plus 1. Bitwise Encode can be used in variable and integer
constant expressions, but not in floating-point constant expressions. Example:
PinNum := >|Pin
The above example sets
If
If
If
If
highest bit set.
Bitwise Shift Left ‘
The Bitwise Shift Left operator shifts the bits of the first operand left by the number of bits
indicated in the second operand. The original MSBs (leftmost bits) drop off and the new
LSBs (rightmost bits) are set to zero. Bitwise Shift Left can be used in both variable and
integer constant expressions, but not in floating-point constant expressions. Example:
X := Y << 2
If
...the Bitwise Shift Left operator would shift that value left by two bits, setting
Since the nature of binary is base-2, shifting a value left is like multiplying that value by
powers of two, 2
Bitwise Shift Left has an assignment form,
first operand and the result destination. For example,
X <<= 4 'Short form of X := X << 4
Page 266 · Propeller Manual v1.0
Pin
Pin
Pin
Y
Pin
started out as:
is %00000000 00000000 00000000 00000000,
is %00000000 00000000 00000000 10000000,
is %10000000 00000000 00000000 00000000,
is %00000000 00010011 00010010 00100000,
%10000000 01110000 11111111 00110101
%00000001 11000011 11111100 11010100
b
, where b is the number of bits shifted.
>|
<<
’, ‘
PinNum
<<=
equal to the number of the highest bit set in
PinNum
<<=
back into
, that uses the variable to its left as both the
PinNum
PinNum
PinNum
PinNum
PinNum
is set equal to 0; no bits are set.
is set equal to 8; bit 7 is set.
is set equal to 32; bit 31 is set.
.
is set equal to 21; bit 20 is the
Pin
X
, plus 1.
to:

Related parts for 122-32000