Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

altmult_add

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

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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.