Rolling Number Display

Discussion in 'Programmer's Corner' started by gaff38, Sep 2, 2008.

  1. gaff38

    Thread Starter New Member

    Sep 2, 2008
    2
    0
    I have been trying to conjure up VHDL code to display 10 digits on a 4 digit seven segment display i.e. 0123456789 would roll across the 4 digit display repeatedly
    Then using a slider switch another number could be chosen
    I would be extremely grateful for any help with this problem
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,144
    1,791
    Well I think that if you make a shift register out of the BCD digits and connect the last one back to the first one, that will get you your rolling display. Of course you can pick any 4 to display.

    Every ten clocks you could allow the contents of the digits to change, including the ones which are displayed. What is magic about ten clocks? Every ten clocks you know that the circular shift register returns to its initial condition.
     
  3. gaff38

    Thread Starter New Member

    Sep 2, 2008
    2
    0
    Thanks for that but honestly I don't know how to do that. Only started to use VHDL last week and can't get my head around it. I have tried and implmeted small blocks of code and they seem to be fine but have been stuck on this for a few days. If anyone has the code for this I would really appreciate it
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,144
    1,791
    Nobody has this code lying around. You have to start someplace.

    You start with the definition of a 4-bit register, to hold one BCD (Binary Coded Decimal) Digit. Then you make ten copies of it. Then you hook the outputs of one of them to the inputs of the next one in line. When you get to the last one you hook the outputs back to the inputs of the first one. Each time the clock comes in you move the digit one position around the loop.
     
Loading...