Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Hi, in VHDL you can also either use the Megacore function or use the workaround as given in first post (which might internally be compiled rather identical). The direct writing of a <= b/c will give an error as the compiler cannot resolve this to pure logic. Does this (in Verilog) really ends up with compiled code or is this syntax beind supported for simulation and/or testbench only (like Wait 500ms). --- Quote End --- averaging in principle is add up all elements then divide by number of elements. if these elements are arriving in a sequential stream of samples and assuming your elements are 2^n then you add them up in an accumulator of suitable width and at the end divide by just truncating off n bits.