Continue to Site

# [MOVED] difference between accumulator and counter

Status
Not open for further replies.

#### preethi19

##### Full Member level 5
Hi can anybody please tell me the difference between an accumulator and a counter. I thought an accumulator is a same as a counter until i came across this link... https://fpga-dsp-scratch.blogspot.ca/2008/08/vhdl-part-25-accumulator.html

Its told that "A counter increments a signal or variable only by 1. With accumulator I can increment a signal/variable with any number". But how is that a counter can increment only by 1... suppose when incrementing a binary no i can increment it by 00010 rather than just 00001 all the time... so now the counter is incrementing by 10. So isnt counter same as accumulator we we can increment it with any value... in the end everything is in binary only right... can anyone please clear my doubt... thank you!!!!

Re: difference between accumulator and counter

Hi,

This question is more related to PLD, FPGA, AS IC and languages like VHDL...

Yes, a "counter" usually is a "binary counter". With a step size of "1".
It usually has
* an enable input
* a direction input
* a clock input
* sometimes a preset input.
* a known bit width

A counter is not meant to count in other increments than "1" or sometimes "-1".
One could formulate this as: A = A + 1

With an accumulator you have an extra input for step size.
One could formulate this as: A = A + S.

Klaus

Semantics aside, technically a counter is just a subset of possible accumulators. An accumulator that only sums up 1's (or -1's) is referred to as a counter, whereas an accumulator is generally a summing function that adds a variable (non-1) value to a summation value.

A language like C distinguishes between the two with different syntax.

count++;
accumulate += number;

Status
Not open for further replies.