Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual Manual de usuario Pagina 48

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 82
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 47
Chapter 11: Primitives File-based Decoding User Manual
42 LeCroy Corporation
PeekNBits()
PeekNBits(<bit_count integer>)
Parameter Meaning
Default
Value Comments
bit_count in
teger
Support
Supported by all LeCroy analyzers.
Return value
None.
Comments
Reads bit_count bits from the data source. The difference between PeekNBits and
NextNBits is that PeekNBits does not advance the global bit offset. PeekNBits can
b
e used to make decisions about how to parse the next fields without affecting
subsequent calls to NextNBits. If PeekNBits is called without a prior call to
GetNBits, the result is undefined. No
te that bits are indexed starting at bit 0.
Example
raw = 'F0F0';# 1111000011110000 binary
result1 = GetNBits ( raw, 2, 4 );
result2 = PeekNBits(5);
result3 = NextNBits(2);
This results in:
result1 == C
result2 == 7
result3 == 0
A call to GetNBits, starting at bit 2, reads 4 bits (1100), and returns the value 0xC.
A call to PeekNBits, starting at bit 6, reads 5 bits (00111), and returns the value 0x7.
A call to NextNBits, starting at bit 6, reads 2 bits (00), and returns the value 0x0.
Vista de pagina 47
1 2 ... 43 44 45 46 47 48 49 50 51 52 53 ... 81 82

Comentarios a estos manuales

Sin comentarios