Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Modulus 12

4 views
Skip to first unread message

Allan Herriman

unread,
Feb 14, 2005, 7:32:45 AM2/14/05
to
On Mon, 14 Feb 2005 13:30:54 +0100, Andrés <nospam_n...@gmx.de>
wrote:

>Andrés wrote:
>> Hi VHDL people,
>>
>> is it possible to implement a MOD 12 operation
>> in Hardware ?
>>
>> The Lattice Synthesizer is not able to use any direct implementation.
>>
>> Suggestions are welcome.
>>
>> Best regards
>>
>> Andrés
>
>Something additional:
>
>I am using a counter that counts up.
>
>Every time the counter value mod 12 gets zero I want
>to make a signal 'l_show_burst_complete' HIGH.
>
>I am implementing a back-to-back write for an DDR SDRAM controller.

That's rather different. You should just make a divide by 12 counter,
and reset it at the same time you reset your main counter.

Regards,
Allan

Tuukka Toivonen

unread,
Feb 14, 2005, 8:37:25 AM2/14/05
to
On 2005-02-14, Allan Herriman <allan.herrim...@ctam.com.au.invalid> wrote:
> On Mon, 14 Feb 2005 13:02:18 +0100, Andrés <nospam_n...@gmx.de>

> wrote:
>
>>Hi VHDL people,
>>
>>is it possible to implement a MOD 12 operation
>>in Hardware ?
>>
>>The Lattice Synthesizer is not able to use any direct implementation.
>>
>>Suggestions are welcome.
>
> 12 = 4 * 3.
>
> Mod 2**N is trivially easy, and mod 2**N-1 is reasonably easy, once
> you understand the maths.

And, to get mod 12 from mod 4 and 3, you use typically "chinese remainder theorem"
or "mixed radix conversion". However, they require multiplications but if you're
lucky those can be done with a few bit shifts. Something to type into Google...

Allan Herriman

unread,
Feb 14, 2005, 7:28:48 AM2/14/05
to
On Mon, 14 Feb 2005 13:02:18 +0100, Andrés <nospam_n...@gmx.de>
wrote:

>Hi VHDL people,
>
>is it possible to implement a MOD 12 operation
>in Hardware ?
>
>The Lattice Synthesizer is not able to use any direct implementation.
>
>Suggestions are welcome.

12 = 4 * 3.

Mod 2**N is trivially easy, and mod 2**N-1 is reasonably easy, once
you understand the maths.

This thread describes how to do a mod 3 operation on a 10 bit number
in 1 CLB:
http://groups-beta.google.com/group/comp.arch.fpga/browse_frm/thread/40b7d07440650599/93bef6826d0a16b3

Regards,
Allan

Andrés

unread,
Feb 14, 2005, 7:30:54 AM2/14/05
to
Andrés wrote:
> Hi VHDL people,
>
> is it possible to implement a MOD 12 operation
> in Hardware ?
>
> The Lattice Synthesizer is not able to use any direct implementation.
>
> Suggestions are welcome.
>
> Best regards
>
> Andrés

Something additional:

I am using a counter that counts up.

Every time the counter value mod 12 gets zero I want
to make a signal 'l_show_burst_complete' HIGH.

I am implementing a back-to-back write for an DDR SDRAM controller.

Rgds
Andrés

Andrés

unread,
Feb 14, 2005, 7:02:18 AM2/14/05
to
0 new messages