Question: The following program is about 80% complete. Professor want to be done using a functions provided in the picture below. Please help to add missing

The following program is about 80% complete. Professor want to be done using a functions provided in the picture below. Please help to add missing functions to the code such as: menu, channel function, detector function etc. If possible please provide a flowchart also. Thank you in advance.

// hamming code

#include #include using namespace std;

// funtion prototypes void generator(int a[11]); void display(int a[], int size); void populate(int a[11], int b[15]); void onepos(int despos[15], int hamming[15]); void binconverter(int decpos[15], int binpos[15][4]); void display2(int a[15][4]); void parity(int binpos[15][4]);

int main() { // declaration int randdata[11]; int hamming[15]; int decpos[15]; int binpos[15][4] = { 0 }; // 4 columns becuase 15 (1111)

generator(randdata); display(randdata, 11); populate(randdata, hamming); display(hamming, 15); onepos(decpos, hamming); display(decpos, 15); binconverter(decpos, binpos); display2(binpos); parity(binpos); display2(binpos); return 0; }

void generator(int a[11]) { srand(time(NULL));// new seed everytime for (int i = 0; i

////////////////////////////////////////////////////// // function that display a 1D array void display(int a[], int size) { for (int i = 0; i

void populate(int a[11], int b[15]) { int j = 0; for (int i = 0; i

if (i == 0 || i == 1 || i == 3 || i == 7) { b[i] = 2; // for check bits } else { b[i] = a[j]; j++; } } }

void onepos(int decpos[15], int hamming[15]) { int j = 0; for (int i = 0; i

void binconverter(int decpos[15], int binpos[15][4]) { int j = 3; int temp; // temp holder for (int i = 0; i0) // conversion to binay starts with LSB { if (temp % 2 == 1) { binpos[i][j] = 1; j--; // j decrement going from LSB to MSB } else { binpos[i][j] = 0; j--; } temp = temp / 2; // integer division is an integer } j = 3; } }

void display2(int a[15][4]) { // the loop will visit all the rows of the array for (int rows = 0; rows

// the child loop will visit every col for (int col = 0; col

void parity(int binpos[15][4]) { int holder = 0; for (int i = 0; i

The following program is about 80% complete. Professor want to be done

THE HAMMING CODE Transmitting from one location to another, there is always the possibility that an error may occur. There are a number of reliable codes used to encode data so that the error detected and corrected. In this lab, you will explore and implement a simple error detection correction technique called a Hamming Code. A Hamming Code used to detect and correct one-bit change in an encoded code word. This approach can be useful as a change in a single bit is more probable than a change in two bits or more bits. PHASE #1 Description: Use lecture notes to develop a plan to design and finally implement a set of functions using C++ that would implement the HAMMING CODE. Phase 1 will include the literature write up, description of the HAMMING CODE and a complete description of the functions implemented including l. Functions type void, or any data returning function 2. Type of data passed in to the functions (function parameters or arguments) 3. Type of function parameters (value or reference) 4. Global variables if needed. 5. HAMMING CODE layout and its individual parts (data, check bits) details. 6. Work out a full example from A to Z SUGGESTED FUNCTIONS PLAN: MENU To display the user options... RAW DATA GENERATER To generate a random data using C rand0...etc. HAM PACK AGER Prepare the hamming package using data collected... etc. PARITY DECIMAL COLLECTOR Function to collect the addresses of the parity bits (check bits)... etc. PARITY BINARY CONVERTER Function to convert the parity addresses from decimal to binary... etc. CHANNEL FUNCTION Function to create noise and flips on of the bits in the hamming package etc. DETECTOR FUNCTION Function that detects the bit that arrived in error...etc. DISPLAY Display the result... etc

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!