Keithley SourceMeter 2600 Series Reference Manual page 290

Table of Contents

Advertisement

12-16 Instrument Control Library
Also see
bit.clear, bit.getfield, bit.set, bit.setfield, bit.test,
The binary equivalent of decimal 10 is 1010. Getting the bit at index position 4 will
Example
return decimal
value = bit.get(10, 4)
print(value)
Output:
bit.getfield
Function
Returns a field of bits starting at a given index position.
Usage
value = bit.getfield(value1, index, width)
value1
index
width
value
• A field of bits is a contiguous group of bits. This function retrieves a field of bits from
Remarks
value1
significant bit of the retrieved field. The number of bits to return is given by
• Prior to retrieving the field of bits, any fractional part of the given number will be
truncated to make it an integer.
• The least significant bit of the given number has an index of 1 and the most
significant bit has an index of 32.
• See
Also see
bit.clear, bit.get, bit.set, bit.setfield, bit.test,
Example
The binary equivalent of decimal 13 is 1101. The field at
of the binary bits 110. The returned
value = bit.getfield(13, 2, 3)
print(value)
Output:
bit.set
Function
Sets a bit at a given index position.
Usage
value = bit.set(value1, index)
value1
index
value
2600S-901-01 Rev. A / May 2006
8:
value
8.000000e+00
Given number.
Index position of the first bit; 1 to (33 –
Field width – number of bits to be included in the field; 1 to 24.
Returned value of the bit field.
starting at the given
"Logic and bit
operations" on
6.000000e+00
Given number.
Index position of the bit to be set (1 to 32).
Returned value of the new number.
Return to
Series 2600 System SourceMeters Reference Manual
bit.toggle
position. The
index
index
page 12-13
for more information.
bit.toggle
will be decimal 6 (binary 110):
value
Section 12 topics
).
width
position is the least
width
2 and
3 consists
index
width
.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents