UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor rutali
Visitor
4,430 Views
Registered: ‎01-22-2013

Using Embedded Multipliers in Spartan 3AN for fixed point number and integer

Jump to solution

I am using the spartan 3AN XC3S50AN-4TQG144 for a design in which I have to implement a digital filter, which would require the following operations

1. Fixed point number A Q12.4 ( 16 bits -12 bits integer and 4 bits fraction) has to be added to B (16 bits integer) using a adder

2. Result of addition ( Fixed point number) has to be multiplied with a scalar K ( 8 bit integer)

Product = K * [A+B]

 

Is it possible to utilize the embedded multiplier MULT18X18 available with the chosen part for the above mentioned operations.

 

When I tried using the float IP core or the Multipliers i was unable to find the right settings to define the type operands.

Does the multiplier expect the operands A,B, K to all be of the same type? ( either fixed point or integers)

 

Thanks

RDM

Tags (2)
float.jpg
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
4,976 Views
Registered: ‎08-02-2011

Re: Using Embedded Multipliers in Spartan 3AN for fixed point number and integer

Jump to solution
If K is constant, use the constant-coeff multiplier type.
 
This will allow you to select your input widths.

 

You are responsible for aligning binary points as necessary.

 

You could also do something as simple as:

 

y <= k*x;

 

in your behavioral code instead of instantiating a core. You'll have to be a bit careful about port widths, but that's really just as simple as sign extending the inputs to the required size before multiplying.

www.xilinx.com

View solution in original post

0 Kudos
4 Replies
Xilinx Employee
Xilinx Employee
4,421 Views
Registered: ‎08-02-2011

Re: Using Embedded Multipliers in Spartan 3AN for fixed point number and integer

Jump to solution

Is it possible to utilize the embedded multiplier MULT18X18 available with the chosen part for the above mentioned operations.

 


 

Sure.

 

 


Does the multiplier expect the operands A,B, K to all be of the same type?


 

Yes. You select what type you want to use with those radio buttons and that applies to all the ports. If you want to use this core, you have to convert all the inputs to the same precision float format.

 

 

It sounds like all your numbers are already setup for fixed point calculations. Are you sure you need to go float for the mult? It will cost you a lot of area to do so. Particularly if 'scalar K' means that it's constant.

www.xilinx.com
0 Kudos
Visitor rutali
Visitor
4,402 Views
Registered: ‎01-22-2013

Re: Using Embedded Multipliers in Spartan 3AN for fixed point number and integer

Jump to solution

I aslo tried instantiating the multiplier core, but this core also expects the two operands to be of the same type (precision)

 

So maybe the decimal point needs to be aligned before adding A and B i.e q12.4 (2's comp 16 bit fixed point number) and B, so that they are of the same type

 

Scalar K is a constant that needs to be multiplied with the result of addition

 

So do we need to convert the operands to the same type to be able to use the adder/multiplier cores?

mult.jpg
0 Kudos
Xilinx Employee
Xilinx Employee
4,977 Views
Registered: ‎08-02-2011

Re: Using Embedded Multipliers in Spartan 3AN for fixed point number and integer

Jump to solution
If K is constant, use the constant-coeff multiplier type.
 
This will allow you to select your input widths.

 

You are responsible for aligning binary points as necessary.

 

You could also do something as simple as:

 

y <= k*x;

 

in your behavioral code instead of instantiating a core. You'll have to be a bit careful about port widths, but that's really just as simple as sign extending the inputs to the required size before multiplying.

www.xilinx.com

View solution in original post

0 Kudos
Visitor rutali
Visitor
4,388 Views
Registered: ‎01-22-2013

Re: Using Embedded Multipliers in Spartan 3AN for fixed point number and integer

Jump to solution
Thanks a lot for the early resolution!
0 Kudos