Skip to content

VLSIFacts

Let's Program the Transistors

  • Home
  • DHD
    • Digital Electronics
    • Fault Tolerant System Design
    • TLM
    • Verification
    • Verilog
    • VHDL
    • Xilinx
  • Embedded System
    • 8085 uP
    • 8086 uP
    • 8051 uC
  • VLSI Technology
    • Analog Electronics
    • Memory Devices
    • VLSI Circuits
  • Interview
    • Interview Experience
    • Training Experience
    • Question Bank
  • Notifications
  • QUIZ
  • Community
  • Job Board
  • Contact Us

Parity Code for Error Detection

Posted on March 18, 2023June 19, 2025 By vlsifacts No Comments on Parity Code for Error Detection

One of the most common ways to achieve error detection is by means of parity code. A parity code is generated by adding an extra parity bit (information redundancy) to the string of data bits. There are two types of parity, such as even parity and odd parity. A given system operates with either even parity or with odd parity but not with both.

In the case of even parity, a parity bit is added to the data bits to make the total number of 1s even, including the parity bit. Similarly, in the case of odd parity, the total number of 1s, including the parity bit, becomes odd. The most common convention in digital systems is to use even parity. The following example shows the even as well as odd parity bit generation for a particular data bit stream. However, in a real system, either even or odd parity will be generated for the data transmission based on the system type (not both).

Example: Consider the ASCII code for the character ‘A’. Suppose you want to transmit this character. So, generate the even parity as well as the odd parity bit for the character ‘A’.

Solution:

The ASCII code of the character ‘A’ is 01000001. Now we need to generate both the even parity and odd parity bit for the character ‘A’.

The ASCII code of ‘A’ already has two 1s, that is, even. So the even parity bit will be ‘0’ so that the total number of 1s, including the parity bit, will be even.

Peven = 0

The odd parity bit will be ‘1’ so that the total number of 1s, including the parity bit, will be odd.

Podd = 1

The following table lists down the even parity bit as well as the odd parity bit for all the 4-bit binary numbers.

4-bit Binary MessageEven Parity bit (Peven)Odd Parity bit (Podd)
000001
000110
001010
001101
010010
010101
011001
011110
100010
100101
101001
101110
110001
110110
111010
111101

When the message is transmitted, it is transmitted along with the parity bit (either even parity bit or odd parity bit, depending on the system type). The placement of the parity bit again depends upon the system (MSB / LSB / any intermediate bit). However, for a particular system, the parity bit location is fixed for all the transmissions. The MSB is more popularly used for the parity bit.

You may find the following articles related to even parity interesting:

Step by step method to design an Even Parity Generator
State machine diagram for Even Parity Generator
Circuit design of Even Parity Generator using Mealy State Machine

Error Detection using Parity

Let’s consider the same example of the ASCII code of ‘A’ for understanding error detection using parity.

Assume that the system is an even parity system, and the parity bit is placed at the MSB of the message. So, the correct message with the parity bit would be as follows:

001000001 (for the data transmission)

As discussed earlier, as the message has two 1s (even number of 1s), the even parity bit at the MSB of the message is ‘0’ (highlighted in blue).

Let’s say, during the message transmission, due to a noise signal, the ‘1’ at the LSB flipped to ‘0’, and the message received at the receiver is as below:

001000000

At the receiver end, again, a parity bit would be generated for the received data bits “01000000”. To maintain the even parity, now the generated parity bit would be ‘1‘, which does not match with the received parity bit that is ‘0‘. Since the parity check fails, it indicates that there is an error in the received message.

What is done after an Error is Detected

What is done after an error is detected depends upon the type of application. One example is to retransmit the data with the belief that the error is transient and will go away after some time. If there is an error, the receiver sends a negative acknowledgement so that the transmitter resends the data. This process repeats till the time the correct parity is not generated. If the error persists, then a message can be sent to the human operator to check for malfunctions on the transmission path.

Limitations of simple Parity Code

The simple parity code has two limitations, as mentioned below:

  1. The simple parity code can not detect an error if even number of data bits get corrupted.
  2. The simple parity code can not localize and correct the error.

Previous           Table of Content           Next

Spread the Word

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Related posts:

  1. Error Detection and Correction Codes
  2. Hamming Distance
  3. What are Code Words in case of Error Detection and Correction
  4. Hamming Codes
Digital Electronics Tags:error correction, error detection, even parity, Information Redundancy, odd parity, parity code

Post navigation

Previous Post: Error Detection and Correction Codes
Next Post: Hamming Distance

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top Posts & Pages

  • ASCII Code
  • AND and OR gate using CMOS Technology
  • Circuit Design of a 4-bit Binary Counter Using D Flip-flops
  • NAND and NOR gate using CMOS Technology
  • Texas Instruments Question Bank Part-1

Copyright © 2025 VLSIFacts.

Powered by PressBook WordPress theme

Subscribe to Our Newsletter

%d