Linear Feedback Shift Register (part A)
We'll be completing the linear feedback shift register assignment described at http://www.cs.princeton.edu/courses/archive/fall13/cos126/assignments/lfsr.html.
For this portion of the assignment, you will:
- implement the LFSR class
- implement unit tests using the Boost test framework.
Please do the following:
- Install Boost or use the CS cluster. See http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/ for an introduction to installing and using Boost.
- Per the Princeton assignment, implement the LFSR class, with the following methods:
- constructor which accepts a String of 1s and 0s and a tap position;
step()function of zero args which returns an
intthat will be a zero or a one;
generate(int k)function that returns a k–bit integer;
- an overload of the
<<stream insertion operator to display its current register value in printable form (see these instructions)
- A number of unit tests in Boost, in a file
test.cpp. Here is a starter file for your tests: Attach:test.cpp. (This will be discussed further on Monday.)
- Create a Makefile or include short, direct instructions for how to build your project.
Submit your code files
LFSR.hpp plus your Makefile or make instructions. If you additionally have a
main.cpp file with some printf-style tests, you may include that too:
submit fredm 204-ps4afiles
main file is not required for this assignment.
|core implementation||4||full & correct implementation=4 pts; nearly complete=3pts; part way=2 pts; started=1 pt|
|Makefile||2||Makefile or explicit build/link instructions included|
|your own ||2||should have at least 3 test cases for full credit|