Chapter 7 Code Optimization© National Instruments Corporation 7-13 AutoCode Reference}Y->model_5_1 = X->model_5_S1;/* ---------------------------- Gain Block *//* {model..2} */model_2_1 = 2.0*U->model_1;/* ---------------------------- Sum of Vectors *//* {model..3} */model_3_1 = model_2_1 - U->model_1;/* ---------------------------- Gain Block *//* {model..4} */model_2_1 = 3.0*model_3_1;/***** State Update. *****//* ---------------------------- Time Delay *//* {model..5} */XD->model_5_S1 = model_2_1;In Example 7-7 (code generated without reuse option), each block has adistinct and unique output variable. In Example 7-8 (code generated withthe maximal reuse option), the variable model_2_1, which is the outputvariable for the block model..2, is used only in the computation for blockmodel..3. It is free to be used again after the computation for model..3is complete, and in fact the generated code reuses the variable model_2_1as the output variable of the block model..4.Constant PropagationAutoCode supports an option to propagate constants in the generatedcode. Source of constants in a model are typically algebraic and logicalexpression blocks. For the sake of this optimization, you can partition allof the blocks into two categories.• Blocks that can propagate constants• Blocks that cannot propagate constantsMost of the blocks from palettes such as ALG, PWL, LOG, TRG, and PEL,belong to the first category (propagate constants), and if all of the inputs tosuch blocks are constants, the output value is computed during compiletime, and no code is generated for such a block. The blocks belonging tothe second category (cannot propagate constants), are from other palettessuch as DYN, SGN, and NTP. These blocks do not propagate outputs evenif all of their inputs are constants. Code is generated for such blocks.