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 #292 background imageLoading...
Page #292 background image
12-18 Instrument Control Library Series 2600 System SourceMeters Reference Manual
2600S-901-01 Rev. A / May 2006 Return to Section 12 topics
bit.test
Function Returns the Boolean value (true or false) of a bit at a given index position.
Usage
value = bit.test(value1, index)
value1 Given number.
index Index position of the bit to be tested (1 to 32).
value Returned decimal value of the bit.
Remarks
This function returns value, which is the result of the tested bit. The least significant
bit of the given number is at index 1. The most significant bit is at index 32.
Any fractional part of value1 will be truncated to make it an integer. If the indexed
bit for
value1 is set to 0, the returned value will be false. If the indexed bit for
value1 is set to 1, the returned value will be true.
If the index is bigger than the number of bits in value1, the result will be false.
See “Logic and bit operations” on page 12-13 for more information.
Also see bit.clear, bit.get, bit.getfield, bit.set, bit.setfield, bit.toggle
Example
The binary equivalent of decimal 10 is 1010. Testing the bit at index position 4 will
return a Boolean
value of true:
value = bit.test(10, 4)
print(value)
Output: true
bit.toggle
Function Toggles the value of a bit at a given index position.
Usage
value = bit.toggle(value1, index)
value1 Given number.
index Index position of the bit to be toggled (1 to 32).
value Returned value of the new number.
Remarks
This function returns value, which is the result of toggling a bit in value1.
Any fractional part of value1 is truncated to make it an integer. The returned
decimal
value is also an integer. The least significant bit of the given number is
index 1. The most significant bit is index 32.
The indexed bit for value1 is toggled from 0 to 1, or 1 to 0.
See “Logic and bit operations” on page 12-13 for more information.
Also see bit.clear, bit.get, bit.getfield, bit.set, bit.setfield, bit.test
Example
The binary equivalent of decimal 10 is 1010. Toggling the bit at index position 3 will
return a decimal
value of 14 (binary 1110).
value = bit.toggle(10, 3)
print(value)
Output: 1.400000e+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