CSCI 641 – EENG 641 1 CSCI-641/EENG-641 Computer Architecture Khurram Kazi.
Computer Science CSCI 355 Digital Logic and Computer ...
Transcript of Computer Science CSCI 355 Digital Logic and Computer ...
![Page 1: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/1.jpg)
✬
✫
✩
✪1: Computer Science CSCI 355 — Lecture 5
Computer Science CSCI 355
Digital Logic and Computer Organization
Dr. Peter Walsh
Department of Computer Science
Vancouver Island University
![Page 2: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/2.jpg)
✬
✫
✩
✪2: Computer Science CSCI 355 — Lecture 5
Hamming Code
© n = 4 m = 3
![Page 3: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/3.jpg)
✬
✫
✩
✪3: Computer Science CSCI 355 — Lecture 5
Hamming Code cont.
Parity bits cover sequences of data bits.
• p1 = d1⊕
d2⊕
d4
• p2 = d1⊕
d3⊕
d4
• p3 = d2⊕
d3⊕
d4
No data bits are covered by the same sequence of parity
bits.
• d1 is covered by p1, p2
• d2 is covered by p1, p3
• d3 is covered by p2, p3
• d4 is covered by p1, p2, p3
![Page 4: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/4.jpg)
✬
✫
✩
✪4: Computer Science CSCI 355 — Lecture 5
Hamming Code cont.
![Page 5: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/5.jpg)
✬
✫
✩
✪5: Computer Science CSCI 355 — Lecture 5
Transmit Bit Ordering
�������������������������������������������
��������������������������������
![Page 6: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/6.jpg)
✬
✫
✩
✪6: Computer Science CSCI 355 — Lecture 5
Example
© d1, d2, d3, d4 = 0110
![Page 7: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/7.jpg)
✬
✫
✩
✪7: Computer Science CSCI 355 — Lecture 5
Example cont.
• p1 = d1⊕
d2⊕
d4
⇒ p1 = 0⊕
1⊕
0 = 1
• p2 = d1⊕
d3⊕
d4
⇒ p2 = 0⊕
1⊕
0 = 1
• p3 = d2⊕
d3⊕
d4
⇒ p3 = 1⊕
1⊕
0 = 0
![Page 8: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/8.jpg)
✬
✫
✩
✪8: Computer Science CSCI 355 — Lecture 5
Example cont.
© Transmit
�������������������������������������������
��������������������������������
����������������������������������������������
![Page 9: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/9.jpg)
✬
✫
✩
✪9: Computer Science CSCI 355 — Lecture 5
Example cont.
© Receive
�������������������������������������������
��������������������������������
����������������������������������������������
![Page 10: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/10.jpg)
✬
✫
✩
✪10: Computer Science CSCI 355 — Lecture 5
Example cont.
• c1 = p1⊕
d1⊕
d2⊕
d4
⇒ c1 = 1⊕
0⊕
1⊕
0 = 0
• c2 = p2⊕
d1⊕
d3⊕
d4
⇒ c2 = 1⊕
0⊕
1⊕
0 = 0
• c3 = p3⊕
d2⊕
d3⊕
d4
⇒ c3 = 0⊕
1⊕
1⊕
0 = 0
• Syndrome = 000 ⇒ no bits in error
![Page 11: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/11.jpg)
✬
✫
✩
✪11: Computer Science CSCI 355 — Lecture 5
Example cont.
© Receive
![Page 12: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/12.jpg)
✬
✫
✩
✪12: Computer Science CSCI 355 — Lecture 5
Example cont.
• c1 = p1⊕
d1⊕
d2⊕
d4
⇒ c1 = 1⊕
1⊕
1⊕
0 = 1
• c2 = p2⊕
d1⊕
d3⊕
d4
⇒ c2 = 1⊕
1⊕
1⊕
0 = 1
• c3 = p3⊕
d2⊕
d3⊕
d4
⇒ c3 = 0⊕
1⊕
1⊕
0 = 0
• Syndrome = 011 ⇒ bit 3 in error = d1
![Page 13: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/13.jpg)
✬
✫
✩
✪13: Computer Science CSCI 355 — Lecture 5
Syndrome Size
• n data bits m parity bits
• range of m >= n+m
• 2m − 1 >= n+m
• e.g. m = 4 can protect a max of 11 data bits
![Page 14: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/14.jpg)
✬
✫
✩
✪14: Computer Science CSCI 355 — Lecture 5
Hamming Code cont.
![Page 15: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/15.jpg)
✬
✫
✩
✪15: Computer Science CSCI 355 — Lecture 5
Extended Hamming Code
• single bit error correction
• double bit error detection
• e.g. n = 4 add an extra parity bit p4 where
p4 = p1⊕
p2⊕
d1⊕
p3⊕
d2⊕
d3⊕
d4
c4 = p4⊕
p1⊕
p2⊕
d1⊕
p3⊕
d2⊕
d3⊕
d4
![Page 16: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/16.jpg)
✬
✫
✩
✪16: Computer Science CSCI 355 — Lecture 5
Syndrome and c4 Inference
• c4 = 0 and syndrome = 0 ⇒ no error
• c4 6= 0 and syndrome 6= 0 ⇒ single bit error
(can be corrected)
• c4 = 0 and syndrome 6= 0 ⇒ double bit error
(can not be corrected, detection only)
• c4 6= 0 and syndrome = 0 ⇒ p4 in error
![Page 17: Computer Science CSCI 355 Digital Logic and Computer ...](https://reader030.fdocuments.us/reader030/viewer/2022012500/6179e532edc4af559d1b4e7a/html5/thumbnails/17.jpg)
✬
✫
✩
✪17: Computer Science CSCI 355 — Lecture 5
Burst Errors
• form Hamming blocks on the ”vertical”
rather than the ”horizontal”