VHDL Code for binary/Gray counter help please

Discussion in 'VHDL' started by baigsku, Dec 14, 2009.

  1. baigsku

    baigsku

    Joined:
    Dec 14, 2009
    Messages:
    1
    Hello

    Can any one please send me the vhdl code for a state machine that counts up in binary froom 0 to 7 when the control input is a '1' and in a gray code sequence when the control is a '0'

    Up sequence is 000,001,010,011,100,101,110,111

    Gray Sequence: 000,001,011,111,101,100,110,010


    Many thanks

    baig
    baigsku, Dec 14, 2009
    #1
    1. Advertising

  2. baigsku

    joris

    Joined:
    Jan 29, 2009
    Messages:
    152
    I think the easiest solution would be to internally only count in binary, and only outputting as gray code if requested.
    joris, Dec 14, 2009
    #2
    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. Srinivas Rao \(Rbin/eds2\)

    gray code

    Srinivas Rao \(Rbin/eds2\), Oct 22, 2003, in forum: C Programming
    Replies:
    6
    Views:
    2,698
    Dave Von Pless
    Oct 24, 2003
  2. Olaf
    Replies:
    4
    Views:
    3,088
    Ahmed Samieh
    Apr 30, 2007
  3. ast

    Gray counter

    ast, Sep 13, 2007, in forum: VHDL
    Replies:
    22
    Views:
    7,516
    omahens
    May 7, 2008
  4. sarovarc

    Gray Code

    sarovarc, Mar 2, 2011, in forum: VHDL
    Replies:
    1
    Views:
    1,313
    sarovarc
    Mar 2, 2011
  5. fofo

    A gray counter

    fofo, Dec 19, 2011, in forum: VHDL
    Replies:
    3
    Views:
    1,275
    eliascm
    Dec 20, 2011
Loading...

Share This Page