getting started with single precision converter -凯发k8网页登录

main content

getting started with single precision converter

the single precision converter converts your model or a system in your model from double precision to single precision. to open the single precision converter, from the simulink® apps tab, select single precision converter.

select system under design

to begin, expand the system under design drop-down list and select the system to convert to single precision.

check compatibility

to start the conversion, click convert to single.

the single precision converter performs these checks:

  • check that all blocks in the selected system support single precision.

    the single precision converter displays a list of blocks that do not support single precision or are locked against changes by the fixed-point tools. to restart the conversion, replace the blocks that support only double precision and unlock the blocks that are locked against changes by the fixed-point tools. then click convert to single.

  • check that the system uses a library standard that supports single-precision designs.

    to convert a system to single precision, the language standard must be set to c99 (iso). if the specified language standard is not set to c99, the single precision converter changes the math library.

  • check that the solver settings are set to fixed step.

convert

following the compatibility check, the single precision converter converts the system to single-precision. the converter makes these changes:

  • conversion of user-specified double-precision data types to single-precision data types (applies to block settings, stateflow® chart settings, signal objects, and bus objects).

  • when the system under design contains a matlab® function block, the converter creates a variant subsystem containing a generated single-precision version of the matlab function block and the original matlab function block.

  • output signals and intermediate settings using inherited data types that compile to double-precision change to single-precision data types.

the converter does not change boolean, built-in integer, or user-specified fixed-point data types. when the conversion is finished, the converter displays a table summarizing the compiled and proposed data types of the objects in the system under design.

verify

finally, the single precision converter verifies that the model containing the converted system can successfully update the diagram. if the model is not able to update the diagram due to data type mismatch errors at the system boundaries, the single precision converter displays a message.

to resolve the data type mismatch, insert data type conversion blocks at the system boundaries. you can also resolve the data type mismatch errors by changing the output data type of the blocks feeding into the system to single or inherit: inherit via back propagation.

related topics

    网站地图