National-instruments AutoCode NI MATRIX Manuel d'utilisateur Page 54

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 250
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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)
Vue de la page 53
1 2 ... 49 50 51 52 53 54 55 56 57 58 59 ... 249 250

Commentaires sur ces manuels

Pas de commentaire