Question
Code in C++ please and show screenshots of the outputs Tips for Calculating the Hamming code: The key to the Hamming Code is the use
Code in C++ please and show screenshots of the outputs
Tips for Calculating the Hamming code: The key to the Hamming Code is the use of extra parity bits to allow the identification of a single error. Create the code word as follows:
1. Mark all bit positions that are powers of two as parity bits. (positions P1, P2, P4, P8, P16, P32, P64, etc.)
2. All other bit positions are for the data to be encoded. (positions D3, D5, D6, D7, D9, D10, D11, D12, D13, D14, D15, D17, etc.)
3. Each parity bit calculates the parity for some of the bits in the code word. The position of the parity bit determines the sequence of bits that it alternately checks and skips.
P1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc. bit positions (1,3,5,7,9,11,13,15,...)
P2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc. bit position (2,3,6,7,10,11,14,15,...)
P4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc. bit position (4,5,6,7,12,13,14,15,20,21,22,23,...)
P8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc. bit position (8-15,24- 31,40-47,...) etc.
4. Set a parity bit to 1 if the total number of ones in the positions it checks is odd. Set a parity bit to 0 if the total number of ones in the positions it checks is even.
Lab4 objectives - This program lab lets students to design and implement a program that can detect and/or correct errors using Hamming code. Students can program it either using Python, MatLab, Java, C/C++. Lab description - Refer to the screen shot below for program description and requirement. Lab2-Hamming Code Enter number of data bits - M: The number of check bits - R : Lab deliverable - A lab report that includes: (1) an algorithm or flow chart show that logic of code generation and detection/correction. (2) Show one example of code in steps how you program generates them and how you program runs (using screen shots) for each step. (3) Provide a program source code in a zip files
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