Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

altmult_add

Altera_Forum
Honored Contributor II
2,086 Views

Hi, 

 

i have two questions: 

1- how the altmult_add megafunction can be used in a pipelined structure? 

2- which method is the best to calculate inner product of two vectors, having 3 elements, in a pipelined structure:a altmult_add with 3 input or 2 lpmmult mfs and 2 lpmadd_sub mfs? 

 

Regards, 

 

Bedri
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
476 Views

1. It is already pipelined. 

2. Im not quite sure what you mean? do you mean 2 vectors with 3 elemenents in each: 

 

sum(  

a(0) * b(0) 

a(1) * b(1) 

a(2) * b(2) 

); 

 

 

In this case you need 3 multipliers and 2 adders. 

 

 

I would suggest the altmult_add will probably work better than a custom made pipeline, if it suits your purpose. Why not simulate them and find out?
0 Kudos
Altera_Forum
Honored Contributor II
476 Views

Thank you for your reply. 

 

 

--- Quote Start ---  

1. It is already pipelined. 

2. Im not quite sure what you mean? do you mean 2 vectors with 3 elemenents in each: 

 

sum(  

a(0) * b(0) 

a(1) * b(1) 

a(2) * b(2) 

); 

 

 

In this case you need 3 multipliers and 2 adders. 

--- Quote End ---  

 

 

i did mistake and yes you are right that i need 3 multipliers.  

 

 

--- Quote Start ---  

 

I would suggest the altmult_add will probably work better than a custom made pipeline, if it suits your purpose.out? 

--- Quote End ---  

 

 

Thank you for suggestion.  

 

 

--- Quote Start ---  

Why not simulate them and find  

 

--- Quote End ---  

 

I'm a beginner. Sometimes my simulation results may be different real works on DE2-115 board. Nevertheless i have trying to simulate. 

 

Well, i have implemented my calculations in pipelined structures and i think that this type implementations need latencies of the pipelined blocks. i have searched to find whether altmult_add megafunction has a latency or output ready signal?  

if i have to calculate the equation below how can i detect that the output of the altmult_add is ready for adder which will add the output of the altmult_add to 5? 

 

sum(  

a(0) * b(0) 

a(1) * b(1) 

a(2) * b(2) 

) + 5; 

 

 

Regards, 

 

Bedri
0 Kudos
Altera_Forum
Honored Contributor II
476 Views

 

--- Quote Start ---  

Thank you for your reply. 

 

if i have to calculate the equation below how can i detect that the output of the altmult_add is ready for adder which will add the output of the altmult_add to 5? 

 

sum(  

a(0) * b(0) 

a(1) * b(1) 

a(2) * b(2) 

) + 5; 

 

 

Regards, 

 

Bedri 

--- Quote End ---  

 

 

you need one mult (inputs a,b). accumulate results over 3 samples adding 5 as well. latency issues can be seen in simulation.
0 Kudos
Altera_Forum
Honored Contributor II
476 Views

If there are differences between what you have in simulation and what you have in hardware, there is a problem. 

 

The latency is always fixed, and depends on the settings you gave it. So you can always work out the latency based on the various clock source settings for the various registers: http://www.altera.co.uk/literature/ug/ug_lpm_alt_mfug.pdf
0 Kudos
Reply