Keithley 2601 Reference Manual page 271

System sourcemeter 2600 series (smu)
Hide thumbs Also See for 2601:
Table of Contents

Advertisement

Series 2600 System SourceMeter® Instruments Reference Manual
NOTE The TSP stores all numbers internally as single precision IEEE-754
Logic operations – The
logic operations on two numbers. The TSP will perform the indicated logic operation on the binary
equivalents of the two integers. Logic operations are performed bitwise. That is, bit 1 of the first
number is AND'ed, OR'ed or XOR'ed with bit 1 of the second number. Bit 2 of the first number is
AND'ed, OR'ed or XOR'ed with bit 2 of the second number. This bitwise logic operation is
performed on all corresponding bits of the two numbers. The result of a logic operation will be
returned as an integer.
Bit operations – The rest of the functions in this group are used for operations on the bits of a
given number. These functions can be used to clear a bit, toggle a bit, test a bit, set a bit (or bit
field) and retrieve the weighted value of a bit (or field value). All of these functions use an
parameter to "point" to the bit position of the given number. The least significant bit of a given
number has an index of 1, and the most significant bit has an index of 32.
bit.bitand
Function
Performs a bitwise logical AND operation on two numbers.
Usage
value = bit.bitand(value1, value2)
value1
value2
value
Remarks
• This function performs a logical AND operation on two numbers.
• Any fractional parts of value1 and value2 are truncated to make them integers. The
returned value is also an integer.
• See
"Logic and bit
Also see
bit.bitor,
bit.bitxor
Example
AND'ing decimal 10 (binary 1010) with decimal 9 (binary 1001) will return a value of decimal
8 (binary 1000):
value = bit.bitand(10, 9)
print(value)
Output: 8.000000e+00
bit.bitor
Function
Performs a bitwise logical OR operation on two numbers.
Usage
value = bit.bitor(value1, value2)
value1
value2
value
2600S-901-01 Rev. C / January 2008
floating point values. The internal number representation only stores
24 bits of numeric data. The logic operations will work correctly for all
integer values between 0 and 4294967295. However, only the 24
most significant bits will be stored for the return value.
,
bit.bitand
First number for the AND operation.
Second number for the AND operation.
Returned result of the AND operation.
operations" on
page 12-10
First number for the OR operation.
Second number for the OR operation.
Returned result of the OR operation.
Return to
Section Topics
and
bit.bitor
bit.bitxor
for more information.
Section 12: Instrument Control Library
functions in this group perform
index
12-11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

26362602261126122635

Table of Contents