Keithley SourceMeter 2600 Series Reference Manual page 291

Table of Contents

Advertisement

Series 2600 System SourceMeters Reference Manual
• This function returns
Remarks
must be a value between 1 and 32. The least significant bit of the given number has
an index of 1 and the most significant bit has an index of 32.
• Any fractional part of
• See
Also see
bit.clear, bit.get, bit.getfield, bit.setfield, bit.test,
Example
The binary equivalent of decimal 8 is 1000. If the bit at
value
value = bit.set(8, 3)
print(value)
Output:
bit.setfield
Function
Overwrites a bit field at a given index position.
Usage
value = bit.setfield(value1, index, width, fieldvalue)
value1
index
width
width
fieldvalue
value
• This function returns
Remarks
at the given
bit of the given field. The
value given by
and the most significant bit has an index of 32.
• Prior to setting the field of bits, any fractional parts of
be truncated to make them integers.
• If the
fieldvalue
binary value for
fieldwidth
fieldvalue
• See
Also see
bit.clear, bit.get, bit.getfield, bit.set, bit.test,
The binary equivalent of decimal 15 is 1111. After overwriting it with a decimal 5
Example
(binary 101) at index position 2, the returned
value = bit.setfield(15, 2, 3, 5)
print(value)
Output:
value
value1
"Logic and bit
operations" on
will be decimal 12 (binary 1100):
1.200000e+01
Given number.
Index position of the least significant bit of the field; 1 to (33 –
).
Field width – number of bits in the field; 1 to 24.
Value to write to the field.
Returned value of the new number.
value
position. The
index
width
fieldvalue
is wider than the
fieldvalue
will be truncated. For example, assume the
fieldwidth
will be truncated, and a binary value of 1110 will be used as the
.
"Logic and bit
operations" on
1.100000e+01
Return to
Instrument Control Library 12-17
, which is
with the indexed bit set. The
value1
will be truncated to make it an integer.
page 12-13
for more information.
bit.toggle
, which is
with a field of bits overwritten, starting
value1
specifies the position of the least significant
index
bits starting at the given index will be set to the
. The least significant bit in
, the extra most significant bits of the
width
is 11110 (5 bits). The most significant bit of
page 12-13
for more information.
bit.toggle
will be decimal 11 (binary 1011):
value
Section 12 topics
3 is set to 1, the returned
index
has an index of 1
value1
and
value1
fieldvalue
is 4 bits, and the
width
2600S-901-01 Rev. A / May 2006
index
will

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents