It would need to be an 8bit LFSR. Assembly code is compiled with nasm i386Pg. 1
Programming Assignment 6
Linear feedback shift register
Step 1. Creating the assembly language file
Everything should be done the same way as the previous assignment.
Step 2. The application area
The wikipedia article is a bit math-heavy, but gives a good description of the many
Here is a more hardware-oriented description.
Here is a summary explanation that does not involve a hardware description. You
are familiar with the shift left and shift right instructions. These move all the bits in
the register to the left or right respectively by a specified number of bit positions.
Let's suppose that we shift by one position. Then a new bit value will enter at the
least or most significant end of the register respectively. The value of the new bit
would be zero if shifting to the left. Shifting to the right, the new bit is a zero for a
logical shift, and a duplicate of the sign bit for an arithmetic shift.
A linear feedback shift register (LFSR) is a shift register whose input bit is
a linear function of its previous state.
The only linear function of single bits is XOR, thus it is a shift register whose input
bit is driven by the
(XOR) of some bits of the overall shift register value.
In a LFSR, the new bit is neither of those, but some arbitrary function of the existing
bits in a register. Depending on the function, as the shifts repeat, the successive
values in the register will go through a repeating sequence. It can be shown that the
maximum length of the sequence for an
-bit register is 2
-1 if you chose the best
function. Other functions may give shorter sequences.
CmpE102 Spring 2017 Programming Assignment 6