DSP Floating Point to Fixed Point Conversion Tutorial

Similar documents
Synthesis Data Flow Tutorial

Lattice Diamond User Guide

LatticeMico32 Software Developer User Guide

isplever 8.1 Installation Notice

RoHS Compliant Packaging

How to Deploy Models using Statistica SVB Nodes

Dell Spotlight on Active Directory Server Health Wizard Configuration Guide

LMS is a simple but powerful algorithm and can be implemented to take advantage of the Lattice FPGA architecture.

formerly Help Desk Authority Quest Free Network Tools User Manual

COM Port Stress Test

NCD ThinPATH Load Balancing Startup Guide

LatticeXP2 Configuration Encryption and Security Usage Guide

ChangeAuditor 6.0 For Windows File Servers. Event Reference Guide

Introduction to Version Control in

ChangeAuditor 5.6. For Windows File Servers Event Reference Guide

Quest ChangeAuditor 5.1 FOR ACTIVE DIRECTORY. User Guide

New Features and Enhancements

Dell One Identity Cloud Access Manager How to Configure vworkspace Integration

FOR WINDOWS FILE SERVERS

NCD ThinPATH Load Balancing Startup Guide versions and 2.8.1

Quest vworkspace Virtual Desktop Extensions for Linux

NiCE Log File Management Pack. for. System Center Operations Manager Quick Start Guide

Self Help Guides. Setup Exchange with Outlook

ACT! by Sage. Premium for Workgroups 2007 (9.0) Administrator s Guide to the ACT! Reader Utility

LatticeECP2/M S-Series Configuration Encryption Usage Guide

Introduction to Simulink

Self Help Guides. Create a New User in a Domain

Source Control and Team-Based Design in System Generator Author: Douang Phanthavong

Dell Statistica Statistica Enterprise Installation Instructions

BrightStor ARCserve Backup for Linux

Security Analytics Engine 1.0. Help Desk User Guide

Spotlight on Messaging. Evaluator s Guide

Using Self Certified SSL Certificates. Paul Fisher. Quest Software. Systems Consultant. Desktop Virtualisation Group

Spotlight Management Pack for SCOM

Dell NetVault Backup Plug-in for SharePoint 1.3. User s Guide

Dell InTrust Preparing for Auditing Microsoft SQL Server

RealShot Manager Compression Server software

Dell Statistica Document Management System (SDMS) Installation Instructions

Dell Unified Communications Command Suite - Diagnostics 8.0. Data Recorder User Guide

Active Directory Change Notifier Quick Start Guide

8.7. Resource Kit User Guide

Scribe Online Integration Services (IS) Tutorial

Clearview Customer Web Access

Application Note Gemalto Access Client for windows smart card and EFS on Microsoft Windows Vista

User Document. Adobe Acrobat 7.0 for Microsoft Windows Group Policy Objects and Active Directory

formerly Help Desk Authority HDAccess Administrator Guide

Dell NetVault Backup Plug-in for Advanced Encryption 2.2. User s Guide

User Guidance. CimTrak Integrity & Compliance Suite

ISP Daisy Chain Download User Manual

Dell One Identity Cloud Access Manager How to Configure Microsoft Office 365

Promotion Model. CVS SUITE QUICK GUIDE 2009 Build 3701 February March Hare Software Ltd

Connecting the DR-22WL/DR-44WL to the computer by Wi-Fi for the first time... 5

Application Note. Gemalto s SA Server and OpenLDAP

Fuse MQ Enterprise Broker Administration Tutorials

Foglight for Oracle. Managing Oracle Database Systems Getting Started Guide

Dell Migration Manager for Enterprise Social What Can and Cannot Be Migrated

Copy Tool For Dynamics CRM 2013

Dell One Identity Cloud Access Manager How To Deploy Cloud Access Manager in a Virtual Private Cloud

YAMAHA ASIO DirectKS Driver for Windows Owner's Manual

Object Level Authentication

Quick Connect Express for Active Directory

Pulse Redundancy. User Guide

Quest ChangeAuditor 4.8

BlackBerry Web Desktop Manager. Version: 5.0 Service Pack: 4. User Guide

Foglight Managing SQL Server Database Systems Getting Started Guide. for SQL Server

Dell InTrust 11.0 Best Practices Report Pack

TERMS OF USE 1. Definitions

4.0. Offline Folder Wizard. User Guide

SPI Flash Programming and Hardware Interfacing Using ispvm System

Synology NAS Server Windows ADS FAQ

Microsoft Dynamics GP. Audit Trails

LS9 Editor Installation Guide

Digipass Plug-In for IAS. IAS Plug-In IAS. Microsoft's Internet Authentication Service. Installation Guide

Snagit 10. Snagit Add-Ins. By TechSmith Corporation

WHITE PAPER. HP Guide to System Recovery and Restore

Mylex Online RAID Expansion Enhancement for DACCF Utilities 4.4 and Global Array Manager Part Number D01

Dell One Identity Cloud Access Manager How to Configure for SSO to SAP NetWeaver using SAML 2.0

Spotlight Management Pack for SCOM

USER MANUAL APPLICATION MONITOR. Version March 2015

Contents Firewall Monitor Overview Getting Started Setting Up Firewall Monitor Attack Alerts Viewing Firewall Monitor Attack Alerts

Dell InTrust Preparing for Auditing Cisco PIX Firewall

Front-Office Server 2.7

SafeNet Cisco AnyConnect Client. Configuration Guide

TIBCO MFT BusinessWorks MFT Palette

11 ways to migrate Lotus Notes applications to SharePoint and Office 365

CA Nimsoft Monitor. Probe Guide for Active Directory Response. ad_response v1.6 series

SecureW2 Client for Windows User Guide. Version 3.1

End User License Agreement for the Intel(R) Software Development Products

DME-N Network Driver Installation Guide for LS9

Welcome to InFixi Exchange Mailbox Recovery Software. Help Guide. Exchange Mailbox recovery software

Foglight Managing SQL Server Database Systems Getting Started Guide. for SQL Server

FOR SHAREPOINT. Quick Start Guide

/ WMS / LITE INDUSTRIAL)

Defender Delegated Administration. User Guide

Adobe Acrobat 9 Deployment on Microsoft Windows Group Policy and the Active Directory service

Application Note. Intelligent Application Gateway with SA server using AD password and OTP

Desktop Authority vs. Group Policy Preferences

QuickBack. User s Guide

Microsoft Dynamics GP. Electronic Signatures

DME-N Network Driver Installation Guide for M7CL/LS9/DSP5D

Transcription:

DSP Floating Point to Fixed Point Conversion Tutorial Lattice Semiconductor Corporation 5555 NE Moore Court Hillsboro, OR 97124 (503) 268-8000 March 2008

Copyright Copyright 2008 Lattice Semiconductor Corporation. This document may not, in whole or part, be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machinereadable form without prior written consent from Lattice Semiconductor Corporation. Trademarks Lattice Semiconductor Corporation, L Lattice Semiconductor Corporation (logo), L (stylized), L (design), Lattice (design), LSC, E 2 CMOS, Extreme Performance, FlashBAK, flexiflash, fleximac, flexipcs, FreedomChip, GAL, GDX, Generic Array Logic, HDL Explorer, IPexpress, ISP, ispate, ispclock, ispdownload, ispgal, ispgds, ispgdx, ispgdxv, ispgdx2, ispgenerator, ispjtag, isplever, isplevercore, isplsi, ispmach, isppac, isptracy, ispturbo, ispvirtual MACHINE, ispvm, ispxp, ispxpga, ispxpld, LatticeEC, LatticeECP, LatticeECP-DSP, LatticeECP2, LatticeECP2M, LatticeMico8, LatticeMico32, LatticeSC, LatticeSCM, LatticeXP, LatticeXP2, MACH, MachXO, MACO, ORCA, PAC, PAC- Designer, PAL, Performance Analyst, PURESPEED, Reveal, Silicon Forest, Speedlocked, Speed Locking, SuperBIG, SuperCOOL, SuperFAST, SuperWIDE, sysclock, sysconfig, sysdsp, syshsi, sysi/o, sysmem, The Simple Machine for Complex Design, TransFR, UltraMOS, and specific product designations are either registered trademarks or trademarks of Lattice Semiconductor Corporation or its subsidiaries in the United States and/or other countries. ISP, Bringing the Best Together, and More of the Best are service marks of Lattice Semiconductor Corporation. HyperTransport is a licensed trademark of the HyperTransport Technology Consortium in the U.S. and other jurisdictions. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies. Disclaimers NO WARRANTIES: THE INFORMATION PROVIDED IN THIS DOCUMENT IS AS IS WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF ACCURACY, COMPLETENESS, MERCHANTABILITY, NONINFRINGEMENT OF INTELLECTUAL PROPERTY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL LATTICE SEMICONDUCTOR CORPORATION (LSC) OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER (WHETHER DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO USE THE INFORMATION PROVIDED ON THIS SITE, EVEN IF LSC HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME JURISDICTIONS PROHIBIT THE EXCLUSION OR LIMITATION OF CERTAIN LIABILITY, SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU. LSC may make changes to these materials, specifications, or information, or to the products described herein, at any time without notice. LSC makes no DSP Floating Point to Fixed Point Conversion Tutorial ii

commitment to update this documentation. LSC reserves the right to discontinue any product or service without notice and assumes no obligation to correct any errors contained herein or to advise any user of this document of any correction if such be made. LSC recommends its customers obtain the latest version of the relevant information to establish, before ordering, that the information being relied upon is current. DSP Floating Point to Fixed Point Conversion Tutorial iii

iv

Contents DSP Floating Point to Fixed Point Conversion Tutorial 1 Learning Objectives 1 Time to Complete This Tutorial 1 System Requirements 2 Accessing Online Help 2 About the Tutorial Design 2 Prerequisites 2 Model Examples 2 Task 1: Create the FIR Filter 3 Task 2: Create a Subsystem 5 Task 3: Complete the Testbench 6 Summary 8 DSP Floating Point to Fixed Point Conversion Tutorial v

vi

DSP Floating Point to Fixed Point Conversion Tutorial This tutorial covers the basic steps in taking a floating point design in Simulink and converting it to a fixed-point design using the Lattice ispleverdsp blockset for MATLAB/Simulink. Inexperienced users of Lattice ispleverdsp blockset for MATLAB/Simulink are advised to perform the System Design Using ispleverdsp tutorial before attempting this tutorial. Learning Objectives When you have completed this tutorial, you should be able to do the following: Create a floating-point design in Simulink that achieves the desired system performance criteria. Create a testbench to compare the two versions of the design. Simulate floating-point and fixed-point versions of the design and compare the results. Time to Complete This Tutorial The time to complete this tutorial is about 30 minutes. DSP Floating Point to Fixed Point Conversion Tutorial 1

System Requirements System Requirements One of the following software configurations is required to complete this tutorial: isplever software latest ispleverdsp MATLAB/Simulink blockset installed. Active license for The MathWorks MATLAB/Simulink software. Accessing Online Help You can find online help information on any tool included in the tutorial at any time by pressing the F1 key. About the Tutorial Design It is assumed you are familiar with the steps required to produce a floatingpoint Simulink model. If help is needed with this step, refer to the appropriate Mathworks documentation. For this example, we use the FDA tool to create a Simulink implementation of a 8th order low-pass FIR filter. This will be the reference for creating our Lattice blockset design. Prerequisites Before beginning the tutorial, you must have the Matlab/Simulink software already installed. To install the software, follow the installation instructions that accompany the MATLAB/Simulink software and the ispleverdsp software. You should be familiar with the FPGA design process before beginning the tutorial. To learn about the FPGA design process, see the FPGA and Crossover Design section of the isplever online Help. Model Examples A directory of model examples is provided with ispleverdsp and is available at the following location: \<install_path>\ispleverdsp\examples To view the examples for each of the tasks of this tutorial, open the following files in the examples folder: DSP_tutorial3.mdl DSP_tutorial4.mdl DSP_tutorial5.mdl DSP Floating Point to Fixed Point Conversion Tutorial 2

Task 1: Create the FIR Filter Task 1: Create the FIR Filter 1. Start the MATLAB software, using the instructions in the Mathworks documentation. 2. From the MATLAB startup window, set the Current Directory to a desired location. 3. Choose File > New > Model to open a blank model window. 4. Select the Simulink icon from the toolbar, or type simulink in the MATLAB Command window. This opens the Simulink Library Browser. 5. In the Simulink Library window, double-click Lattice Blockset to open the library and display its contents. 6. Create a FIR Filter design, as shown in the following figure, or open the file DSP_tutorial3.mdl. DSP Floating Point to Fixed Point Conversion Tutorial 3

Task 1: Create the FIR Filter DSP Floating Point to Fixed Point Conversion Tutorial 4

Task 2: Create a Subsystem 7. Each Constant block will be assigned an element from coefficient vector. Double-click the first Constant block, and enter the coefficient -0.02195422186881 into the parameter window for the first constant. 8. For the remaining constants, enter the remaining coefficient values as follows: -0.03832099116987 0.06575727134164 0.28642510883572 0.41152790318546 0.28642510883572 0.06575727134164-0.03832099116987-0.02195422186881 It is not necessary to modify any other parameters; the default values will suffice. Task 2: Create a Subsystem Once this design has been entered, create a subsystem from it. 1. Using your mouse, drag a rectangle around the blocks inside the Gateway-In and Gateway-Out blocks. Do not include the Gateway-In and Gateway-Out blocks in the rectangle you draw. Release the mouse button when all the blocks are selected in the rectangle. DSP Floating Point to Fixed Point Conversion Tutorial 5

Task 3: Complete the Testbench 2. Choose Edit > Create Subsystem. All the blocks you selected are replaced by a subsystem block. You can undo the subsystem by choosing Edit > Undo Create Subsystem. Note If you save the model after creating the subsystem, you will not be able to undo the subsystem later. 3. You will create a design as shown below, or you can open the file DSP_tutorial4.mdl. Task 3: Complete the Testbench The testbench includes two sine wave sources. 1. Create the model as shown in the following figure, or open the file DSP_tutorial5.mdl. 2. Double-click on the Lattice Generator block. Select Override with Doubles in the Block Parameters dialog box. This directs all the Lattice blocks to operate in floating-point mode. 3. Simulate the design and double-click the Scope to display the results. You should see the following in the display. DSP Floating Point to Fixed Point Conversion Tutorial 6

Task 3: Complete the Testbench The top two traces are the input signals; the third trace is the combined signal, and the fourth trace is the filter output. Note If you encounter Block error on the Gateway In block during simulation, doubleclick the Gateway In block and change Sample Period to a positive number. 4. Double-click on the Lattice Generator block. Clear the Override with Doubles option. This directs all the Lattice blocks to operate in fixed-point mode. 5. Simulate the design and double-click the Scope to display the results. You should see the following in the display. DSP Floating Point to Fixed Point Conversion Tutorial 7

Summary A comparison of the results show that the second scope has waveforms similar to the first scope. The second scope results are fixed-point and are therefore coarser than the initial floating-point results. Summary You have completed the DSP Floating Point to Fixed Point Conversion Tutorial. In this tutorial, you have learned how to do the following: Create a floating-point design in Simulink that achieves the desired system performance criteria. Create a testbench to compare the two versions of the design. Simulate floating-point and fixed-point versions of the design and compare the results. DSP Floating Point to Fixed Point Conversion Tutorial 8