Takes binary input die size from user and generates a random number from 1-die_size when input to roll is received. Uses clock counter for random number.
Select die size with inputs 0-6, see that die size is displaying. roll die with input 7 repeatedly, noting random numbers from 1 to die size.
PMOD output splitter PMOD dual 7-segment display
# | Input | Output | Bidirectional |
---|---|---|---|
0 | Die Size bit 0 | Dual 7 segment data 0 | |
1 | Die Size bit 1 | Dual 7 segment data 1 | |
2 | Die Size bit 2 | Dual 7 segment data 2 | |
3 | Die Size bit 3 | Dual 7 segment data 3 | |
4 | Die Size bit 4 | Dual 7 segment data 4 | |
5 | Die Size bit 5 | Dual 7 segment data 5 | |
6 | Die Size bit 6 | Dual 7 segment data 6 | |
7 | Die Roll | Source selection |