Write a program in C and in MIPS assembly language program that generates pseudorandom 32 bit numbers using a linear feedback shift register.
See Wikipedia entry on LFSR: https://en.wikipedia.org/wiki/Linear-feedback_shift_registerLinks to an external site.
The entry above includes example C code for a 16 bit LFSR
The function should have one int argument and return value as in the prototype:
int lfsr32 ( int n );
If argument n==0, your lfsr32 function must save in memory and return 32 new LFSR bits (32 shift/XOR operations since 1 new bit per shift) based on the last result
If argument n!=0, your lfsr32 function should save the seed value n in the memory location holding the LFSR value.
Start with initial seed value 0x55AAFF00 and write a main() function that calls your lfsr32 function and prints out the first 10 unsigned 32 bit random number values.
Use taps / bits numbered 32,22,2,1 where bit 1 is the left-most bit and bit 32 is the right-most.
You must submit THREE files:
1) Your .asm MIPS assembly file
2) Your .c source file
Uncategorized
Write a program in C and in MIPS assembly language program that generates pseudo
- Posted
- AuthoradminX
- Length172 words
- Reading time1 min
Make your next academic task easier to manage
Tell us what you are working on and take the next step with Treatisely.