# Generating pseudo-random numbers with restricted hardware

I have a need to generate a 448-bit value that appears random, for use in a test circuit. The "randomness" of the values is not overly important; the size of the generator hardware is. I am using an FPGA and I have a budget of ~32 logic elements (in Altera lingo, a LE is a LUT plus an FF).

One possible solution that comes to mind would be to make a 32-bit LFSR, and then use some logic functions/combinations of those bits to generate the 448-bit output.

Is there any other clever solution?

Edit: I'm adding some detail because some have pointed out that it is not possible to create a circuit with 448 output bits using only 32 logic elements.

The block I'll be feeding the "random" values does register all 448 bits at its input port. Though I can't touch the VHDL code of that block, the LUTs that feed those registers can be used for combinational logic by the synthesizer. So though it is true I can't create a circuit with 448 output bits using only 32 LUTs, this is not a problem in this particular case, because only the number of registers is a hard limit.

• Add some noisy analog sensor, convert to digital and just output it's LSB over time.. (if it is not too much hardware) Jan 23, 2015 at 16:56
• Or run two counters with different top values and different frequencies and output, say, xored value of them. Jan 23, 2015 at 16:59
• Your budget seems unrealistic. Won't you need 448 flip-flops just to store the value? Or if you have a 32-bit value and generate 448 "random-like" results with combinatorial logic, you'll need 448 LUTs to do that. Jan 23, 2015 at 17:08
• @ThePhoton, the value will be stored internally by the circuit that uses the random values as an input. Therefore, it should be ok to generate only 32 "true random" bits, and use combinational logic for the rest, so it should be possible to generate a 448-bit output using only 32 flip-flops. But you are right, the LUTs would be counted as part of the LEs of the circuit under test.
– rick
Jan 23, 2015 at 17:31
• Ring oscillator? That's how I've seen people do it alterawiki.com/wiki/Ring_Oscillator Jan 23, 2015 at 19:30