Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Fixed Point and DSP Usage

Altera_Forum
Honored Contributor II
830 Views

Hi, everyone. 

Referring to code below, I am trying to implement fixed point arithmetic to replace floating point arithmetic for my application.  

 

Surprisingly, the DSP usage increases tremendously(around 100%) from 30(floating point) to 64 (fixed point). However, all other resources: ram, logic and etc is reduced. 

 

// Note variable A & B is 16 bit short, passed as argument from host int sum; short C; for loop sum += A + B; end C = 0xffff & (sum >> 8);  

 

Regarding to the report, i have few doubts:  

  1. Does Fixed Point arithmetic helps to reduce the DSP usage?Because, as far as i know, dsp block only consumed by floating point operation(please correct me if i'm wrong) 

 

 

  1. Am I doing the fixed point in a correct way ? 

 

 

  1. And what approach I can take to further reduce the DSP usage? 

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
79 Views

Technically DSP usage could be reduced by user lower precision; however, the compiler might not necessarily be able to correctly pack your lower-precision computation into DSPs. "Intel FPGA SDK for OpenCL Pro Edition Best Practices Guide, Section 3.3.1. Floating-Point versus Fixed-Point Representations" explain how you can infer fixed-point computation. 

 

P.S. If you are using Arria 10 which has support for one FP32 Fused Multiply and Add per DSP, even in the best case you will be able to do one instance of (a * b) + (c * d) per DSP if all numbers are smaller than 18 bits, giving you one extra operation per DSP compared to FP32.
Reply