You are on page 1of 12

1

1
Topics
Hamming algorithm
Magnetic disks
RAID
2
Hamming Algorithm
In a Hamming code
r parity bits added to m-bit word
Forms codeword with length (m +r) bits
Bit numbering
Starts at 1 with leftmost (high-order) bit
All powers of 2 are parity bits
Remaining bits are for data
2
3
Bit Numbering for Hamming Algorithm
__ __ __ __ __ __ __ __ __ __ __ __
1 2 3 4 5 6 7 8 9 10 11 12
0 0 0 0 0 0 0 0 0 0 0 0
Parity bits (powers of 2)
Data bits (remaining bits)
Given an 8-bit data word to encode
4
Parity Bit Assignment
8, 4 0 0 1 1 12
8, 2, 1 1 1 0 1 11
8, 2 0 1 0 1 10
8, 1 1 0 0 1 9
9, 10, 11, 12 0 0 0 1 8
4, 2, 1 1 1 1 0 7
4, 2 0 1 1 0 6
4, 1 1 0 1 0 5
5, 6, 7, 12 0 0 1 0 4
2, 1 1 1 0 0 3
3, 6, 7, 10, 11 0 1 0 0 2
3, 5, 7, 9, 11 1 0 0 0 1
1s 2s 4s 8s
Encodes Encoded
by
Bit No. in Binary Bit No.
3
5
Method for Parity Check
For parity bit 1
b
1
b
3
b
5
b
7
b
9
b
11
For parity bit 2
b
2
b
3
b
6
b
7
b
10
b
11
For parity bit 4
b
4
b
5
b
6
b
7
b
12
For parity bit 8
b
8
b
9
b
10
b
11
b
12
Even parity 0
Odd parity 1
6
Boolean Exclusive Sum - XOR Function
Logic operation
Output is true when
either input is true but
not both
Corresponds to addition
in base 2
0 1 1
1 0 1
1 1 0
0 0 0
F B A
F = A B
A
B
F
Truth table for XOR function
4
7
Class Exercise
Compute the codeword for the 8-bit data:
1001 0110
__ __ __ __ __ __ __ __ __ __ __ __
1 2 3 4 5 6 7 8 9 10 11 12
1 0 0 1 0 1 1 0 1 0 1 0
8
Bit 1 checks: 1, 3, 5, 7, 9, 11 incorrect
Bit 2 checks: 2, 3, 6, 7, 10, 11 incorrect
Bit 4 checks: 4, 5, 6, 7, 12 correct
Bit 8 checks: 8, 9, 10, 11, 12 incorrect
Class Exercise
Find the bit that is incorrect in the following
codeword. This 12 bit codeword encodes 8
data bits.
1100 1110 0001
Bit 11
5
9
For Further Study
Article on parity and non-parity main memory
http://www.pcguide.com/ref/ram/err.htm
10
Memory Hierarchy
Down the hierarchy:
Increased access time
Increased storage
capacity
Increased number of
bits per dollar
6
11
Storing Data on a Magnetic Disk
Tracks are concentric circles on a platter
Sectors are pie-shaped wedges on a track
Cylinders are a set of tracks at a given radial distance
12
Data Transfer Time
Seek move to correct
radial position (cylinder)
Rotational latency desired sector
located under read/write head
7
13
Formatting a Track
14
Photo of Disk Head, Arm, Actuator
Adapted fromDavid Pattersons CS 252 lecture notes. Copyright 2001 UCB.
Actuator
Arm
Head
Platters (12)
Spindle
8
15
(Not So) Floppy Disk
Small removable medium to distribute S/W
General characteristics the same as hard disk
Except the floppy disk read/write heads touch the
disk, causing extra wear and tear
16
Standard way to connect storage device to computer
Hard drives, internal floppy drives, CD-ROM drives, and
even some tape backup drives
Extended IDE for Logical Block Addressing (LBA)
Required to address larger drives
(2
24
1) sector numbers are converted to head, sector,
and cylinder addresses
http://computer.howstuffworks.com/ide.htm
Integrated Drive Electronics (IDE)
9
17
Small Computer System Interface (SCSI)
Benefits of SCSI:
Speed up to 160 megabytes per second (MB/s)
Reliability
Can put multiple devices on one bus
Compatible with most computer systems
Potential problems when using SCSI:
Requires configuration for a specific computer.
Limited system BIOS support.
Numerous variations (speeds, connectors)
No common software interface
18
Small Computer System Interface (SCSI)
http://computer.howstuffworks.com/scsi.htm
10
19
IDE/EIDE vs. SCSI
IDE/EIDE
Low-cost
Intel-based systems
Allow only one active
device at a time
Lower data transfer rate
SCSI
High-cost
Standard in UNIX
workstations
All devices run at once
Higher data transfer rate
20
Redundant Arrays of (Inexpensive) Disks
Files are "striped" across multiple disks
Redundancy yields high data availability
Availability: service still provided to user, even if
some components failed
Disks will still fail
Contents reconstructed from data
redundantly stored in the array
Capacity penalty to store redundant info
Bandwidth penalty to update redundant info
Adapted fromDavid Pattersons CS 252 lecture notes. Copyright 2001 UCB.
11
21
RAID Levels 0 Through 5
Backup and
parity drives
are shaded
22
RAID Level 1 Disk Mirroring
Each disk is full y duplicated onto its mirror
Most expensive solution
100% capacity overhead
12
23
Exercise
RAID level 3 is able to correct single-bit errors
using only one parity drive. What is the point of
RAID level 2? After all, it also can only correct
one error and takes more drives to do so.
24
Exercise Answer
RAID level 2 can not onl y recover from crashed
drives, but also from undetected transient errors.
If one drive delivers a single bad bit, RAID level 2
will correct this with its Hamming code, but RAID
level 3 will not.

You might also like