Code Generation Support


All fixed-point blocks support code generation, except particular simulation features. The sections that follow describe the code generation support that the Fixed-Point Designer™ software provides. You must have a Simulink® Coder™ license to generate C code or a HDL Coder™ license to generate HDL code.


C code generation is supported.

Data Types

Fixed-point code generation supports all integer and fixed-point data types that are supported by simulation. See Supported Data Types.

Rounding Modes

All rounding modes—Ceiling, Convergent, Floor, Nearest, Round, Simplest, and Zero —are supported.

Overflow Handling

  • Saturation and wrapping are supported.

  • Wrapping generates the most efficient code.

  • Currently, you cannot choose to exclude saturation code automatically when hardware saturation is available. Select wrapping in order for the Simulink Coder product to exclude saturation code.


All blocks generate code for all operations with a few exceptions. The Lookup Table Dynamic block generates code for all lookup methods except Interpolation-Extrapolation.


Any binary-point-only scaling and [Slope Bias] scaling that is supported in simulation is supported, bit-true, in code generation.

Was this topic helpful?