National-instruments AutoCode NI MATRIX Manual de usuario Pagina 54

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 250
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 53
Chapter 2 C Language Reference
© National Instruments Corporation 2-37 AutoCode Reference
Figure 2-7. AutoCode/C Conversion Macros for Fixed-to-Integer Conversions
For example, the macro to convert an unsigned 8-bit number to an integer
number with a shift of
rp bits, and with overflow protection is:
iALIGNubp(n,rp)
Figure 2-8. AutoCode/C Conversion Macros for Integer-to-Fixed Conversions
For example, the macro to convert an integer number to a signed 8-bit
number with a shift of
rp bits, and with overflow protection is:
sbALIGNip(n,rp)
n = Fixed-point operand to align
i ALIGN so wo p (n, rp)
rp = Number of bits to shift
p = Overflow protection (optional)
wo = Operand wordsize (b=byte, s=short, l=long)
so = Operand sign (u=unsigned, s=signed)
ALIGN (indicates conversion)
i = Indicates integer result
(if rp < 0, perform a left-shift;
if rp > 0, perform a right-shift)
n = Fixed-point operand to align
sr wr ALIGN i p (n, rp)
rp = Number of bits to shift
p = Overflow protection (optional)
i = Indicates integer input
ALIGN (indicates conversion)
wr = Result wordsize (b=byte, s=short, l=long)
sr = Result sign (u=unsigned, s=signed)
(if rp < 0, perform a left-shift;
if rp > 0, perform a right-shift)
Vista de pagina 53
1 2 ... 49 50 51 52 53 54 55 56 57 58 59 ... 249 250

Comentarios a estos manuales

Sin comentarios