Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write the code in C++ and explain your code! Write a .cpp and .hpp file. Fibonacci LFSR Data Type Your first task is to
Please write the code in C++ and explain your code! Write a .cpp and .hpp file.
Fibonacci LFSR Data Type Your first task is to write a data type that simulates the operation of a 16 bits Fibonacci LFSR by implementing the following API: class FibLFSR { public: FibLFSR(string seed); // constructor to create LFSR with // the given initial seed and tap int step(); // simulate one step and return the // new bit as 0 or 1 int generate(int k); // simulate k steps and return // k-bit integer private: ... To do so, you need to choose the internal representation (data members), implement the constructor, and implement the three member functions. These are interrelated activities and there are several viable approaches. Constructor. The constructor takes the initial seed as a string argument whose characters are a sequence of Os and 1s. The length of the register is the length of the seed. We will generate each new bit by XoRing the leftmost bit and the tap bit, when using resulting bit as one of the inputs for the next or gate, and so on. There are 3 tabs for this assignment in positions 13, 12, and 10 (see diagram 2). For example, the following code should create the FibLFSR described above. FibLFSR flfsr("1011011000110110"); Destructor. If your constructor dynamically allocates memory, make sure to define a destructor that deallocates it. String representation. Overload the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started