IFT 211 · Digital Logic Design
Our notes
2 min readErrors happen
Noise on a cable, radio interference or a faulty memory cell can flip a bit. Systems add extra (redundant) bits so errors can be detected or even corrected.
Parity
One extra bit makes the number of 1s even (even parity) or odd (odd parity).
- Data 1011 001 has four 1s. Even parity bit = 0; odd parity bit = 1.
- The receiver counts 1s. A wrong count means an error.
- Parity finds any single error (and any odd number of errors) but misses two errors in the same word.
Worked example
With even parity, which of these 8-bit words has an error? 1100 1100 (four 1s: fine), 1011 0111 (six: fine), 1110 0011 (five: error).
Block (two-dimensional) parity
Send several words with a parity bit per row and a parity word for the columns. A single error shows in one row and one column, so its position is known and it can be corrected.
Hamming distance and codes
The Hamming distance between two code words is the number of bits that differ (1011 and 1110 differ in 2 places). To detect d errors a code needs minimum distance d + 1; to correct c errors it needs 2c + 1. The Hamming (7,4) code adds 3 check bits to 4 data bits and corrects any single error; it is used in ECC memory.
Checksums and CRC
A checksum adds the data bytes and sends the total. A cyclic redundancy check divides the data by a fixed binary polynomial and sends the remainder; it catches burst errors and is used in Ethernet, Wi-Fi and ZIP files.
Parallel transmission
All bits of a word travel at once on separate wires (an 8-bit bus has 8 data lines). Fast over short distances (inside a chip or on a circuit board), but wires are costly and timing skew limits long cables.
Serial transmission
Bits travel one after another on one line. Cheaper over distance and, with modern high clock rates, faster than old parallel links: USB, SATA, PCI Express and Ethernet are all serial.
- Asynchronous: each character is framed with a start bit and stop bit (UART).
- Synchronous: sender and receiver share a clock or recover it from the data.
Memory in outline
Memory stores bit patterns at numbered addresses. With k address lines there are 2ᵏ locations: 16 lines address 65,536 bytes (64 KB).
Exams usually ask
- Add even or odd parity bits; find the faulty word.
- Compare serial and parallel transmission with examples.
Common mistake
Claiming parity can correct errors: a single parity bit only detects them.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Practical considerations - Digital Communication | Digital Communication | Electronics Textbook
(opens allaboutcircuits.com in a new tab)
-
Parity bit
(opens en.wikipedia.org in a new tab)
Wikipedia, Parity bit, CC BY-SA 4.0 · licence
-
Hamming code
(opens en.wikipedia.org in a new tab)
Wikipedia, Hamming code, CC BY-SA 4.0 · licence
-
Serial communication
(opens en.wikipedia.org in a new tab)
Wikipedia, Serial communication, CC BY-SA 4.0 · licence
-
NPTEL: Switching Circuits and Logic Design (IIT Kharagpur, Prof. Indranil Sengupta)
Video lectures, many hours in all: watch on Wi-Fi where you can.
(opens nptel.ac.in in a new tab)
NPTEL, NPTEL: Switching Circuits and Logic Design (IIT Kharagpur, Prof. Indranil Sengupta), CC BY-NC-SA 4.0 · licence
Watch
-
Best pick Error Detecting Code : Parity Explained | Odd Parity and Even Parity
9 min · ≈ 41 MB · about ₦23
(opens youtube.com in a new tab)
-
Hamming Code | Error Detection
12 min · ≈ 54 MB · about ₦30
(opens youtube.com in a new tab)
-
But what are Hamming codes? The origin of error correction
20 min · ≈ 90 MB · about ₦51
(opens youtube.com in a new tab)
-
Parity Bit & Check Bit
5 min · ≈ 23 MB · about ₦13
(opens youtube.com in a new tab)
-
Lecture 19: Error-Correcting Codes—Hamming Codes
1 h 19 min · ≈ 356 MB · about ₦200
(opens youtube.com in a new tab)
Practise
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.