Forum Discussion

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

size of counter in LUTs

Hi!

I created the simplest possible 6-bit counter (with both megafunction and behaviorally).

In both cases Quartus shows that the counter will take 6 ALUTs.

From the Stratix IV handbook (which I use) I see that each ALUT contains: 6-input LUT, registers, an adder, etc.

Why doesn't Quartus implement the 6-bit counter using the 6-input LUT in one ALUT? Why does it need 6 of them?

This is important to me because my design uses 192 such counters and the potential for saving is huge.

Alex

2 Replies

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

    6 bit counter needs six registers. These have to be borrowed from 6 ALUT units.

    If you need 192 such counters then you will be using > 1000 registers.

    If you are short of registers then you can implement counting in RAMs.

    e.g. you can use only few counters and several RAM arrays to represent 192 counters then store the current count in its RAM array and read last value.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks!

    You are right. Additionally the LUTs contained in a ALUT is a 6-bit input, but 1-bit output.

    The counter is a 6-bit-in and 6-bit-out function.

    So 6 such LUTs are needed.