Keithley SourceMeter 2600 Series Reference Manual page 287

Table of Contents

Advertisement

Series 2600 System SourceMeters Reference Manual
bit functions
Logic and bit operations
The bit functions are used to perform bitwise logic operations on two given numbers, and
bit operations on one given number. Logic and bit operations truncate the fractional part of
given numbers to make them integers.
NOTE
The TSP stores all numbers internally as single precision IEEE-754 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.
Logic operations – The
perform 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
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
• This function performs a logical AND operation on two numbers.
Remarks
• Any fractional parts of
The returned
• See
Also see
bit.bitor,
bit.bitand
parameter to "point" to the bit position of the given number. The
index
First number for the AND operation.
Second number for the AND operation.
Returned result of the AND operation.
value1
is also an integer.
value
"Logic and bit
operations" on
bit.bitxor
Return to
Instrument Control Library 12-13
,
and
bit.bitor
bit.bitxor
and
are truncated to make them integers.
value2
page 12-13
for more information.
Section 12 topics
functions in this group
2600S-901-01 Rev. A / May 2006

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents