Description: Instantiate-able electronic dice module that returns a pseudo-random integer between 1 and 6. Can be easily inserted into any dice based game. The randomness is inserted by the human who presses the button at random times. More than one dice can be instantiated using the clock divider. The clock divider slows down the counter by an integer factor so that each dice is rolling at a different rate. This should be plug and play with nearly any FPGA.
Story: My idea is to build a simple craps-like game on my nandland GoBoard (the GoBoard is a very simple, entry level FPGA dev board supported by nandland.com). To do this, I needed dice that I could instantiate in the TOP level of my game module. I figure since a human will always press the button at a random time then a simple counter from 1 to 6 will do the job. When the button is pressed, the current count is captured as the dice roll output.
Fully simulated with testbench on eda playground at:
https://www.edaplayground.com/x/JRe6
This code is free and open to anyone to use. Knock yourself out, but don't be shooting too many dice and lose all your money.
Comments
Please log in or sign up to comment.