Dear colleagues,
I am sending you a proposal of binary counter, designed to minimize logic path length in between flip-flops to one gate (MUX) only, at the expense of not so straightforward binary counting. The reason for this design has emerged while using Actel (MicroSemi) ProASIC/IGLOO architecture, lacking any hardwired support for fast carry.
I have placed VHDL code, schematics, testbench and sample C code to OpenCores:
for further review. If you have GHDL, you can run the test easily by issuing "make testrun" or "make testvcd" to examine traces.
Background: During our work on Actel FPGAs (basically, 3-LUT & DFF only), we were aware of following types of faster counters:
- LFSR counter
- Johnson counter
- "RLA counter" (as tailored using Actel's SmartGen core generator)
Johnson due to its O(2^n) (n as number of bits) can not be used for longer counts; LFSR's are hard to invert (table lookup seems to be only known method), therefore also impractical for wider counters. RLA counter is still too slow and complex for wider counters and moderate speeds (e.g.
As a consequence, the proposed counter uses synchronous divide-by-two blocks, each using 1-bit pipeline and carry by single-clock pulse. Design is simple and fast, preliminary results from Synplify and Actel Designer shows
32bits @200MHz feasible.However, output bit lines are non-proportionaly delayed by discrete number of clock periods. Therefore, to obtain linear bit word, an inversion formula needs to be applied. Fortunately, the inversion is simple (unlike LFSR's), in C (pcount.c):
for (k = 1; k < n; k++) if ((y & ((1