A parity bit is an error detection bit added to binary data such that it makes the total number of 1's in the data is either even or odd. It is used to validate the integrity of the data. Parity bits are used as the simplest form of error detecting code.
A parity bit is a bit, with a value of 0 or 1, that is added to a block of data, for error detection purposes. It gives the data either even or odd parity, which is used to validate the integrity of the data.
Parity bits are often used in data transmission to ensure that data is not corrupted during the transfer process. For example, every 7 bits of data may include a parity bit. If the data transmission protocol is set to an odd parity, then each data packet must have an odd parity. If it is set to even parity, then each packet must have an even parity. If a packet is received with wrong parity, an error will be produced and the data will need to be re-transmitted.
There are two types of party bit:-
- Even Parity Bit
- Odd Parity Bit
An even parity bit is set to 1, if the number of 1's in a given set of bit is odd. If the number of 1's in a given set of bit is even, then the even parity bit will be set to 0.
An odd parity bit is set to 1, if the total number of 1's in a given set of bit is even. If the total number of 1's in a given set of bit is odd, then the odd parity bit will be set to 0.
Example:-
| 7-bits data | even parity | odd parity |
| 0000000 | 0 | 1 |
| 1111111 | 1 | 0 |
| 1010101 | 0 | 1 |
| 0101010 | 1 | 0 |
No comments:
Post a Comment