computerarchitecture.yolasite.comcomputerarchitecture.yolasite.com/resources/sheet 5 6 …  · web...

4
CS 207D- Computer Architecture Second Semester 1435/1436H Sheet #5 6 Princess Noura Bint Abdulrahman University Faculty of Computer and Information Sciences Department of the Computer Sciences ( Q1:Answer yourself Q2: Suppose an 8-bit data word stored in memory is 11000011. Using the Hamming algorithm, a) Determine what check bits would be stored in memory with the data word. Show how you got your answer. The check bits are in bit numbers 8, 4, 2, and 1. Check bit c8 = D12 ® D11® D10 ® D9 =1®1®0®0=0 Check bit c4= D12® D7® D6® D5 =1®0®0®1=0 Check bit c2 =D11® D10® D7® D6 ® D3 =1®0®0®0®1=0 Check bit c1 =D11® D9® D7® D5 ® D3 =1®0®0®1®1=1 Thus, the check bits are: 0 0 0 1 b) Suppose, for any reason the data bit in position 7 is error read, show how the error detected and corrected? The error is detected where the reading data changed to 11001011 instead of 11000011, and the check bits reading 0110 instead of 0001 0110 ® 0001 ……..

Upload: vuongdang

Post on 05-Feb-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: computerarchitecture.yolasite.comcomputerarchitecture.yolasite.com/resources/sheet 5 6 …  · Web viewCS 207D- Computer Architecture. ... Suppose when the word is read from memory,

Q1:Answer yourself

Q2: Suppose an 8-bit data word stored in memory is 11000011. Using the Hamming

algorithm, a) Determine what check bits would be stored in memory with the data

word. Show how you got your answer.

The check bits are in bit numbers 8, 4, 2, and 1. Check bit c8 = D12 ® D11® D10 ® D9 =1®1®0®0=0Check bit c4= D12® D7® D6® D5 =1®0®0®1=0Check bit c2 =D11® D10® D7® D6 ® D3 =1®0®0®0®1=0Check bit c1 =D11® D9® D7® D5 ® D3 =1®0®0®1®1=1Thus, the check bits are: 0 0 0 1

b) Suppose, for any reason the data bit in position 7 is error read, show how the error

detected and corrected?

The error is detected where the reading data changed to 11001011 instead of

11000011, and the check bits reading 0110 instead of 0001

0110 ®

0001

……..

0111 position 0111=position 7 has error so it is reading by wrong 1 and

corrected to 0

Position 12 11 10 9 8 7 6 5 4 3 2 1

Position

in binary

110

0

1011 1010 1001 1000 0111 0110 0

101

0100 0011 001

0

0001

Data 1 1 0 0 0 0 1 1

Check 0 0 0 1

CS 207D- Computer ArchitectureSecond Semester 1435/1436HSheet #5 6

Princess Noura Bint Abdulrahman UniversityFaculty of Computer and Information

SciencesDepartment of the Computer Sciences

Page 2: computerarchitecture.yolasite.comcomputerarchitecture.yolasite.com/resources/sheet 5 6 …  · Web viewCS 207D- Computer Architecture. ... Suppose when the word is read from memory,

Q3: Answer yourself

Suppose an 8-bit data word stored in memory is 11100010. Using the Hamming

algorithm, determine what check bits would be stored in memory with the data word.

Show how you got your answer.

Positio

n

12 11 10 9 8 7 6 5 4 3 2 1

Positio

n in

binary

Data

Check

a. Detect the error position if the key of the previous data was 0010 and write the

data after correction

b. How many check bits are needed if the Hamming error correction code is used

to detect single bit errors in a 256-bit data word? Show how you get your result.

Q4: For the 8-bit word 00111001, the check bits stored with it would be 0111.

Suppose when the word is read from memory, the check bits are calculated to be

1101.What is the data word that was read from memory?

The Hamming Word initially calculated was:

bit number:

Page 3: computerarchitecture.yolasite.comcomputerarchitecture.yolasite.com/resources/sheet 5 6 …  · Web viewCS 207D- Computer Architecture. ... Suppose when the word is read from memory,

12 11 10 9 8 7 6 5 4 3 2 10 0 1 1 0 1 0 0 1 1 1 1

Doing an exclusive-OR of 0111 and 1101 yields 1010 indicating an error in bit 10 of the Hamming Word. Thus, the data word read from memory was 00011001.

Q5: How many check bits are needed if the Hamming error correction code is used

to detect single bit errors in a 1024-bit data word?

Need K check bits such that 2K – 1 >= 1024 + K. The minimum value of K that satisfies this condition is 11.