The pseudo-random number generator is based on LFSR. It takes three inputs:
clk
: Clock input.en
: Enable signal.rst_n
: Active-low reset signal.The generator produces 8-bit pseudo-random numbers, which can be used to control two 7-segment displays. As source of pseudo-randomnes used 2 LFSRs. One that works with 8 bit and one with 16 bit. The circuit dont have input data, just 1 clock and 1 enable pin. The output will be a 7 segment display, so 14 output pins. The 16 bit LFSR produce the input of a 16-to-8 multiplexer and the 8 bit LFSR produce the selection bits of 16-to-8 multiplexer. The 16-to-8 multiplexer is implemented by 8 2-to-1 multiplexers. The final stage is convert the data readable by 2 7 segment displays.
LFSR16 ------ bit 0 ------> | 16-to-8 mux | ------ bit 1 ------> | |----------> output 0 . | |----------> output 1 . | | . . |inputs | . ------ bit 15 ------> | | . | | | |----------> output 7 LFSR8 ------ bit 0 ------> |select | ------ bit 1 ------> | | . | | . | | . | | ------ bit 7 ------> | |
To test the pseudo-random number generator, you can follow these steps:
clk
, en
, and rst_n
signals appropriately.en
to generate and display pseudo-random numbers.7 segment display
# | Input | Output | Bidirectional |
---|---|---|---|
0 | clk | segment0 a | segment1 b |
1 | en | segment0 b | segment1 c |
2 | rst_n | segment0 c | segment1 d |
3 | segment0 d | segment1 e | |
4 | segment0 e | segment1 f | |
5 | segment0 f | segment1 g | |
6 | segment0 g | ||
7 | segment1 a |