Complex Multiplier
Complex Multiplier
Complex Multiplier
(ALTMULT_COMPLEX)
Megafunction User Guide
Software Version:
Document Version:
Document Date:
8.0
1.0
May 2008
Copyright 2008 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company, the stylized Altera logo, specific device designations, and all other words and logos that are identified as trademarks and/or service marks are, unless noted otherwise, the trademarks and
service marks of Altera Corporation in the U.S. and other countries. All other product or service names are the property of their respective holders. Altera products are protected under numerous U.S. and foreign patents and pending applications, maskwork rights, and copyrights. Altera warrants
performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make
changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera
Corporation. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.
UG-01033-1.0
ii
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User GuidePreliminary
Altera Corporation
May 2008
Contents
11
11
11
12
12
13
13
14
Chapter 3. Specifications
Ports and Parameters ............................................................................................................................ 31
Altera Corporation
iii
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Contents
iv
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
Revision History
The following table shows the revision history for this user guide.
Referenced
Documents
Changes Made
Initial release.
Altera Corporation
May 2008
Summary of Changes
v
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
How to Contact
Altera
For the most up-to-date information about Altera products, refer to the
following table.
Contact (1)
Contact
Method
Address
Technical support
Website
www.altera.com/support
Technical training
Website
www.altera.com/training
custrain@altera.com
Product literature
Website
www.altera.com/literature
nacomp@altera.com
authorization@altera.com
Note to table:
(1)
Typographic
Conventions
Visual Cue
You can also contact your local Altera sales office or sales representative.
Meaning
Command names, dialog box titles, checkbox options, and dialog box options are
shown in bold, initial capital letters. Example: Save As dialog box.
bold type
External timing parameters, directory names, project names, disk drive names,
filenames, filename extensions, and software utility names are shown in bold
type. Examples: \qdesigns directory, d: drive, chiptrip.gdf file.
Document titles are shown in italic type with initial capital letters.
Example: AN 75: High-Speed Board Design.
Italic type
Keyboard keys and menu names are shown with initial capital letters. Examples:
Delete key, the Options menu.
vi
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Visual Cue
Meaning
Subheading Title
References to sections within a document and titles of on-line help topics are
shown in quotation marks. Example: Typographic Conventions.
Courier type
Signal and port names are shown in lowercase Courier type. Examples: data1,
tdi, input. Active-low signals are denoted by suffix n, e.g., resetn.
Anything that must be typed exactly as it appears is shown in Courier type. For
example: c:\qdesigns\tutorial\chiptrip.gdf. Also, sections of an
actual file, such as a Report File, references to parts of files (e.g., the AHDL
keyword SUBDESIGN), as well as logic function names (e.g., TRI) are shown in
Courier.
Numbered steps are used in a list of items when the sequence of the items is
important, such as the steps listed in a procedure.
Bullets are used in a list of items when the sequence of the items is not important.
A warning calls attention to a condition or possible situation that can cause injury
to the user.
The angled arrow indicates you should press the Enter key.
Altera Corporation
May 2008
vii
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Typographic Conventions
viii
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Device Family
Support
Arria GX
Cyclone III
Cyclone II
HardCopy II
HardCopy Stratix
Stratix IV
Stratix III
Stratix II
Stratix II GX
Stratix
Stratix GX
Introduction
Features
Altera Corporation
May 2008
11
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
General Description
General
Description
Canonical
You can use the canonical representation for the following:
Conventional
You can use the conventional representation for the following:
Complex Multiplication
Complex numbers are numbers in the form of the following equation:
a + ib
where:
xy = ( a + ib ) ( c + id )
= a c + ibc + iad bd
(2)
= ( ac bd ) + i ( ad + bc )
12
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Conventional Representation
From Equation 1, the multiplication of two complex numbers can be
represented in two parts: real and imaginary. The xy_real variable in
Equation 3 represents the real part, and the xy_imaginary variable in
Equation 4 represents the imaginary part. Both equations are derived
from Equation 2.
(3)
(4)
xy_real = ac bd
xy_imaginary = ad + bc
Multiplier
Adder
Subtractor
Conventional
Canonical Representation
From Equation 1, the multiplication of two complex numbers can be
represented in two parts: real and imaginary. The xy_real variable in
Equation 5 represents the real part, and the xy_imaginary variable in
Equation 6 represents the imaginary part. Both equations are derived
from Equation 2.
(5)
xy_real = ac bd
= ac bd + ( ad bc ) ( ad bc )
= ( ac ad + bc bd ) + ( ad bc )
= ( ( a + b ) ( c d ) ) + ( ad bc )
(6)
xy_imaginary = ad + bc
Altera Corporation
May 2008
13
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Multiplier
Adder
Subtractor
Canonical
For more information about the multiply or add mode in the DSP blocks
of Stratix devices and details on using accumulators in the finite impulse
response (FIR) filter applications, refer to the following literature:
Resource Usage
and
Performance
Representation
Stratix III Device Family Overview chapter in volume 1 of the Stratix III
Device Handbook
DSP Blocks in Stratix III Devices chapter in volume 1 of the Stratix III
Device Handbook
Configuring Stratix III Devices chapter in volume 1 of the Stratix III
Device Handbook
Introduction chapter in volume 1 of the Stratix II Device Handbook
Stratix II Architecture chapter in volume 1 of the Stratix II Device
Handbook
DSP Blocks in Stratix II and Stratix II GX Devices chapter in volume 2
of the Stratix II Device Handbook
Configuring Stratix II and Stratix II GX Devices chapter in volume 2 of
the Stratix II Device Handbook
Introduction chapter in volume 1 of the Stratix Device Handbook
Stratix Architecture chapter in volume 1 of the Stratix Device
Handbook
DSP Blocks in Stratix and Stratix GX Devices chapter in volume 2 of the
Stratix Device Handbook
14
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Table 13. ALTMULT_COMPLEX Megafunction Resource Usage for Stratix III and Cyclone III Devices
Note (1)
Logic Usage
(Dedicated Logic
Registers)
Device Family
Representation
(2)
Stratix III
Conventional
18
36
Canonical
156
Cyclone III
DSP Blocks
Conventional
90
Conventional
18
180
You can get the resource information from the MegaWizard Plug-In Manager. The information in this table is
valid and accurate in the Quartus II software version 8.0.
Specify the representation on page 3 of the MegaWizard Plug-In Manager for the ALTMULT_COMPLEX
megafunction. For Stratix III devices and input data widths of 18 bits and above, use only the conventional
representation.
Altera Corporation
May 2008
15
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
16
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Software and
System
Requirements
MegaWizard
Plug-In Manager
Customization
Altera Corporation
May 2008
21
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
MegaWizard
Plug-In Manager
Page
Descriptions
22
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
Altera Corporation
May 2008
23
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
24
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
Description
Altera Corporation
May 2008
25
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
26
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
Description
Pipelining
Altera Corporation
May 2008
27
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
28
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
For more information about the ports and parameters for the
ALTMULT_COMPLEX megafunction, refer to Chapter 3, Specifications.
Instantiating
Megafunctions
in HDL Code or
Schematic
Designs
Altera Corporation
May 2008
29
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
210
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
Identifying a
Megafunction
after
Compilation
Simulation
To search for node names within the megafunction (using the Node
Finder), click Browse in the Look in box and select the megafunction in
the Hierarchy box.
Altera Corporation
May 2008
211
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
and synthesis to keep a particular wire, register, or node intact. Use these
synthesis attributes to keep a combinational logic node so you can
observe the node during simulation.
Design
Example 1:
Multiplication of
8-Bit Complex
Numbers Using
Canonical
Representation
Design Files
The example design files are available in the User Guides section on the
Literature page of the Altera website (www.altera.com).
The following functional simulations are available for the design
example:
212
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
Configuration Settings
This design example configures the ALTMULT_COMPLEX
megafunction for the canonical representation with an input data width
of 8 bits.
Table 23 shows the ALTMULT_COMPLEX MegaWizard Plug-In
Manager configuration settings that are used to create this design
example. In the MegaWizard Plug-In Manager pages, select or verify the
configuration settings shown in Table 23. Click Next to advance from
one page to the next.
Value
Stratix II
Verilog
8 bits
16 bits
Unsigned
Output latency
Implementation style
Canonical
Yes
Yes
Generate netlist
No
Altera Corporation
May 2008
1.
2.
3.
213
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
4.
5.
6.
7.
8.
9.
214
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
2.
3.
Altera Corporation
May 2008
215
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
4.
5.
6.
216
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
7.
8.
9.
10. On the Processing menu, click Start Compilation. When the Full
compilation was successful message box appears, click OK.
Altera Corporation
May 2008
217
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
For designs with input data widths that are less than 18 bits, Altera
recommends that you use the canonical representation for efficient
resource usage. If you set the IMPLEMENTATION_STYLE parameter to
AUTO, the MegaWizard Plug-In Manager chooses the canonical
representation by default for designs using non-Stratix III devices or
input widths that are less than 18 bits.
For designs using Stratix III devices or input widths of 18 bits and above,
you can use only the conventional representation. If you set the
IMPLEMENTATION_STYLE parameter to AUTO, the MegaWizard Plug-In
Manager chooses the conventional representation by default.
218
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Getting Started
2.
3.
4.
5.
Click OK.
6.
7.
8.
View the simulation results in the Wave window (Figure 213). You
can rearrange signals, remove signals, add signals, and change the
radix by modifying the script in the complex_canonical.do file.
Altera Corporation
May 2008
219
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Conclusion
Conclusion
220
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Chapter 3. Specifications
Ports and
Parameters
Refer to the latest version of the Quartus II Help for the most current
information on the ports and parameters for this megafunction.
Figure 31 shows the input and output ports for the
ALTMULT_COMPLEX megafunction.
Figure 31. Input and Output Ports of ALTMULT_COMPLEX Megafunction
Altera Corporation
May 2008
31
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Table 31 shows the input ports, Table 32 shows the output ports, and
Table 33 shows the parameters for the ALTMULT_COMPLEX
megafunction.
Required
Description
Comments
aclr
No
clock
Yes
dataa_imag[]
Yes
Imaginary input value for the data A Input port [WIDTH_A-1..0] wide.
port of the complex multiplier.
Width is specified by the WIDTH_A
parameter.
dataa_real[]
Yes
datab_imag[]
Yes
Imaginary input value for the data B Input port [WIDTH_B-1..0] wide.
port of the complex multiplier.
Width is specified by the WIDTH_B
parameter.
datab_real[]
Yes
ena
No
Required
Description
Comments
result_imag
Yes
result_real
Yes
32
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008
Specifications
Type
Required
Description
IMPLEMENTATION_STYLE
String
Yes
PIPELINE
Integer
Yes
REPRESENTATION_A
String
Yes
REPRESENTATION_B
String
Yes
WIDTH_A
Integer
Yes
WIDTH_B
Integer
Yes
WIDTH_RESULT
Integer
Yes
Altera Corporation
May 2008
33
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Type
Required
Description
INTENDED_DEVICE_FAMILY
String
No
LPM_HINT
String
No
LPM_TYPE
String
No
34
Complex Multiplier (ALTMULT_COMPLEX) Megafunction User Guide
Altera Corporation
May 2008