Core Concepts
A digital dice system is designed and implemented on an FPGA using a pseudo-random number generator (PRNG) based on the XORshift algorithm to generate random dice roll results in real-time.
Abstract
The work presents the design and implementation of a digital dice system using an FPGA. The key components include:
Tilt Detection: A tilt sensor is used to detect when the dice unit is upright and stable, triggering the dice roll.
Dice Selection and Display: Users can select the desired dice type (2, 4, 6, 8, 10, 12, 20, or 100-sided) using button inputs. The selected dice value is displayed on a 7-segment display.
PRNG for Dice Rolls: A pseudo-random number generator (PRNG) based on the XORshift algorithm is used to generate random numbers for the dice rolls. The PRNG takes a seed value from an XADC analog input to improve the randomness.
Segmented Display Processing: The raw PRNG values are processed and converted to BCD format for display on the 7-segment display.
Battery Management: A keep-awake function is implemented to prevent the module from shutting down due to low current draw from the FPGA.
UART Communication: The tens and ones digits of the dice roll are transmitted over a UART interface for logging purposes.
The authors demonstrate the functionality of the digital dice system and discuss the implementation details of the various modules. They also provide insights into the randomness of the PRNG output through statistical analysis. Further improvements to the PRNG algorithm are suggested for better randomness that matches the behavior of actual dice.
Stats
The XORshift algorithm used in the PRNG has the significant advantage of speed for real-time application.
The use of a 32-bit seed in the XORshift method makes the randomness seemingly close to a true random number generator (TRPG).
Quotes
"The XORshift algorithm used was adapted in this design, as this algorithm has the significant advantage of speed for real-time application, [1,2]."
"The use of a 32-bit seed in the XORshift method makes the randomness seemingly close to a true random number generator (TRPG)."