EmbDev.net

Forum: FPGA, VHDL & Verilog Easy way to use LEDR to show the duplicate numbers?


von James D. (edc1994)


Rate this post
useful
not useful
I am working for a simple slot machine by using VHDL, the specifition 
let me to show the duplicate numbers which is the result of the spin. It 
could be many duplicates of the same number or different numbers have 
appeared at least twice.
For example,
if the number is 278551 then there are two 5 to lit two LEDR
if the number is 578551 then there are three 5 to lit three LEDR
if the number is 278558 then there are two 5 and two 8 to lit four LEDR
if the number is 578558 then there are three 5 and two 8 to lit five 
LEDR
if the number is 585885 then there are three 5 and three 8 to lit six 
LEDR
if the number is 777777 then there are six 7 to lit six LEDR
So is there any simple way to implement this function? I was trying to 
use FSM but it looks to complicated.
Needs some help :)

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
James D. wrote:
> I was trying to use FSM but it looks to complicated.
Of course you will need some kind of FSM. Just keep in mind: each simple 
counter is a FSM. And you need at least 6 counters counting randomly and 
independently from 0 to 9 for your 6 digit "number".

Or do you only have 1 counter counting from 000000 to 999999? That would 
not look very "slotmachinelike"...

> I was trying to use FSM but it looks to complicated.
For a slot machine the top FSM ist the one that handles the slot machine 
itself: waiting for the start button, spinning the "wheels", evaluating 
the result. Your "evaluation" FSM will have to go thru the digits and 
compare them.
All in all its a fairly easy job to be done. But first you need a 
strategy HOW to find doubles/multiples in the "wheels".

> Needs some help :)
Just show what you have, then we can discuss about how to go further on.

> if the number is
What about 234234?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.