1. A counting device, comprising: a memory comprising a set of memory cells, comprising multiple groups of the memory cells that are configured to store respective count words of a count code, the count words comprising at least a less significant word and a more significant word; and a controller, which is coupled to the memory cells so as to make a first assignment of the groups of the memory cells that are to store the respective count words, which includes assigning first and second groups of the memory cells to store the less significant word and the more significant word, respectively, and to increment, in response to occurrences of a count input, the less significant word from an initial value up to a first limit in each of a plurality of successive first iterations, and to increment, in response to reaching the first limit in each of the successive first iterations, the more significant word from an initial value up to a second limit in each of a plurality of successive second iterations, and upon reaching the second limit, to make a second assignment, different from the first assignment, of the groups of the memory cells that are to store the less significant word and the more significant word, respectively, and to continue the first and second iterations subject to the second assignment.
1. A counting device, comprising: a memory comprising a set of memory cells, comprising multiple groups of the memory cells that are configured to store respective count words of a count code, the count words comprising at least a less significant word and a more significant word; and a controller, which is coupled to the memory cells so as to make a first assignment of the groups of the memory cells that are to store the respective count words, which includes assigning first and second groups of the memory cells to store the less significant word and the more significant word, respectively, and to increment, in response to occurrences of a count input, the less significant word from an initial value up to a first limit in each of a plurality of successive first iterations, and to increment, in response to reaching the first limit in each of the successive first iterations, the more significant word from an initial value up to a second limit in each of a plurality of successive second iterations, and upon reaching the second limit, to make a second assignment, different from the first assignment, of the groups of the memory cells that are to store the less significant word and the more significant word, respectively, and to continue the first and second iterations subject to the second assignment. 6. The device according to claim 1 , wherein the limit for each iteration is defined by a maximum value given by a number of the bits in each of the count words.