C Fixed-Point Arithmetic; Fixed-Point Autocode/C Implementation - National Instruments AutoCode NI MATRIX Reference

National instruments ni matrixx reference manual
Table of Contents

Advertisement

Chapter 2
C Language Reference

C Fixed-Point Arithmetic

The SystemBuild User Guide has a fixed-point arithmetic chapter that explains the
Note
basics of fixed-point arithmetic and the use of fixed-point arithmetic in SystemBuild
models.

Fixed-Point AutoCode/C Implementation

AutoCode Reference
data-typed variables reflecting each subsystem input signal and type.
The outputs to the subsystem are provided by the argument
to a structure named
_Subsys_ number _out
data-typed variables reflecting each subsystem output signal and type.
The following overall steps need to be taken to invoke the subsystem
function:
1.
Create an object of type
code) and copy in the inputs to the subsystem. A pointer to this object
will be passed as argument
2.
Create an object of type
subsystem will be stored. A pointer to this object will be passed as
argument
to the subsystem.
Y
3.
Invoke the procedure using pointers to the objects created in steps 1
and 2.
Fixed-point calculations provide significant advantages over floating-point
arithmetic. These include:
Faster execution on most processors
8-bit, 16-bit, and 32-bit representations of fixed-point numbers
Ability to interface to inexpensive processors that do not support
floating-point arithmetic
This section describes the implementation of fixed-point arithmetic in
AutoCode/C.
SystemBuild lets you represent vectors as fixed-point signals to which
fixed-point arithmetic will be applied. Refer to the SystemBuild User
Guide. Fixed-point signals and numbers are represented in AutoCode/C
as integer data types. An associated radix position—that is, the integer
marking the point that divides the integer and fractional part of the
_Subsys_1_in
to the subsystem.
U
_Subsys_1_out
2-26
, a pointer
Y
. This structure has mixed
(see generated subsystem
where the outputs of the
ni.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AutoCode NI MATRIX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Autocode ni matrixx

Table of Contents