Bit.get() - Keithley 708B Reference Manual

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Section 7: Command reference
Details
Any fractional part of value is truncated to make it an integer. The returned result is also an integer.
The least significant bit of value is at index position 1; the most significant bit is at index position 32.
Example
myResult = bit.clear(15, 2)
print(myResult)
Also see

bit.get()

(on page 7-12)
bit.set()
(on page 7-14)
bit.test()
(on page 7-16)
bit.toggle()
(on page 7-17)
Logical operators
bit.get()
This function retrieves the weighted value of a bit at a specified index position.
Type
TSP-Link accessible
Function
No
Usage
result = bit.get(value, index)
result
value
index
Details
This function returns the value of the bit in value at index. This is the same as returning value with all other
bits set to zero (0).
The least significant bit value is at index position 1; the most significant bit is at index position 32.
If the indexed bit for the number is set to zero (0), the result will be zero (0).
Example
myResult = bit.get(10, 4)
print(myResult)
7-12
(on page 6-22)
Affected by
Result of the bit manipulation
Specified number
One-based bit position within value to get (1 to 32)
Models 707B and 708B Switching Matrix Reference Manual
The binary equivalent of decimal 15 is 1111. If you
clear the bit at index position 2, the returned
decimal value is 13 (binary 1101).
Output: 1.3000000e+01
Where saved
Default value
The binary equivalent of decimal 10 is 1010. If you
get the bit at index position 4, the returned decimal
value is 8.
Output: 8.0000000e+00
707B-901-01 Rev. A / August 2010

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents