Fixed-Point Blockset    

Generating Pure Integer Code

All blocks generate pure integer code except for the FixPt Gateway In, FixPt Gateway In Inherited, and FixPt Gateway Out blocks. These blocks must generate floating-point code when handling floating-point input or output. However, if the input or output is an integer and the block is configured to treat the input or output as a stored integer, then these blocks will also generate pure integer code.

Example: Generating Pure Integer Code

This example outlines the steps you should take when generating pure integer code for your Fixed-Point Blockset model. The steps follow the description in the fxpdemo_code_only demo, which includes the model shown below.

  1. Copy the fixed-point portion of your model to a new model.

    If your original model includes blocks that represent hardware, analog systems, and other blocks not related to embedded software, then you must create a new model. This new model contains only the fixed-point portion, which represents the software that will be running on the fixed-point processor. For example, the digital controller subsystem shown above contains the fixed-point blocks from the fxpdemo_feedback model used for code generation.

  1. Insert FixPt Gateway In blocks, as needed.
  2. Insert FixPt Gateway Out Blocks, as needed.
  3. Configure the simulation parameters.

 Code Generation Support Using the Simulink Accelerator