The Wayback Machine - https://web.archive.org/web/20240903133518/https://www.geeksforgeeks.org/error-detection-codes-parity-bit-method/
Open In App

Error Detection Codes: Parity Bit Method

Last Updated : 13 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Error Detection Codes: The binary information is transferred from one location to another location through some communication medium. The external noise can change bits from 1 to 0 or 0 to 1. This change in values changes the meaning of the actual message and is called an error. For efficient data transfer, there should be error detection and correction codes. An error detection code is a binary code that detects digital errors during transmission. To detect errors in the received message, we add some extra bits to the actual data. 

Without the addition of redundant bits, it is not possible to detect errors in the received message. There are 3 ways in which we can detect errors in the received message : 

1. Parity Bit 

2. CheckSum

3. Cyclic Redundancy Check (CRC)

What is parity bit?

A parity bit is an extra bit that is added to the message bits or data-word bits on the sender side. Data-word bits along with parity bits is called a codeword. The parity bit is added to the message bits on the sender side, to help in error detection at the receiver side.

Parity Bit Method

We’ll be understanding the parity bit method in this article in depth:

A parity bit is an extra bit included in the binary message to make a total number of 1’s either odd or even. Parity word denotes the number of 1’s in a binary string. There are two parity systems – even and odd parity checks.

Even Parity

Total number of 1’s in the given data bit should be even. So if the total number of 1’s in the data bit is odd then a single 1 will be appended to make total number of 1’s even else 0 will be appended(if total number of 1’s  are already even). Hence, if any error occurs, the parity check circuit will detect it at the receiver’s end. Let’s understand this with example, see the below diagram .

Even Parity

Even Parity Check (fig – 1.1)

In the above image, as we can see the data bits are ‘1011000’ and since this is even parity check that we’re talking about, 1 will be appended as the parity bit (highlighted in red) to make total count of 1’s even in the data sent. So here, our parity bit is 1. If the total count of 1 in the given data bits were already even, then 0 would’ve been appended.

Even Parity Generator

Odd Parity

In odd parity system, if the total number of 1’s in the given binary string (or data bits) are even then 1 is appended to make the total count of 1’s as odd else 0 is appended. The receiver knows that whether sender is an odd parity generator or even parity generator. Suppose if sender is an odd parity generator then there must be an odd number of 1’s in received binary string. If an error occurs to a single bit that is either bit is changed to 1 to 0 or 0 to 1, received binary bit will have an even number of 1’s which will indicate an error. 

Take reference from fig(1.1) and rather than appending the 1 as parity bit, append 0 because total number of 1’s are already odd.  

Odd Parity Generator 

Example:

Message (XYZ) P(Odd) P(Even)
000 1 0
001 0 1
010 0 1
011 1 0
100 0 1
101 1 0
110 1 0
111 0 1

Example Parity BIt Figure – Error Detection with Odd Parity Bit

Advantages of Parity Bit Method

  • Parity bit method is a promising method to detect any odd bit error at the receiver side.
  • Overhead in data transmission is low, as only one parity bit is added to the message bits at sender side before transmission.
  • Also, this is a simple method for odd bits error detection.

Disadvantages of Parity Bit Method

  • The limitation of this method is that only error in a odd number of bits are identified and we also cannot determine the exact location of error in the data bit, therefore, error correction is not possible in this method.
  • If the number of bits in even parity check increase or decrease (data changed) but remained to be even then it won’t be able to detect error as the number of bits are still even and same goes for odd parity check.

See the below image for more details : 

Error in Even Parity

Can’t detect error (Even Parity Check)

In the above example, the the data bits has been changed but as we can see the total count of 1’s remain to be even, the error can’t be detected even though the message’s meaning has been changed. You can visualize the same for odd parity check the number of 1’s will remain odd, even if the data bits have been changed and the odd parity check won’t be able to detect error.

Points to Remember

  • In 1’s complement of signed number +0 and -0 has two different representation.
  • The range of signed magnitude representation of an 8-bit number in which 1-bit is used as a signed bit as follows -27 to +27.
  • Floating point number is said to be normalized if most significant digit of mantissa is one. For example, 6-bit binary number 001101 is normalized because of two leading 0’s.
  • Booth algorithm that uses two n bit numbers for multiplication gives results in 2n bits.
  • The booth algorithm uses 2’s complement representation of numbers and work for both positive and negative numbers.
  • If k-bits are used to represent exponent then bits number = (2k-1) and range of exponent = – (2k-1 -1) to (2k-1).

Conclusion

Parity bit method is a simple method which uses only one bit extra parity with the message bits to make codeword at sender side. It is used to detect errors of odd number of bits at receiver side. However, it can neither detect errors of even number of bits, nor can it correct any detected error as the location of bits where error occurred can’t be identified in this method.

Frequently Asked Questions on Parity Bit Method – FAQs

How Does the Parity Bit Method Work?

The parity bit method works by counting the number of 1s in a binary string. If even parity is used, the parity bit is set to 1 if the count of 1s is odd, making the total count even. If odd parity is used, the parity bit is set to 1 if the count of 1s is even, making the total count odd.

What is difference between even parity and odd parity?

In even parity the total number of 1s in the sent data is even whereas, in odd parity the total number of 1s in the sent data is odd.

How to find parity bit?

In case of odd parity, count the total number of 1s in the data to be sent. If the total number of 1s are even then add 1 as the parity bit else add 0 as the parity bit to the data-word.

In case of even parity, count the total number of 1s in the data to be sent. If the total number of 1s in the data to be sent is odd then add 1 as the parity bit else add 0 as the parity bit to the data-word.



Previous Article
Next Article

Similar Reads

Difference Between 8 Bit and 16 Bit Microcontroller
Introduction : Microcontrollers are small, low-power computers designed for specific tasks. They are widely used in embedded systems such as household appliances, automotive systems, medical devices, and industrial control systems. Microcontrollers are available in various configurations and architectures, and they differ in terms of processing pow
4 min read
Difference Between 8 Bit and 16 Bit Music
Music is described in the form of waves. By varying the amplitude periodically, it can generate a frequency which is called a tone. It is just a sound effect. It has an amplitude and generates a frequency. It has 8-bit music and 16-bit music. 8 - Bit MusicIt refers to any number in the form of a binary from 0 to 255. It is used to create tracks for
4 min read
One bit memory cell (or Basic Bistable element)
A One Bit Memory Cell (also known as a Basic Bistable Element) is a digital circuit that can store a single bit of information. It is a type of sequential circuit that can hold its state until a new input signal is received, causing the state to change. One Bit Memory Cells are used in digital systems as temporary storage elements and are the build
6 min read
8086 program to Print a 16 bit Decimal number
Problem: Write a 8086 program to Print a 16 bit Decimal number. Examples: Input: d1 = 655 Output: 655 Input: d1 = 234 Output:234 Explanation: load the value stored into registerdivide the value by 10push the remainder into the stackincrease the countrepeat the steps until the value of the register is greater than 0until the count is greater than ze
2 min read
8086 program to convert a 16 bit decimal number to binary
Problem: We are given a 16 bit decimal number we have to print the number in binary format Examples: Input: d1 = 16 Output: 10000 Input: d1 = 7 Output: 111 Explanation: Load the value stored into registerDivide the value by 2 to convert it to binaryPush the remainder into the stackIncrease the countRepeat the steps until the value of the register i
2 min read
8086 program to convert a 16 bit Decimal number to Octal
Problem: We are given a 16 bit decimal number we have to print the number in octal format. Examples: Input: d1 = 16 Output:20 Input: d1 = 123 Output: 173 Explanation: Load the value stored into register Divide the value by 8 to convert it to octal Push the remainder into the stack Increase the count Repeat the steps until the value of the register
2 min read
8086 program to convert a 16 bit decimal number to Hexadecimal
Problem: We are given a 16 bit decimal number we have to print the number in Hexadecimal format. Examples: Input: d1 = 999 Output: 3E7 Input: d1 = 123 Output: 7B Explanation: Load the value stored into register Divide the value by 16 to convert it to Hexadecimal Push the remainder into the stack Increase the count Repeat the steps until the value o
2 min read
4-bit binary Adder-Subtractor
In Digital Circuits, A Binary Adder-Subtractor is capable of both the addition and subtraction of binary numbers in one circuit itself. The operation is performed depending on the binary value the control signal holds. It is one of the components of the ALU (Arithmetic Logic Unit). This Circuit Requires prerequisite knowledge of Exor Gate, Binary A
3 min read
Size of ROM for n-bit Adder/Subtractor
ROM is a read-only memory which is used to store the data. The memory in the ROM is organized as a two-dimensional array of memory cells. The memory will read or write the contents of one of the rows of the array. This row is specified by an Address which are bits. The value read or written is called Data. Figure a) shows a memory array with two ad
3 min read
4 Bit Binary Incrementer
What is 4 Bit Binary Incrementer ?It adds 1 binary value to the existing binary value stored in the register or in other words we can simply say that it increases the value stored in the register by 1.For any n-bit binary incrementer ,‘n’ refers to the storage capacity of the register which needs to be incremented by 1. So we require ‘n’ number of
2 min read
4 Bit Binary Decrementer
What is 4 Bit Binary Decrementer ?It subtracts 1 binary value from the existing binary value stored in the register or in other words we can simply say that it decreases the existing value stored in the register by 1. For any n- bit binary decrementer, ‘n’ refers to the storage capacity of the register which needs to be decremented by 1. So we requ
3 min read
3 bit Synchronous Down Counter
Prerequisite : Counter , Synchronous counter. 3 bit Synchronous Down Counter : In synchronous counter clock is provided to all the flip-flops simultaneously.Circuit becomes complex as the number of states increases.Speed is high. Design : The steps involves in design are 1. Decide the number of Flip flops - N number of Flip flop(FF) required for N
2 min read
Synchronous 3 bit Up/Down counter
Prerequisite : 3 bit down counter. Overview: These types of counters fall under the category of synchronous controller counter.Here the mode control input is used to decide whether which sequence will be generated by the counter.In this case, mode control input is used to decide whether the counter will perform up counting or down counting.Designin
3 min read
1 Bit Full Adder using Multiplexer
Prerequisite : Multiplexer, Full adder Introduction : Multiplexer and Full adder are two different Digital Logic circuits. The Multiplexer is a digital switch. It allows digital information from several sources to be routed onto a single output line. On the other hand, the Full adder circuit performs the addition of three bits and produces the Sum
3 min read
4-bit Ripple Carry Counter in Verilog HDL
To proceed with Verilog Code, we shall first understand the structure of the 4-bit Ripple Counter. The top design block consists of four T-Flip Flop. For time being ignore the input and output of T-Flip Flop. Let us consider the overall outside structure of Ripple Counter. We have two inputs i.e., clock and reset and q is output. The output q is in
3 min read
n-bit Johnson Counter in Digital Logic
Prerequisite - Counters  Johnson counter also known as creeping counter, is an example of synchronous counter. In Johnson counter, the complemented output of last flip flop is connected to input of first flip flop and to implement n-bit Johnson counter we require n flip-flop. It is one of the most important type of shift register counter. It is for
5 min read
Even Odd method & Winding number Method-Inside & Outside Test of a Polygon
Introduction :A polygon may be represented as a number of line segments connected, end to form a closed figure.Polygons can be represented in two ways - (i) outline from using move commands and (ii) as a solid objects by setting the pixels high inside the polygon including pixels on the boundary. To determine a point lies inside a polygon or not, i
4 min read
Quine McCluskey Method
Boolean function simplification is one of the basics of Digital Electronics. The quine-McCluskey method also called the tabulation method is a very useful and convenient method for simplification of the Boolean functions for a large number of variables (greater than 4). This method is useful over K-map when the number of variables is larger for whi
8 min read
Boolean Algebra
Boolean algebra is a type of algebra that is created by operating the binary system. In the year 1854, George Boole, an English mathematician, proposed this algebra. This is a variant of Aristotle's propositional logic that uses the symbols 0 and 1, or True and False. Boolean algebra is concerned with binary variables and logic operations. Boolean
14 min read
IEEE Standard 754 Floating Point Numbers
The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation which was established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found in the diverse floating point implementations that made them difficult to use reliably and reduced
5 min read
Shift Registers in Digital Logic
Pre-Requisite: Flip-Flops Flip flops can be used to store a single bit of binary data (1 or 0). However, in order to store multiple bits of data, we need multiple flip-flops. N flip flops are to be connected in order to store n bits of data. A Register is a device that is used to store such information. It is a group of flip-flops connected in seri
8 min read
Encoder in Digital Logic
An encoder is a digital circuit that converts a set of binary inputs into a unique binary code. The binary code represents the position of the input and is used to identify the specific input that is active. Encoders are commonly used in digital systems to convert a parallel set of inputs into a serial code. The basic principle of an encoder is to
6 min read
Full Subtractor in Digital Logic
A full subtractor is a combinational circuit that performs subtraction of two bits, one is minuend and other is subtrahend, taking into account borrow of the previous adjacent lower minuend bit. This circuit has three inputs and two outputs. The three inputs A, B and Bin, denote the minuend, subtrahend, and previous borrow, respectively. The two ou
3 min read
Program for Decimal to Binary Conversion
Given a decimal number as input, we need to write a program to convert the given decimal number into an equivalent binary number. Examples of Decimal to Binary:  Input : 7Output : 111Input : 10Output : 1010Input: 33Output: 100001Recommended PracticeDecimal to binaryTry It!Brute force ApproachFor Example: If the decimal number is 10. Step 1: Remaind
15+ min read
Full Adder in Digital Logic
Full Adder is the adder that adds three inputs and produces two outputs. The first two inputs are A and B and the third input is an input carry as C-IN. The output carry is designated as C-OUT and the normal output is designated as S which is SUM. The C-OUT is also known as the majority 1's detector, whose output goes high when more than one input
5 min read
Multiplexers in Digital Logic
In this article we will go through the multiplexer, we will first define what is a multiplexer then we will go through its types which are 2x1 and 4x1, then we will go through the Implementation of the 2x1 mux and higher mux with lower order mux, At last we will conclude our article with some applications, advantages and some FAQs. Table of Content
10 min read
Number System and Base Conversions
Electronic and Digital systems may use a variety of different number systems, (e.g. Decimal, Hexadecimal, Octal, Binary), or even Duodecimal or less well known but better named Uncial. All the other bases other than Decimal result from computer usage. Uncial (named from Latin for 1/12 "uncia" the base twelve analogue of Decimal from the Latin word
5 min read
Flip-Flop types, their Conversion and Applications
In this article, we will go through the Flip-Flop types, their Conversion and their Applications, First, we will go through the definition of the flip-flop with its types in brief, and then we will go through the conversion of the flip-flop with its applications, At last, we will conclude our article with some FAQs. Table of Content Flip-FlopTypes
7 min read
Introduction of K-Map (Karnaugh Map)
In many digital circuits and practical problems, we need to find expressions with minimum variables. We can minimize Boolean expressions of 3, 4 variables very easily using K-map without using any Boolean algebra theorems. K-map can take two forms: Sum of product (SOP) Product of Sum (POS) According to the need of problem. K-map is a table-like rep
3 min read
Half Adder in Digital Logic
Introduction: A half adder is a digital logic circuit that performs binary addition of two single-bit binary numbers. It has two inputs, A and B, and two outputs, SUM and CARRY. The SUM output is the least significant bit (LSB) of the result, while the CARRY output is the most significant bit (MSB) of the result, indicating whether there was a carr
4 min read