MATLAB DESIGN HDL CODER RELEASE NOTES User's Guide Page 52

  • Download
  • Add to my manuals
  • Print
  • Page
    / 410
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 51
52 www.xilinx.com System Generator for DSP User Guide
UG640 (v 12.2) July 23, 2010
Chapter 1: Hardware Design Using System Generator
else
z = y;
end
The xlmax.m file should be either saved in the same directory of the model file or should
be in the MATLAB path. Once the xlmax.m has been saved to the appropriate place, you
should drag a MCode block into your model, open the block parameter dialog box, and
enter xlmax into the MATLAB Function field. After clicking the OK button, the block has
two input ports x and y, and one output port z.
The following figure shows what the block looks like after the model is compiled. You can
see that the block calculates and sets the necessary fixed-point data type to the output port.
Simple Arithmetic Operations
This example shows some simple arithmetic operations and type conversions. The
following shows the xlSimpleArith.m file, which specifies the xlSimpleArith M-
function.
function [z1, z2, z3, z4] = xlSimpleArith(a, b)
% xlSimpleArith demonstrates some of the arithmetic operations
Page view 51
1 2 ... 47 48 49 50 51 52 53 54 55 56 57 ... 409 410

Comments to this Manuals

No comments