Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint16_t shiftRegister(){
- static uint16_t LFSR = 44257; // Start value
- int bit = 0;
- int mask = ((sizeof(uint16_t) * BITSPERBYTE) - 1);
- uint16_t result = 0;
- //maskbit for checking the state of position 16 14 13 11
- uint16_t maskBit = 0b0000000000101101;
- result = LFSR & maskBit;
- bit = LFSR ^ result;
- LFSR = LFSR >> 1 | result << mask;
- printf("%dt", LFSR);
- printInBinary(LFSR);
- return LFSR;
Add Comment
Please, Sign In to add comment