Parity Checks
Parity bit checks are a simple form of error-checking used in digital systems to detect errors in binary data. They work by adding an extra bit, called a parity bit, to a group of binary bits.
The purpose of the parity bit is to ensure that the total number of ones (1s) in the binary data, including the parity bit, follows a specific rule, either even or odd parity.
There are two common types of parity checks: even parity and odd parity.
Even Parity
In even parity, the rule is that the total number of ones in the binary data, including the parity bit, must be an even number.
To implement even parity, if the data already has an even number of ones, the parity bit is set to 0 (zero).
If the data contains an odd number of ones, the parity bit is set to 1 (one) to make the total number of ones even.
Example
If we have a group of 7 bits 1011011, the total number of 1 is 5. This is an odd number and therefore we need to add a one to the end in order to achieve even parity.
Result - 10110111
When the data is received, if the number of 1s in the byte is an odd number we know that a transmission error has occurred.
Parity Bit Demonstration
Block Parity Demonstration
Click on cells to change their values. The parity bit will be calculated dynamically.
| Data 1 | Data 2 | Data 3 | Parity Bit |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
What is the correct even parity bit for the binary number 1011?
Odd Parity
In odd parity, the rule is that the total number of ones in the binary data, including the parity bit, must be an odd number.
To implement odd parity, if the data already has an odd number of ones, the parity bit is set to 0 (zero).
If the data contains an even number of ones, the parity bit is set to 1 (one) to make the total number of ones odd.
Example
If we have the group of bits 1011011, the total number of 1s is 5. This is an odd number and so it is already in odd parity. Therefore we simply add a 0
Result - 10110110
Use cases for parity bits
Data Transmission and Communication
Parity bits are used to detect errors in data sent from one device to another in communication protocols.
Storage Systems (RAID)
Parity bits are employed in RAID systems to provide fault tolerance and data recovery in case of drive failure.
Memory Systems (RAM)
Parity bits are used in computer memory to identify and, in some cases, correct single-bit errors in data stored in memory.
Advantages of Parity Bits
Simplicity
Parity bits are straightforward to implement and require minimal hardware or software resources. They add a basic layer of error detection without significant overhead.
Low Overhead
Parity bits add only one extra bit to the data, making them a cost-effective method for basic error checking.
Real-Time Detection
Errors can be detected in real-time, which is important for applications like data communication.
What is an advantage of using parity bits in error detection?
Limitations of Parity Bits
Cannot Correct Errors
Parity bits can only detect errors; they cannot correct them. More advanced error-correction methods are needed for error correction.
Limited Error Detection
Parity bits are limited to detecting single-bit errors. They may not detect multiple errors occurring in the same data word.
No Error Location Information
Parity bits cannot pinpoint the exact location of an error within the data. They only indicate that an error has occurred.
Checksums
A checksum is a value derived from a set of data, typically in digital form, that is used to verify the data's integrity and detect errors that may have occurred during data transmission or storage. Checksums are widely used in computing and data communication to ensure data reliability.
In Python programming, what is the purpose of a checksum?
Checksum Calculation Process
1. Split the data into a number of blocks(k) with a fixed number of bits (n) in each block.
2. Sum up all of the k blocks data using binary addition.
3. If there is a carry in the sum, add this to the sum.
4. Perform 1's Complement on the sum
This will provide us with the checksum value.
Checksum Calculation Demonstration
Checksum Use cases
Data Transmission Integrity
Used to verify data integrity during transmission, such as in network protocols like TCP.
File Integrity Verification
Ensures files remain unaltered during transfer or storage, often used in downloads and backups.
Password Storage Security
Enhances security by storing password hashes instead of plaintext passwords, protecting user credentials.
Advantages of Checksums
Effective Error Detection
Checksums effectively detect errors and corruption in data during transmission or storage, providing data integrity.
Efficiency
They are computationally efficient and can quickly verify data integrity without requiring significant resources.
Ease of Implementation
Checksums are relatively easy to implement in software and hardware systems.
Wide Applicability
Checksums can be used in various applications, from network communication to file transfers.
What is an advantage of using checksums in data transmission?
Limitations of Checksums
No Error Correction
Checksums detect errors but do not correct them, limiting their utility in applications where error correction is critical.
Limited Error Detection
The effectiveness of checksums depends on the chosen algorithm and may not catch all types of errors.
Cryptographic Weakness
Some simple checksum algorithms are vulnerable to deliberate tampering and may not be suitable for security-critical applications.
False Positives/Negatives
Checksums can generate false positives or false negatives, indicating errors when data is actually intact or missing errors when they are present.
Are checksums completely reliable in detecting errors during data transmission?
Echo Check
An echo check is a simple form of error checking in Computer Science and networking where the received data is immediately retransmitted back to the sender. If the sender receives the same data back they sent then they know it is highly likely that the receiver has received the data correctly.
In network troubleshooting, an administrator might use an echo check to verify the connectivity and integrity of a network connection. They send a test signal, and if they receive the same signal back, it indicates that the network link is operational. If they don't receive the expected echo, it suggests a problem with the connection or data transmission.
What is the primary purpose of a network data echo check?
Automatic Repeat Query (ARQ)
This is a protocol for error control over unreliable or noisy network connections. For each frame sent an acknowledgement is sent from the receiver to indicate that the frame has been successfully used. Checksums / check-digits are used to check the data integrity and timeouts are used if not reply is received.
There are 3 versions of ARQ:
- Stop & Wait
- Stop n go back
- Selective repeat
The Stop and Wait ARQ

Data is sent from the sender to the receiver. Once sent the sender waits a certain amount of time for a response from the receiver.
The receiver uses the checksum/check digit from the frame to check the frame and ensure that data has been received correctly.
The user sends a positive acknowledgement(ACK) to the sender to indicate the data been received correctly or a negative acknowledgement to indicate that the data has been corrupted.
If the data has been incorrectly received or a time-out occurs(the time wait limit is exceeded) the sender resends the data.
This process is repeated until all data has been received.
Go back & ARQ

In stop and go back ARQ the sender keeps sending data through in a constant stream, without waiting for an acknowledgment from the receiver â it just assumes that the data has been received successfully. If a negative acknowledgement is received or a timeout occurs the sender goes back to the last known good acknowledgement and starts again from there.
This is an improvement over stop and wait because the senders full bandwidth can be used.
Which transport layer protocol commonly uses Automatic Repeat reQuest (ARQ) for error control?
Selective Repeat ARQ

Selective Repeat is an improvement over Go Back & ARQ because only the frames that have been unsuccessfully received are retransmitted, rather than having to start all over again.
Check Digits
Data entry check digits, also known as verification digits or data entry verification codes, are special digits included in data to help prevent and detect errors during manual data entry. They are commonly used in applications where accurate data input is essential to avoid mistakes and maintain data integrity. Data entry check digits are calculated based on the other data digits and serve as a safeguard against input errors.
Why is a check digit used in data entry or transmission?
Luhnâs Algorithm
Luhnâs algorithm is a credit digit algorithm that uses modulo to detect simple errors. It is commonly used on 15 digit credit card numbers to automatically calculate the 16th digit.
Algorithm Steps
- Write all the digits down in order.
- For each number in the sequence that is in an odd position (first, third, fifth,etc) multiply that number by two and add each of the digits of the result together.
- For each number in the sequence that is in even position, leave it as is.
- Now add up all the resultant numbers together (including the ones you left as is)
- Work out 10 minus modulo 10 of the total ( = 10 â Total MOD 10 )
- The answer becomes the16th digit.
Luhns Algorithm Presentation
Check Digit Use Cases
Credit Card Validation
Data entry check digits are commonly used in credit card numbers to ensure the validity and accuracy of the card data during transactions. The Luhn algorithm, for example, verifies that credit card numbers are correctly entered, reducing the risk of payment errors.
ISBN Validation
The International Standard Book Number (ISBN) includes a check digit to verify the accuracy of book identification numbers. This helps ensure that books are correctly identified in libraries and databases.
Barcodes and UPCs
Product barcodes, particularly the Universal Product Code (UPC), often include check digits to prevent errors during product scanning and inventory management. The check digit ensures that the barcode data is correctly entered or scanned, reducing errors in retail and logistics.
(ISBN & Barcodes use a x3 multiplier instead of x2)
What is the purpose of a check digit in a barcode?
Parity Block Checks
Parity block checks are used in data storage and data transmission systems to add an additional layer of error detection to a group of bytes (usually a larger chunk of data). They are similar in concept to parity bits, but instead of applying parity to individual bits within a byte, they apply it to a group of parity bytes.
The purpose of parity bytes is to detect errors in a larger data unit, such as a block of data, rather than just individual bits or bytes. By using parity bytes, you can detect errors in the entire data block more effectively.
How is parity typically calculated in a parity block in Python?
Interactive Demonstration
With block parity the bits are treated as a 2 dimensional matrix, and parity bits are calculated for each row and column.
Click on cells to change their values. Row and column parity will be calculated dynamically.
| Data 0 | Data 1 | Data 2 | Data 3 | Row Parity | |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | |
| 0 | 0 | 0 | 0 | 0 | |
| 0 | 0 | 0 | 0 | 0 | |
| 0 | 0 | 0 | 0 | 0 | |
| Column Parity | 0 | 0 | 0 | 0 | 0 |
In a parity-based error detection system, what typically happens when an error is detected in a parity block?
Block Parity Use Cases
RAID Systems
Block parity is a fundamental component of RAID configurations, ensuring data redundancy and fault tolerance. If one drive fails, block parity information is used to rebuild the missing data, ensuring data integrity and availability.
ECC Memory
Block parity is essential in ECC memory, which detects and corrects errors in RAM, especially in server environments.
Data Storage and Archiving
It is widely used to protect data integrity in storage, backup, and archival systems.
Data Transmission and Communication
In certain data communication protocols, especially those used in satellite communication or deep-space missions, block parity may be employed to guarantee data integrity in the presence of signal noise or interference
Advantages of Parity Blocks
Error Detection
Block parity checks can effectively detect errors in data, including single-bit and some multi-bit errors. This is the main advantage over parity bits.
Data Redundancy
In RAID systems, block parity provides data redundancy, allowing for data recovery in the event of drive failures.
Simple Implementation
Block parity checks are relatively easy to implement and add a basic level of error detection without significant computational overhead.
Limitations of Parity Blocks
No Error Correction
Block parity checks can detect errors but cannot correct them. They are limited to identifying errors but not fixing them.
Limited Error Detection
While they can detect single-bit errors and some multi-bit errors, they may not be effective against more complex errors, such as certain types of multi-bit errors or burst errors.
Overhead
In storage systems, the use of block parity introduces overhead in terms of the storage capacity required for parity information. This can reduce the overall usable storage capacity.
Performance Impact
Calculating and updating block parity information can have a performance impact, especially in real-time data storage and retrieval scenarios.
CheckSum Video Tutorial
Error Checking Video
Review: Fill in the Blanks
Odd parity ensures that the total sum of bits (including the parity bit) is an odd number, while even parity ensures an even total sum. These parity bits introduce , enabling the system to identify and correct errors, thus enhancing .
In certain storage systems like (Redundant Array of Independent Disks), are used to detect and correct errors. determines the parity block by performing logical operations on the data blocks, allowing for high fault tolerance. However, this method incurs a because of the need to store additional parity information.
Other techniques, such as s, (Message Digest 5), and (Cyclic Redundancy Check), are used for error detection. Checksums provide a simple and efficient mechanism to verify data integrity by summing all the data values and storing the total. Any changes in the data will result in a different checksum value.
CRC, on the other hand, employs polynomial division to generate a unique remainder that serves as the checksum. This remainder is appended to the data, enabling the receiver to validate the data's integrity. Similarly, and (ARQ) methods involve and to overcome and ensure error-free data transmission. They rely on messages and s to manage retransmission and maintain the of transmitted packets.
Another technique, the , uses a to detect errors in numbers, commonly used in credit card numbers and identification numbers. The Luhn algorithm calculates the check digit based on the sum of the digits, allowing for quick error detection.
Complete! Ready to test your knowledge?
Parity Bit Checks
- Parity Checks
- Even Parity
- Parity Bit Demonstration
- Odd Parity
- Use cases for parity bits
- Advantages of Parity Bits
- Limitations of Parity Bits
Checksums
- Checksums
- Checksum Calculation Process
- Checksum Calculation Demonstration
- Checksum Use cases
- Advantages of Checksums
- Limitations of Checksums
Echo Check
- Echo Check
Automatic Repeat Query (ARQ)
- Automatic Repeat Query (ARQ)
- The Stop and Wait ARQ
- Go back & ARQ
- Selective Repeat ARQ
Check Digits
- Check Digits
- Luhnâs Algorithm
- Luhns Algorithm Presentation
- Check Digit Use Cases
Parity Block
- Parity Block Checks
- Interactive Demonstration
- Block Parity Use Cases
- Advantages of Parity Blocks
- Limitations of Parity Blocks
Topic Tests
Videos
- CheckSum Video Tutorial
- Error Checking Video