Definition:
A parity bit, also known as a check bit, is a single bit that can be appended to a binary string. It is set to either 1 or 0 to make the total number of 1- bits either even ("even parity") or odd ("odd parity").
Purpose:
- Computers can make sometimes errors when they transmit data.
- So that, while transmitting the data from one computer to another computer in binary format, a parity bit is added.
Types of Parity bit:
Even Parity:
For detecting the transmitting errors, based on the data (binary data) computer itself calculates the binary data and if the total number is even then the parity bit would be 0 else the parity bit would be 1.
Example 1:
Binary data is 1010
Total number of 1's is 1+1=2
so add 0 to the Original binary data as 10100
Example 2:
Binary data is 10101
Total number of 1's is 1+1+1=3
so add 1 to the original binary data as 101011
Odd Parity:
After binary data calculation, if the total number is even the the parity bit would be 1 else the parity bit would be 0.Example 1:
Binary data is 1010
Total number of 1's is 1+1=2
so add 1 to the original binary data as 10101
Example 2:
Binary data is 10101
Total number of 1's is 1+1+1=3
so add 0 to the original binary data as 101010