[CS61C FA20] Lecture 38.4 - Dependability- Parity, ECC, RAID: Error Detection and Correction — Transcript
Full transcript
- 0:04[Music]
- 0:09hello
- 0:09and welcome back to our dependability
- 0:11module
- 0:13so we have just seen how we
- 0:16introduce parity bits to detect
- 0:20errors in memory essentially what we did
- 0:24we increased the hamming distance from
- 0:26one to two
- 0:27such that a half of our possible words
- 0:29that that are stored in memory
- 0:32are invalid so if we read an invalid
- 0:36word
- 0:38we know that there has been at least one
- 0:41bit
- 0:41in error but
- 0:45we don't know which is the correct word
- 0:48that has been written into a memory
- 0:49because having distance of two is not
- 0:52large enough
- 0:53to help us perform the correction simply
- 0:57there are multiple words that are
- 1:00one bit away from correct words
- 1:04so hamming thought of ways how to add a
- 1:07little bit more redundancy
- 1:09in order to perform error correction so
- 1:12he came up with a concept of error
- 1:13correction codes
- 1:15and the minimum distance that he needed
- 1:17for that is the hamming distance of
- 1:18three
- 1:19so there is a class of codes that
- 1:21performs that they essentially do single
- 1:24error correction double error detection
- 1:26or
- 1:27are also called segment codes
- 1:30and hamming codes are an example of
- 1:33those
- 1:34he actually it's interesting how he
- 1:38figured that out he was using mechanical
- 1:40car card
- 1:41readers on all the uh
- 1:45style relay computers um and
- 1:50constantly had errors when reading his
- 1:53punch cards
- 1:54so he encoded his inputs such that he
- 1:57doesn't
- 1:58have to deal with continuous retries
- 2:01of reads conceptually here is how it
- 2:06works
- 2:06let's say that we have n bits um
- 2:10to encode and therefore there are two to
- 2:12the unpossible bit patterns
- 2:14so for example let's say that we have
- 2:15eight bits
- 2:17and therefore there will be possible 256
- 2:20bit patterns
- 2:22so you know we can represent that you
- 2:24know there would be 256 possible
- 2:27dots in this space
- 2:30if we pick a subset of those
- 2:35words as valid code words
- 2:38any other word would be a word that has
- 2:41an error
- 2:42so we would have to come up with some
- 2:45way of
- 2:46checking the legality of words and then
- 2:49we
- 2:50would perform the error correction by
- 2:52choosing
- 2:53the nearest legal code word to that
- 2:56illegal code word
- 2:59well you know and we are counting there
- 3:00the probability that a
- 3:02shorter bit error pattern is much much
- 3:05more likely than a longer bit error
- 3:07pattern so we would like to just
- 3:09go back to the closest
- 3:12legal codeword or a valid code word so
- 3:15if we have the space of 256 possible
- 3:18codewords and we just pick eight out of
- 3:20them
- 3:21generally that is a very sparsely
- 3:24populated
- 3:25pattern here and if there is a
- 3:28bit in error we would essentially go and
- 3:31snap back
- 3:32to the closest bit that closest word
- 3:36that is next
- 3:39to that invalid code word and that would
- 3:42be most likely the word
- 3:43that we have written in in the first
- 3:46place
- 3:47let's take a look at a little bit more
- 3:48illustrative example on a much simpler
- 3:50case this is a simple
- 3:52case of and there are eight code words
- 3:55that correspond to three bits um and
- 3:58they're here represented
- 4:00on a cube to show that they're you know
- 4:02which ones are
- 4:03actually adjacent to each other and have
- 4:05a hamming distance so of one
- 4:07and those that are not adjacent to each
- 4:09other are going to have
- 4:11a distance that is greater than one
- 4:15so if you look uh these that
- 4:18have um an edge that
- 4:22the chair and edge they have hamming
- 4:26distance so one if they're connected
- 4:27they have a hamming distance one so for
- 4:29example zero zero zero
- 4:30and zero zero one are one
- 4:33bit away from each other
- 4:37so if you would like to design a code
- 4:39with a hamming distance of
- 4:40two that allows us to detect single bit
- 4:43errors
- 4:44we would have to pick a half of the
- 4:47possible code words in here
- 4:50so we would pick those that have even
- 4:53parity so 0 0 0
- 4:551 1 0 1 0 1 and 0 1
- 4:591. notice that we have basically
- 5:02avoided picking any of the nearest
- 5:05neighbors
- 5:05and this is our parity code
- 5:09so these code words are invalid
- 5:12but they're simply just one bit away
- 5:15from their nearest neighbor so if we
- 5:17take a look at this
- 5:18code word zero one zero we do not if we
- 5:21read that we do not know which one um
- 5:24which word we actually wrote into the
- 5:26memory was it as 0 0 0
- 5:290 1 1 or 1 1 0. there are all three are
- 5:33equi-probable
- 5:34so in order to do that we need to have a
- 5:36little bit in order to be able to
- 5:38perform
- 5:38correction we have to have a little bit
- 5:41more sparsity or a little bit more
- 5:43redundancy
- 5:44in our code so um we need to pick
- 5:47less words so if we reduce the number of
- 5:50words to a quarter
- 5:52we can pick the two of them that are on
- 5:54the opposite edges of this cube
- 5:57so this would be a zero zero zero
- 6:00and one one one so we
- 6:03have two redundant bits out of the
- 6:07you know we are using only two out of
- 6:10eight possible patterns
- 6:13like we are using two redundant bits out
- 6:15of three
- 6:16but now if there is an error and if we
- 6:21read
- 6:21any of these bits we know
- 6:24what was the most likely pattern that we
- 6:27have
- 6:27written into the memory these
- 6:31bit patterns 0 1 0 1 0 0
- 6:34and 0 0 1 are most likely
- 6:38caused by the word 0 0
- 6:410 because they have a hamming distance
- 6:43of 1.
- 6:45similarly the other three are closer to
- 6:48one one one
- 6:50and therefore we would by performing
- 6:53error correction
- 6:54we would go back to one one one we're
- 6:57going to see an example how we do that
- 6:58after a break see you then
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 38.4 - Dependability- Parity, ECC, RAID: Error Detection and Correction by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 985 words across 173 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.