[print this page]

Creating a 12 x 8 MAC Using the Xilinx System Generator (continued)

Introduction the Xilinx Gateways and MUX Blocks

In this section we will use the Xilinx Gateway In, Gateway Out, System Generator, and MUX blocks, which provide interface to the Xilinx Blocksets in Simulink.


1. Using Simulation -> Configuration Parameters dialog box, set the stop time to 500, and click OK. It is also possible to set the stop time by entering it here:


2. From the Xilinx Blockset (in the Simulink Library Browser), open Basic Elements and drag the Gateway In block onto the design sheet. Drop it on the connection between the Sine Wave and the output Scope. It will automatically insert itself


3. Double-click Gateway In to open the Block Parameters, and set the Number of bits to 8 and Binary Point to 2


4. Similarly, drag a Gateway Out block onto the sheet, and drop it between the Gateway In block and the output Scope block


. Add a Simulink MUX between the Gateway Out and the Scope by using Simulink -> Signal Routing (see top illustration)


6. Add an additional net between the Sine Wave and the MUX


Note: This will make the scope display both the double-precision sine wave and the user-defined precision sine wave that has gone into and back out of the Xilinx gateways


7. Add a system generator token from the Xilinx Blockset -> Basic Elements library to the design


8. To view the number of signals going into the MUX, select Wide nonscalar lines, Signal dimensions, and Port data types under the Format -> Port/Signal Displays menu


9. Update the diagram: select Edit -> Update Diagram


Note: Now look at your port types. Notice that the gateway in block has changed the signals from double-precision to fixed-point types. Fixed-point looks like Fix_8_2 in this case.



Next we will analyze our precision and sample rate.