Keithley 2601 Reference Manual page 273

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

Advertisement

Series 2600 System SourceMeter® Instruments Reference Manual
Usage
value = bit.get(value1, index)
value1
index
value
Remarks
• This function returns the value of the bit in value1 at the given index. This is the same
as returning value1 with all other non-indexed bits set to zero.
• Prior to retrieving the indexed bit, 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.
• If the indexed bit for the number is set to 0, the result will be 0.
• See
"Logic and bit
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: 8.000000e+00
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
Remarks
• A field of bits is a contiguous group of bits. This function retrieves a field of bits from
value1 starting at the given index position. The index position is the least significant
bit of the retrieved field. The number of bits to return is given by width.
• 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
"Logic and bit
Also see
bit.clear, bit.get, bit.set, bit.setfield, bit.test,
The binary equivalent of decimal 13 is 1101. The field at index2 and width3
Example
consists of the binary bits 110. The returned
value = bit.getfield(13, 2, 3)
print(value)
Output: 6.000000e+00
bit.set
Function
Sets a bit at a given index position.
Usage
value = bit.set(value1, index)
value1
index
value
Remarks
• This function returns value, which is value1 with the indexed bit set.
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 value1 will be truncated to make it an integer.
• See
"Logic and bit
Also see
bit.clear, bit.get, bit.getfield, bit.setfield, bit.test,
2600S-901-01 Rev. C / January 2008
Given number.
Index position of the bit to be retrieved (1 to
32).
Returned weighted value of the bit.
operations" on
page 12-10
8:
value
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.
operations" on
page 12-10
Given number.
Index position of the bit to be set (1 to 32).
Returned value of the new number.
operations" on
page 12-10
Return to
Section Topics
for more information.
bit.toggle
for more information.
bit.toggle
will be decimal 6 (binary 110):
value
for more information.
bit.toggle
Section 12: Instrument Control Library
).
width
The
m
ust
index
12-13

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

26362602261126122635

Table of Contents