Extracting the digits of an integer number

Discussion in 'Programmer's Corner' started by spiri19, Jul 12, 2010.

  1. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    Hi. I am new to VHDL and I cannot find a solution for creating a 4 digit counter and then displaying the digits on 4 7segment displays. I tried with mod operator, but apparently mod is not synthesizable. I tried creating a loop and substracting 1, 10 and 100, but loops are not synthesizable, either.
    I need this program for my school project that I should finish these days. If you can help me, please do it.
    Bunch of thanx.
     
  2. Harrington

    New Member

    Dec 19, 2009
    86
    3
    Well your as much in the dark as we are then Lots of reading I guess and lots of research as always i had a funny feeling it wouldn't be to long before people realised that there is a definite tendency for students to ask other people to do their assignments hoping of course that no one would ever notice this and thinking they wouldn't have to do any work at all "Don't you just love it when this happens !! lol "

    Hmmm,,, I guess you could say we weren't born yesterday either and this gets harder for you because they can even tell if you have used your own PC c to write the software on especially when it comes to programming Gosh this must be so hard for you
     
    Last edited: Jul 12, 2010
    spiri19 likes this.
  3. Harrington

    New Member

    Dec 19, 2009
    86
    3
  4. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    Thx, u were so helpful. (if u want i can recommand u some further sites...i already had these ones)
     
  5. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    btw...i already solved the problem, so no need for help anymore (@Harrington: college must have been a hard period for you, you seem to have big scars. happens. :)
    1. i didnt tell you i needed it for school you wouldn't have known
    2. even my coordinator prof saw i was writting on the forum. so i suppose I saved his time from "spying" on me
    3. if you are frustrated a forum is not the best place to exteriorize it...see, everyone can notice it and it could get a bit pathetic...just a friendly advice)
     
  6. Harrington

    New Member

    Dec 19, 2009
    86
    3
    More than welcome Oh by the way College wasn't hard at all I got distinctions I also found university very enjoyable as well and a distinct difference in attitudes and determination to succeed

    I also managed to obtain distinctions for my exams at University as well I didn't have to go and ask other people to do my assignments for me or do the research

    I have attended most major manufactures courses in the UK covering every thing from Radio , Tv , Audio , general household appliances , RF communications , networking and programming ,

    Plus I have taught myself most of what i know including 4 other languages which I had no help on at all just shear determination to want to learn !! Big difference and extremely challenging yes but as for having a hard time No I didn't have a hard time with this at all i had a hard time with people with really nasty attitudes and violent behavior , thieving crime and breaking and damaging shops etc Yes 100% but not with college and learning or wanting to be different to them and successful No that I never had a problem with

    I taught myself how to design circuits and PCB's and make them as well and program embedded devices in 3 languages assembler C and Pic basic No one helped me to do this

    I did this on my own

    I also speak two languages fluently read, write ,and speak and i didn't quite grow up to be like some of you with a real attitude problem !!

    ESPECIALLY WITH COLLEGE LECTURERS AND UNIVERSITY Lecturers and I came to this country with just a suitcase and exactly £20,00 no where to live , no job ,no nothing starting work from the ground floor up pulling nails out of floors washing floors working or nightclubs , making teas and coffees and working my way up from nothing So before you start shouting lets see you do it

    But at this moment your the one that's asking fro help not me !!
     
    Last edited: Jul 13, 2010
  7. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    bravo :) .......................
     
    Harrington likes this.
  8. Harrington

    New Member

    Dec 19, 2009
    86
    3
    At last finally your learning
     
  9. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    i should use a sarcasm sign for you to sense it?
    it is pretty sad for you that you need forums to brag. you are quite insecure, aren't you?
     
  10. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    So did you work out the problem that this thread was created for?
     
  11. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    In case this helps, I've solved a similar problem on a microcontroller by keeping four separate numbers in the controller. The counter would increment the numbers 0 through 9 and would handle the rollover, so that way, the numbers would be already separated into decimal digits for display.

    On the microcontroller, it turned out that it was much easier to write counter code to count 0-9 then overflow than it was to decompose one large number into decimal digits.
     
    spiri19 likes this.
  12. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    yes..:)
    I actually created for loops for every digit, separating them this way...even if a for loop appearantly is eating up a lot of resources.
    I finished my project...but still got some extra tasks given yesterday. Now I am fighting for some resources for some extra calculations :(
     
  13. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    Thx for the help, davebee... I actually tried something similar, but I had to count down as well...and didnt see how could it recognize at 0 point if it should increment or decrement.
    But really thanx for the help:)
     
  14. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    You should be able to use a 'programmable' counter or even a uC to recognize what pins are high on the 7 segs, to match it to a number in a list.

    IE, if segs b and e are being lit, then its a 1.

    You could run the 7 leads from the 7 seg to a uC inputs. It would be pretty easy from there.
     
    spiri19 likes this.
  15. Harrington

    New Member

    Dec 19, 2009
    86
    3
    I doubt it he needs someone to do his assignments for him
     
  16. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    will you just shut up, when you have no wise things to say? really...noone asked your opinion. keep your frustration for yourself or see a shrink. this forum is not for "I am angry to the world and I am willing to dispose it", but for "I got stuck and I need other opinions in WRITTING A SOFTWARE"
     
  17. spiri19

    Thread Starter New Member

    Jul 12, 2010
    9
    1
    Thank you...The problem is that I already have already done the PCB. I have to work with the resources I have made (actually...they were imposed :p )...
    I have a coolrunner and I have to do the counting with it. It is actually a project that will be later used in labs for students and probably they will have more assignments with this Evaluation Board.
     
Loading...