Modulus 12

Discussion in 'VHDL' started by =?ISO-8859-1?Q?Andr=E9s?=, Feb 14, 2005.

  1. 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
     
    =?ISO-8859-1?Q?Andr=E9s?=, Feb 14, 2005
    #1
    1. Advertising

  2. On Mon, 14 Feb 2005 13:02:18 +0100, 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.


    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..._frm/thread/40b7d07440650599/93bef6826d0a16b3

    Regards,
    Allan
     
    Allan Herriman, Feb 14, 2005
    #2
    1. Advertising

  3. 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
     
    =?ISO-8859-1?Q?Andr=E9s?=, Feb 14, 2005
    #3
  4. On Mon, 14 Feb 2005 13:30:54 +0100, Andrés <>
    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
     
    Allan Herriman, Feb 14, 2005
    #4
  5. On 2005-02-14, Allan Herriman <> wrote:
    > On Mon, 14 Feb 2005 13:02:18 +0100, 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.

    >
    > 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...
     
    Tuukka Toivonen, Feb 14, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tasperian Jigs

    Problems with floating point and modulus

    Tasperian Jigs, Apr 18, 2006, in forum: Java
    Replies:
    2
    Views:
    2,120
    Patricia Shanahan
    Apr 18, 2006
  2. Chris Watson

    Need precision using modulus

    Chris Watson, Aug 8, 2003, in forum: C++
    Replies:
    6
    Views:
    443
    yvan joffre
    Aug 8, 2003
  3. bug in modulus?

    , Apr 23, 2006, in forum: Python
    Replies:
    10
    Views:
    647
    Christophe
    May 3, 2006
  4. priya

    MODULUS operator

    priya, Nov 15, 2006, in forum: VHDL
    Replies:
    3
    Views:
    9,908
    priya
    Nov 16, 2006
  5. Jim Hunter

    Modulus of a negative number

    Jim Hunter, Feb 23, 2005, in forum: C Programming
    Replies:
    3
    Views:
    6,831
    ruang
    May 4, 2010
Loading...

Share This Page