Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Fully Synthesizable Fix Point package

Altera_Forum
Honored Contributor II
2,687 Views

Hi, 

Great- I'v just learned how to use fully synthesizable floating point arithmetic calculation (using MegaFunction/IP cores). Now, how can I implement fully synthesizable Fix point calculation? I couldn't find any MegaFunction/ IP cores for that purpose… 

Thanks a lot, 

Idan
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
1,318 Views

Fixed point aritmetic is just integer arithmetic, offset by 2^n. So no special IP is needed.

0 Kudos
Altera_Forum
Honored Contributor II
1,318 Views

H; 

Thanks alot for your quick response! 

Where can I find an example for this kind of code? 

Thanks againe...  

Idan
0 Kudos
Altera_Forum
Honored Contributor II
1,318 Views

in VHDL - its simple, especially if you use the fixed point package: 

 

use ieee.fixed_pkg.all; .... signal a : sfixed(7 downto -8); -- 1 sign bit, 7 integer bits, 8 fraction bits - ie. integer offset by 2^8 signal b : sfixed(15 downto -16); ... b <= a*a;  

 

this can all be done with the numeric_std package, but you need to keep track of the offset yourself.
0 Kudos
Altera_Forum
Honored Contributor II
1,318 Views

Does the "fixed_pkg" is fully synthesizable?

0 Kudos
Altera_Forum
Honored Contributor II
1,318 Views

 

--- Quote Start ---  

Does the "fixed_pkg" is fully synthesizable? 

--- Quote End ---  

 

 

Yes. While full support only comes with Quartus Pro 16.0, you can use the '93 compatible version for compilation. 

Otherwise all of this can be done with numeric_std, which is compatible with all versions of quartus.
0 Kudos
Reply