Q1 to Q3 CS365 Homework 4 Due March 8, 2018 Max Points: 25 Each question is wort
ID: 3724423 • Letter: Q
Question
Q1 to Q3
CS365 Homework 4 Due March 8, 2018 Max Points: 25 Each question is worth 5 points Question 1 The folkwing binary number is an 8-b2 value encoded with Hamening Code error detection and correction bils. For this number, the MSB is to the left and the LSB is to the right. What is the original 8-bit value? 10111010 0 0 0 1 0 Question 2 This is also an 8-bt value that has been encoded. Unfortunately, there is an error in this number! What is the cortect 8-bt value? 0 1 001011 1 0 11 0 Question 3 Please encode this 8-bit number with Hamming Code errer detection and correction bits 11 0 0 0 1 1 0Explanation / Answer
1)
Encoded value: 1 0 1 1 1 0 1 0 0 0 0 1 0
Remove all the parity bits, parity bits are positions of power of 2 i.e. 1,2,4,8,16....
1 2 3 4 5 6 7 8 9 10111213 index
1 0 1 1 1 0 1 0 0 0 0 1 0 bits
- - - - parity bits
1 1 0 1 0 0 0 1 0 original value
2)
Encoded value: 0 1 0 0 1 0 1 1 1 0 1 1 0
Mark parity bits and check if are set correctly:
For parity 1 check (1,3,5,7,9,11,13,15,...) bits
For parity 2 check (2,3,6,7,10,11,14,15,...) bits
For parity 4 check (4,5,6,7,12,13,14,15,20,21,22,23,...) bits
For parity 8 check (8-15,24-31,40-47,...) bits
1 2 3 4 5 6 7 8 9 10111213 index
0 1 0 0 1 0 1 1 1 0 1 1 0 bits
- - - - parity bits
It should b even parity including parity bit:
For parity 1 : check 1,3,5,7,9,11,13 = 0 0 1 1 1 1 0 even
For parity 2 : check 2,3,6,7,10,11 = 1 0 0 1 0 1 odd (wrong)
For parity 4 : check 4,5,6,7,12,13 = 0 1 0 1 1 0 odd (wrong)
For parity 8 : check 8-15 = 1 1 0 1 1 0 even
Error in bit 2+4 = 6th bit
So correct code is : 0 1 0 0 1 1 1 1 1 0 1 1 0
3)
Original data : 1 1 0 0 0 1 1 0
Insert parity bits and fill those bits as per even parity:
1 2 3 4 5 6 7 8 9 101112 index
_ _ 1 _ 1 0 0 _ 0 1 1 0
For parity 1 : check 1,3,5,7,9,11 = ? 1 1 0 0 1 => set 1 to 1
For parity 2 : check 2,3,6,7,10,11 = ? 1 0 0 1 1 => set 2 to 1
For parity 4 : check 4,5,6,7,12 = ? 1 0 0 0 => set 4 to 1
For parity 8 : check 8-12 = ? 0 1 1 0 => set 8 to 0
Encoded value : 1 1 1 1 1 0 0 0 0 1 1 0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.