Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual Bedienungsanleitung Seite 46

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 82
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 45
Chapter 11: Primitives File-based Decoding User Manual
40 LeCroy Corporation
GetNBits()
GetNBits (<bit_source list or raw>,
<bit_offset integer>, <bit_count integer>)
Parameter Meaning
Default
Value Comments
bit_source li
st, raw,
or integer
Can be an integer value (4 bytes) or a list of
integers that are interpreted as bytes.
bit_offset in
teger Index of bit to start
reading from
bit_count integer Number of bits to
read
Support
Supported by all LeCroy analyzers.
Return value
None.
Comments
Reads bit_count bits from bit_source starting at bit_offset. Returns null if
bit_offset + bit_count exceeds the number of bits in bit_source. If bit_count
is 32 or
less, the result is returned as an integer. Otherwise, the result is returned in a list
format that is the same as the input format. GetNBits also sets up the bit data source
an
d global bit offset used by NextNBits and PeekNBits.
Note that bits are indexed
starting at bit 0.
Example
raw = 'F0F0'; # 1111000011110000 binary
result = GetNBits ( raw, 2, 4 );
The return value is given in hexadecimal, so in binary it is 1100.The function returns:
C
A call to GetNBits, starting at bit 2, reads 4 bits (1100), and returns the value 0xC.
Seitenansicht 45
1 2 ... 41 42 43 44 45 46 47 48 49 50 51 ... 81 82

Kommentare zu diesen Handbüchern

Keine Kommentare