4 (**). Richard Hamming in 1950 produced an innovative way to improve the string parity error- checking process to ensure data is accurately and reliably transmitted. Parity is often referred to as ODD or EVEN, by adding up the bit values in a string. If EVEN parity is used, the string 10110101, which has 5 bits, is appended with the value 1 to make the total number of bits even. If ODD parity is used, the same string would be appended with a 0, to maintain an odd total for all the bits, resulting in 101101010 as the transmitted string. Hamming's work produced not only a way to check if there is an error, but when the error is in the string. For a bit string of length 8, which is 2^3, 4 bits can be added to create Hammin parity string. For a string of 2^N bits, the leftmost bit is considered position 1 and the rightmost bit is position 2^N. The parity bits will be placed at each position that is a power of 2 (i.e., at positions 1, 2, 4, 8, 16, ...), with the actual data bits starting in position 3, then 5, 6, 7, 9, 10, ... and so on. For the string 10110101, which can be represented by the hex string B5, the Hammond parity string would start out a 1 2 3 4 5 6 7 8 9 10 11 12 __1_0 1 1 0 1 0 1

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

C++ please

continues in the same manner: start at position P then use P values, skip P values, and so on... Here is
the final transmitted string. The added parity bits in positions 1, 2, 4, and 8 are: 0010.
1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 1 0 1 1 0 0 1 0 1
For odd parity, the example above would result in a bit string of 1101.
1 2 3 4 5 6 7 8 9 10 11 12
1 1 1 0 0 1 1 1 0 1 0 1
Therefore, write a program given a hex string and parity type output the resulting Hamming parity
string. Input a hex string from the keyboard followed by the word EVEN or ODD to indicate the parity
separated by a space. Assume the hex string will produce no more than 128 bits and all input will be
valid. Output to the screen the resulting Hamming parity value for the given hex string. Finally, ask the
user if he/she wishes to run the program again (check case). Refer to the sample output below.
Sample Run:
Enter a hex string and parity type: ABC ODD
Hamming ODD parity string of ABC: 11101
Run again (Y/N): y
Enter a hex string and parity type: F EVEN
Hamming EVEN parity string of F: 111
Run again (Y/N): N
Transcribed Image Text:continues in the same manner: start at position P then use P values, skip P values, and so on... Here is the final transmitted string. The added parity bits in positions 1, 2, 4, and 8 are: 0010. 1 2 3 4 5 6 7 8 9 10 11 12 0 0 1 1 0 1 1 0 0 1 0 1 For odd parity, the example above would result in a bit string of 1101. 1 2 3 4 5 6 7 8 9 10 11 12 1 1 1 0 0 1 1 1 0 1 0 1 Therefore, write a program given a hex string and parity type output the resulting Hamming parity string. Input a hex string from the keyboard followed by the word EVEN or ODD to indicate the parity separated by a space. Assume the hex string will produce no more than 128 bits and all input will be valid. Output to the screen the resulting Hamming parity value for the given hex string. Finally, ask the user if he/she wishes to run the program again (check case). Refer to the sample output below. Sample Run: Enter a hex string and parity type: ABC ODD Hamming ODD parity string of ABC: 11101 Run again (Y/N): y Enter a hex string and parity type: F EVEN Hamming EVEN parity string of F: 111 Run again (Y/N): N
4 (**). Richard Hamming in 1950 produced an innovative way to improve the string parity error-
checking process to ensure data is accurately and reliably transmitted. Parity is often referred to as ODD
or EVEN, by adding up the bit values in a string. If EVEN parity is used, the string 10110101, which has 5
bits, is appended with the value 1 to make the total number of bits even. If ODD parity is used, the same
string would be appended with a 0, to maintain an odd total for all the bits, resulting in 101101010 as
the transmitted string. Hamming's work produced not only a way to check if there is an error, but wher
the error is in the string. For a bit string of length 8, which is 2^3, 4 bits can be added to create Hammin
parity string. For a string of 2^N bits, the leftmost bit is considered position 1 and the rightmost bit is
position 2^N. The parity bits will be placed at each position that is a power of 2 (i.e., at positions 1, 2, 4,
8, 16, ...), with the actual data bits starting in position 3, then 5, 6, 7, 9, 10, ... and so on. For the string
10110101, which can be represented by the hex string B5, the Hammond parity string would start out a
1 2 3 4 5 6 7 8 9 10 11 12
__1_011_0 1 0 1
To find the bit value in position 1, add up all of the odd position bits, with any blank counting as a zero.
This would be 0+1+0+1+0+0, for a total of 2, which is even, therefore no bit needs to be added, making
the value of position 1 zero.
1 2 3 4 5 6 7 8 9 10 11 12
0 1 0 1 1 0 1 0 1
To find the bit value in position 2, start at position 2 and use two bits, then skip 2, use 2, skip 2, and so
on resulting in summing the values in positions 2, 3, 6, 7, 10, and 11, for a sum of 0+1+1+1+1+0, or 4,
again even parity resulting in zero for position 2.
1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 0 1 1 0 1 0 1
To find the bit value in position 4, start at position 4 and use 4 bits, then skip 4, use 4, skip 4, and so on
resulting in summing the values in positions 4,5,6,7, and 12, for a sum of 0+0+1+1+1, or 3, needing a 1 i
position 4 to make it even parity. The value of the 8 bit would use the same pattern as the others: use 8
skip 8, and so on, summing the bits in positions 9, 10, 11, and 12, for a total of 2, even parity and zero
for position 8. In general, for a parity bit at position P, where P is a power of 2, the general pattern
Transcribed Image Text:4 (**). Richard Hamming in 1950 produced an innovative way to improve the string parity error- checking process to ensure data is accurately and reliably transmitted. Parity is often referred to as ODD or EVEN, by adding up the bit values in a string. If EVEN parity is used, the string 10110101, which has 5 bits, is appended with the value 1 to make the total number of bits even. If ODD parity is used, the same string would be appended with a 0, to maintain an odd total for all the bits, resulting in 101101010 as the transmitted string. Hamming's work produced not only a way to check if there is an error, but wher the error is in the string. For a bit string of length 8, which is 2^3, 4 bits can be added to create Hammin parity string. For a string of 2^N bits, the leftmost bit is considered position 1 and the rightmost bit is position 2^N. The parity bits will be placed at each position that is a power of 2 (i.e., at positions 1, 2, 4, 8, 16, ...), with the actual data bits starting in position 3, then 5, 6, 7, 9, 10, ... and so on. For the string 10110101, which can be represented by the hex string B5, the Hammond parity string would start out a 1 2 3 4 5 6 7 8 9 10 11 12 __1_011_0 1 0 1 To find the bit value in position 1, add up all of the odd position bits, with any blank counting as a zero. This would be 0+1+0+1+0+0, for a total of 2, which is even, therefore no bit needs to be added, making the value of position 1 zero. 1 2 3 4 5 6 7 8 9 10 11 12 0 1 0 1 1 0 1 0 1 To find the bit value in position 2, start at position 2 and use two bits, then skip 2, use 2, skip 2, and so on resulting in summing the values in positions 2, 3, 6, 7, 10, and 11, for a sum of 0+1+1+1+1+0, or 4, again even parity resulting in zero for position 2. 1 2 3 4 5 6 7 8 9 10 11 12 0 0 1 0 1 1 0 1 0 1 To find the bit value in position 4, start at position 4 and use 4 bits, then skip 4, use 4, skip 4, and so on resulting in summing the values in positions 4,5,6,7, and 12, for a sum of 0+0+1+1+1, or 3, needing a 1 i position 4 to make it even parity. The value of the 8 bit would use the same pattern as the others: use 8 skip 8, and so on, summing the bits in positions 9, 10, 11, and 12, for a total of 2, even parity and zero for position 8. In general, for a parity bit at position P, where P is a power of 2, the general pattern
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY