質問

I was wondering what would be the fastest way to generate a random number on the zedboard (Xilinx Zynq-7020) which has an ARM processor as well as an FPGA, that to my understanding both can do this.

Thanks,

役に立ちましたか?

解決

If you are developing a FPGA only or a bare metal application + FPGA project, I would generate the (pseudo)random number in the FPGA. If you are using Linux and building an embedded application + FPGA, I would generate the number in software.

If you generate the number in the FPGA, Then you can use a code template built into Xilinx ISE! Odds are you're using ISE because I doubt anything else supports Zynq yet.

Generate a LFSR in ISE like this: From the menu at the top: Edit -> Language Templates. In the language templates tree-view: (VHDL or Verilog) -> Synthesis Constructs -> Coding Examples -> Counters -> LFSR. One of the 4 templates is 32 bits. You will need to provide a seed number and a clock line.

If you generate the random number from a Linux app, there must be tons of different ways to do this. From a C application, there is a rand function in cstdlib.

他のヒント

You're probably looking for a "Linear Feedback Shift Register" or LFSR. A quick internet search will get you specifics.

Linear Feedback Shift Register is no doubt the easiest way to generate random numbers. check this document: http://www.xilinx.com/support/documentation/application_notes/xapp052.pdf everything you need is there.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top