EasyManuals Logo

Keithley SourceMeter 2602 Reference Manual

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

Table of Contents

Other manuals for Keithley SourceMeter 2602

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keithley SourceMeter 2602 and is the answer not in the manual?

Keithley SourceMeter 2602 Specifications

General IconGeneral
BrandKeithley
ModelSourceMeter 2602
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals