Question: Complete the following function in C To complete the code in `lfsr.c` and produce a working LFSR you need to write two functions. These are
Complete the following function in C
To complete the code in `lfsr.c` and produce a working LFSR you need to write two functions. These are the `read_lfsr` and `next_state` functions shown below.
``` int read_lfsr(LFSR* L) { /*Return the current output bit (the rightmost bit of the state variable) */
/* You implement this*/
return 0; // remove this line when you properly implement the function.
}
As described in the comments, the `read_lfsr` function should return the rightmost bit of the LFSR `state` variable. Note that `L` is passed as a pointer, so the `state` field must be accessed as `L->state` not `L.state`.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
