Write a program in C and in MIPS assembly language program that generates pseudo
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_register\Links 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
3) A brief report document file in .pdf .doc or .docx including:
a description of the program
2 screen shots showing both C and MIPS versions working
the .c and .asm source code pasted into the file