[CS61C FA20] Lecture 38.5 - Dependability- Parity, ECC, RAID: ECC Example — Transcript
Full transcript
- 0:04[Music]
- 0:08hello and welcome back to our
- 0:09dependability module
- 0:11so we have seen that there do exist
- 0:12codes that not only can detect
- 0:15errors but can also correct them
- 0:19but the example that we have shown is
- 0:21not a very practical one because it has
- 0:23a lot of
- 0:24of of overhead in order to
- 0:28encode what was worth one bit of
- 0:30information
- 0:31we used three bits so we had 200
- 0:35overhead there the trick here and the
- 0:38science is
- 0:39how to design these codes such that we
- 0:42get the desired coverage with minimal
- 0:45amount of overhead
- 0:47and desired coverage here is said that
- 0:50single error detection
- 0:52single error correction with double
- 0:55error detection
- 0:56so hamming came up with those codes as
- 0:59well
- 1:01and here is how it goes we will start
- 1:04with data bits the result of our
- 1:05calculation
- 1:07and we are going to interleave parity
- 1:10bits with those data bits to
- 1:12form the code word that we're going to
- 1:13store in the memory
- 1:15in this case there is a particular
- 1:19algorithm how
- 1:20they are being put together
- 1:24so here is how the interleaving works
- 1:28on top of this table here we have bit
- 1:30positions
- 1:31of the code words that are going to be
- 1:35stored in the memory
- 1:36one two three four five and so on and
- 1:39then
- 1:40it below that encoded data bits
- 1:43are sitting at particular bit positions
- 1:46d1 is at position 3
- 1:48d5 isn't at position
- 1:52d2 is at position 5 d3 is positioned at
- 1:54position 6 and so on
- 1:56and these other bit positions
- 2:00are occupied by the parity bits p1 p2 p4
- 2:03p8 p16 and this is done
- 2:07in a particular way such that parity
- 2:09bits are essentially always at bit
- 2:11positions that correspond
- 2:12to powers of two so these are bit
- 2:15positions
- 2:16um that in binary correspond to 1
- 2:201 0 1 0 0 relatively easy to remember
- 2:25but then on the bottom here in this
- 2:28table is shown
- 2:30which data bits are covered by which
- 2:33particular parity bit so
- 2:38the first parity bit p1 covers all
- 2:41positions that have an lsb equal to one
- 2:44so
- 2:45all odd bits are covered by the first
- 2:47parity bit
- 2:48so if we include the p1 in that position
- 2:52it is going to also cover itself and
- 2:54produce
- 2:55um and and even parity
- 2:58so um essentially every other
- 3:02bit is included in the first parity what
- 3:04does it mean included
- 3:05these are basically inputs in the next
- 3:07or gate that are generating
- 3:09p1 p2
- 3:13covers all bit positions that have
- 3:17the bit that is next to the least
- 3:20significant one equal to one
- 3:21so these are essentially pairs of these
- 3:24pink fields
- 3:25that correspond you know d1
- 3:29and the 3 and 4
- 3:32and so on and then p3
- 3:35covers groups of 4 and so on
- 3:39and this can continue indefinitely but
- 3:40in practice we generally do this for a
- 3:42block
- 3:43so if you have a data word that is eight
- 3:46bits
- 3:47wide we would add four parity bits
- 3:51to encode it let's take a look at the
- 3:54example of how we actually do that
- 3:57so we are going to generate these parity
- 3:59bits
- 4:01to create even parity for each group
- 4:03let's say that we would like to
- 4:05encode a byte of data there are eight
- 4:07bits in this word here
- 4:09so we are going to create a coded word
- 4:11by placing the data bits where they
- 4:13should be and then we leave
- 4:15those spaces for our calculated parity
- 4:18bits
- 4:19so the these parity bits should be
- 4:21placed in their appropriate bit
- 4:23positions
- 4:24so the first bit first parity bit goes
- 4:27into a bit position one
- 4:29so let's calculate them let's go through
- 4:30that example so
- 4:32position one is going to be checking
- 4:34bits one three five
- 4:36seven nine and eleven
- 4:40so we are going to mark those bits in
- 4:43yellow
- 4:43and count how many ones are there one
- 4:47two three four therefore
- 4:50in order to make even parity that parity
- 4:52bit should be equal to zero
- 4:54in position 2 it is going to be checking
- 4:56pairs of bit
- 4:582 3 6 7
- 5:0110 11. how many
- 5:04ones are there there are three therefore
- 5:07in order to make it even parity we
- 5:08should make this question mark
- 5:10equal to one
- 5:13then we take a look at position four
- 5:16checks
- 5:17markup appropriate bits we have only one
- 5:21uh one among the yellow bits therefore
- 5:24that should be also equal to one and
- 5:27finally
- 5:28um for position eight checks we have the
- 5:30last
- 5:31four bits that participate in that xor
- 5:33there are two ones among them therefore
- 5:35this question mark should be equal to
- 5:37zero all right
- 5:39so this is our final code word
- 5:43it consists of the data word and the
- 5:46parity checks
- 5:48but let's you know don't look at the
- 5:50correct answer let's suppose we receive
- 5:52something and we'd like to decode
- 5:54if the the word is correct if it is not
- 5:56correct we'll like to
- 5:57correct it so suppose we receive this we
- 6:00will map it
- 6:01to appropriate bit positions and we'll
- 6:03find out that the bit zero one in the
- 6:06first two bit positions are parity bits
- 6:07there is another one over here there is
- 6:09a parity bit
- 6:10p4 and finally there is a parity bit p8
- 6:13at the bit position 8. the rest are the
- 6:16data bits
- 6:17let's figure out if the bit if the work
- 6:19is correct
- 6:20so we receive this and we're going to
- 6:23run the parity checks well
- 6:25for the first parity check we're going
- 6:26to figure out all the bits that you know
- 6:28parity bit and the data bits that
- 6:29correspond in that check
- 6:31and the number is even so it's good it
- 6:33passes
- 6:35the second one has this the p2 parity
- 6:39has one two three four five once so it's
- 6:43not good it's not correct
- 6:44that one does have
- 6:48an error
- 6:51then we are going to check the bit p4
- 6:54it has two ones in that check so that is
- 6:57going to be correct that
- 6:58that check is going to be fine and
- 7:01finally
- 7:02p8 bit is an error because it has three
- 7:05ones
- 7:06and then there is a very simple way how
- 7:08we calculated which
- 7:09bit position is the error and you can
- 7:11work out the algebra it's very simple
- 7:13it's very uh elegant
- 7:15um it this implies that the bit position
- 7:17is equal to the sum
- 7:19of the two parity bits p2 and p8
- 7:22so the the error is going to bit be in
- 7:25the
- 7:25bit position 10. what should we do to
- 7:27fix that
- 7:28we just go ahead and flip that in
- 7:30correct bit turn it into a zero
- 7:33then we decode this
- 7:37to make sure that it is correct
- 7:39miraculously
- 7:40all the checks are satisfied and we have
- 7:43decoded
- 7:44the correct word very well
- 7:47now what should we do if
- 7:51we have to deal with systems that have
- 7:53that can have more than one bit in error
- 7:56so if you look at high-end
- 7:59microprocessors they typically use
- 8:01seg codes single error correction double
- 8:05error detection but some of the server
- 8:07processors
- 8:08were that they're working with more
- 8:10valuable work though loads
- 8:12are going to have protection for to
- 8:15to to perform correction on two bits
- 8:18so there is a different type of a
- 8:21hamming code that is called
- 8:22double error detection triple error
- 8:24detection
- 8:26or dicted we're not going to go into it
- 8:31and you know there are plenty of
- 8:32references of that
- 8:34but generally when we work with
- 8:36something that is noisier than
- 8:37microprocessors like
- 8:38sending data over wi-fi or network
- 8:40transmissions and so on
- 8:42we are going to see a lot more errors
- 8:45and these errors are often going to be
- 8:47bursty and we are going to see different
- 8:49ways how
- 8:49redundancy is added there are generally
- 8:54things that we're going to encounter
- 8:56there
- 8:57like cyclic error correction
- 9:01for their correction and
- 9:05things like interleaving to break up
- 9:08these patterns
- 9:09and attack them with codes that can
- 9:12cover fewer errors but that's way
- 9:18past the content of this course
- 9:22that is it um this is all what we are
- 9:25going to cover here
- 9:26regarding correction of soft errors and
- 9:29that is typically something that we are
- 9:31going to do in the memory
- 9:33we are going to see a different view of
- 9:36redundancy
- 9:37just after a quick break
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 38.5 - Dependability- Parity, ECC, RAID: ECC Example by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,392 words across 246 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.