FPGA Digital Dice using Pseudo Random Number Generator

Michael Lim Kee Hian,Ten Wei Lin,Zachary Wu Xuan,Stephanie-Ann Loy,Maoyang Xiang,T. Hui Teo
2024-05-01
Abstract:The goal of this project is to design a digital dice that displays dice numbers in real-time. The number is generated by a pseudo-random number generator (PRNG) using XORshift algorithm that is implemented in Verilog HDL on an FPGA. The digital dice is equipped with tilt sensor, display, power management circuit, and rechargeable battery hosted in a 3D printed dice casing. By shaking the digital dice, the tilt sensor signal produces a seed for the PRNG. This digital dice demonstrates a set of possible random numbers of 2, 4, 6, 8, 10, 12, 20, 100 that simulate the number of dice sides. The kit is named SUTDicey.
Cryptography and Security,Applications
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to design a digital dice that can display the number of dice points in real - time. It uses a Pseudo - Random Number Generator (PRNG) to generate random numbers on an FPGA and provides an interactive dice - simulation experience through hardware modules. Specifically, the goals of the paper include: 1. **Real - time display of dice points**: Display the results of dice rolls in real - time through a 7 - segment display. 2. **Pseudo - random number generation**: Use the XORshift algorithm to implement an efficient Pseudo - Random Number Generator (PRNG) on an FPGA, ensuring that the generated random numbers are close enough to truly random numbers. 3. **User interaction functions**: Integrate tilt sensors and buttons, allowing users to select dice with different numbers of sides (such as 2 - sided, 4 - sided, 6 - sided, 8 - sided, 10 - sided, 12 - sided, 20 - sided, and 100 - sided), and trigger dice rolls by shaking or tilting the device. 4. **Hardware integration and optimization**: Design and implement a complete hardware module, including an FPGA board, a tilt sensor, a 7 - segment display, a power management circuit, and a rechargeable battery, all of which are packaged in a 3D - printed dice shell. ### Main technical challenges - **Quality of pseudo - random numbers**: Ensure that the random numbers generated by the PRNG have sufficient randomness and uniform distribution to simulate the behavior of real dice. - **Real - time performance**: Ensure that the results of dice rolls can be quickly displayed in a short time, providing a smooth user experience. - **Hardware reliability**: Ensure that all hardware components work together, especially remaining stable in low - power consumption and long - term operation situations. ### Solutions The paper proposes a hardware module named SUTDicey, whose core functions include: - **XORshift algorithm**: Used to generate pseudo - random numbers. This algorithm generates a random number sequence by performing multiple shift and XOR operations on itself. - **Tilt sensor**: Detects the tilt state of the device and is used as a signal source to trigger dice rolls. - **7 - segment display**: Displays the results of dice rolls in real - time and supports dice with multiple numbers of sides. - **User interaction interface**: Select dice with different numbers of sides through buttons and trigger dice rolls by shaking the device. - **Power management**: Integrates a battery and a charging module to ensure the portability and long - term use of the device. Through these design and technical means, SUTDicey has successfully realized the functions of a digital dice, providing innovative solutions for games and other application scenarios.