Forum Discussion

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

What is the difference between direct arithmetic computation and using MegaWizard blo

When I try to do addition, reduction, multiplication, previously I will use

plug ins in Quartus II like LPM_ADD_SUB. Then I will program use this addtion block to do addtion.The program will be:

module Test1121(out1,out2,a,b);

input [7:0] a,b;

output [8:0] out1;

output [15:0] out2;

add1(a,b,out1);

mul1(a,b,out2);

endmodule

However, It seems I can directly programing like this:

module Test1121(out1,out2,a,b);

input [7:0] a,b;

output [8:0] out1;

output [15:0] out2;

always@(a or b)

begin

out1=a+b;

out2=a*b;

end

endmodule

So I wonder what is the difference between them? Which one is better to be used?

Thanks

13 Replies

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

    Despite that neither me nor cris72 managed to get decorated as FvM,

    Cris is still well at the lower end...after his initial excitement !!!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    not sure why that is

    i'm not normally good about clicking that button, i'll see if i can pay attention a bit better