Question: Hello, I'm writing an assembly language program on a Raspberry Pi 3, using the ARM assembly instruction set. The program is a random number generator.

Hello,

I'm writing an assembly language program on a Raspberry Pi 3, using the ARM assembly instruction set. The program is a random number generator. The suggested solution is provided, all I must do is code it. I am specifically wondering about how I should grab a initial seed value for my program. I believe I am intended to use ticks from the system clock in the RPi, but I am not sure where that value is located in memory, or how to call it otherwise.

Solution to RNG function here:

m_w = ; // must not be zero m_z = ; // must not be zero uint32_t get_random() { m_z = 36969 * (m_z & 65535) + (m_z >> 16); m_w = 18000 * (m_w & 65535) + (m_w >> 16); return (m_z << 16) + m_w; // 32-bit result }

Any advice or solutions for this issue would be appreciated.

Thank you for your time and consideration.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!