šŸ•·ļø Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 162 (from laksa177)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ā„¹ļø Skipped - page is already crawled

šŸ“„
INDEXABLE
āœ…
CRAWLED
24 days ago
šŸ¤–
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.8 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://www.naukri.com/code360/library/error-detection-and-correction-code-part-1
Last Crawled2026-03-16 21:53:32 (24 days ago)
First Indexed2024-03-31 02:58:23 (2 years ago)
HTTP Status Code200
Meta TitleError Detection and Correction Code: Part 1 - Naukri Code 360
Meta DescriptionThis blog covers the various error detection and correction code techniques in detail.
Meta Canonicalnull
Boilerpipe Text
Introduction The bits 0 and 1 correspond to the two different ranges of analog voltages. So, during the transmission of binary data from one system to the other, the noise also gets added. Due to this, errors might be there in the received data at the other system. This means that a bit 0 may change to 1, or a bit 1 may change to 0. It is impossible to avoid noise interference. But, we can definitely get back the original data first by various error detection and correction code techniques.Ā  In this article, we will extensively discuss the need forĀ  error detection and correction code techniques and the various techniques like parity code and cyclic redundancy check. Recommended Topic -Ā  Shift Registers in Digital Electronics Error Detection and Correction Code To get back the original data, we first need to detect whether an error is present or not using error detection codes. If the error is present in the code, we will correct it with the help of error correction codes. This is achieved using the following codes:-Ā  Error detection codes Error correction codes Error detection codes Error detection codes detect errors in the received data bitstream. These codes contain some additional bits, which are appended to the original bitstream at the time of transmission. These codes detect the error if it occurs during transmission of the original data bitstream. Error detecting codes encode the message before sending it over the noisy channels. The encoding scheme is performed so that the decoder at the receiving can easily find the errors in the receiving data with a higher chance of success. Example: Parity code, Hamming code, etc. Error correction codes Error correction codesĀ  are used to correct the errors present in the received data bitstream to receive the original data. Error correction codes also use a similar strategy of error detection codes. Ā  Error correction codes are generated using a specific algorithm to remove and detect errors from the message transmitted over the noisy channels. The error-correcting codes find the correct number of corrupted bits and their positions in the message. There are two types of Error Correction Codes (ECCs). They are as follows:- Block codes In block codes, the message is contained in fixed-size blocks of bits, and the redundant bits are added to correct and detect errors. Convolutional codes The message consists of data streams of a random length in convolutional codes. And here, the parity symbols are generated by the sliding application of the boolean function to the data stream. Let's discuss some popular techniques like parity check, cyclic redundancy check, etc. Parity code In the parity code, we add one parity bit either to the left to the MSB(Most Significant Bit)Ā  or the right of the LSB(Least Significant Bit) to the original bitstream. Based on the parity type being chosen, there are two types of parity codes: even parity codes and odd parity codes. Even Parity Codes In an even parity code, there are an even number of ones present. It contains the data bits as well as an even parity bit. The value of the even parity bit should be zero if an even number of ones are present in the binary code. Otherwise, the even parity bit should be one.Ā  The table shows the even parity codes corresponding to each of the 3-bit binary codes.Ā  Binary Code Even Parity bit Even Parity Code 000 0 0000 001 1 0011 010 1 0101 011 0 0110 100 1 1001 101 0 1010 110 0 1100 111 1 1111 Note: The even parity bit is included to the right of the LSB of binary code. 4 bits are present in the even parity codes. The parity codes can haveĀ  0, 2, or 4 ones to have an even parity code. If the receiver system receives one of the even parity codes, no error is there in the received data. The bits other than even parity bit are the same as that of binary code. If the receiver system receives a code other than an even parity code, the received data will have an error. However, the original binary code cannot be obtained as we are unaware of the bit position of the error. Odd Parity Codes There is an odd number of ones present in an odd parity code. It contains the data bits as well as an even parity bit. The value of the odd parity bit should be one if an even number of ones are present in the binary code. Otherwise, the odd parity bit should be zero.Ā  The table shows the odd parity codes corresponding to each of the 3-bit binary codes.Ā  Binary Code Odd Parity bit Odd Parity Code 000 1 0001 001 0 0010 010 0 0100 011 1 0111 100 0 1000 101 1 1011 110 1 1101 111 0 1110 Note: The even parity bit is included to the right of the LSB of binary code. 4 bits are present in the odd parity codes.Ā  The parity codes can haveĀ  1 or 3 ones to have an odd parity code. If the receiver system receives one of the odd parity codes, there is no error in the received data. The bits other than the odd parity bit are the same as that of binary code. If the receiver system receives a code other than an odd parity code, the received data will have an error. However, the original binary code cannot be obtained as we are unaware of the bit position of the error. Also see,Ā  what is middleware Cyclic Redundancy Check (CRC) Cyclic Redundancy CheckĀ  (CRC) is an error detection mechanism in which a unique number is appended to a data block to detect any errors introduced during storage or transmission). The unique number is recalculated on retrieval and compared to the value originally transmitted, revealing certain error types. Ā  CRC is given as a k bit message, and the transmitter creates an (n – k) bit sequence called a frame check sequence. The outcoming frame, including n bits, is precisely divisible by a fixed number. Modulo 2 Arithmetic is used in this binary addition with no carries, similar to the XOR operation. The redundancy bits used by CRC are changed by splitting the data block by a fixed divisor.Ā  Procedure A string of 'n' 0s is added to the data block. 'n' is one smaller than the number of bits in the divisor. Using a binary division procedure, the new data block is divided by a divisor. The remainder obtained from the division is the CRC. The CRC of 'n' bits interpreted in step 2 restores the added 0s at the end of the data block. CRC GeneratorĀ  Source: https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check CRC Checker Source:Ā  https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check Example Consider the case where the data to be transmitted is 1001 and the predetermined divisor is 1011. The further steps are as follows:- Step 1: The data block 1011000 is divided by 1011. CRC generated at the sender's side Source:Ā  https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check Ā  Step 2: During this division process, whenever the leftmost bit of dividend or remainder is 0, we use a string of 0s of the same length as the divisor. Thus, in this case, the divisor 1011 is replaced by 0000. Step 3: At the receiver side, the data received is 1001110. Step 4: This data is again divided by a divisor 1011. Step 5: The remainder obtained is 000. This implies there is no error. CRC decoded at the receiver's side Source:Ā  https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check FAQs What is an error in data transmission? An error is when the receiver's information does not match the sender's information. During the transmission, digital signals may suffer from noise that can introduce errors in the binary bits(0/1) traveling from the sender end to the receiver end.Ā  Ā  Mention some of the features of error detection codes. Some of the features of error detection codes are as follows:- Error detection codes are used when we use message backward error correction techniques for reliable data transmission. The receiver sends a feedback message to inform the sender whether the message is received without any error or not at the receiver side. If the message contains errors, the sender retransmits the message. The message is contained in fixed-size blocks of bits in error detection codes. In this, the redundant bits are added for correcting and detecting errors. Error detection codes involve checking the error.Ā  Ā  Explain the two-dimensional parity check. In a two-dimensional parity check, the parity check bits are calculated for each row, like a normal parity check bit. The parity check bits are also calculated for all columns, and then both are sent along with the data. These are compared with the parity bits calculated on the received data at the receiving end. Ā  What are the qualities required for CRC? The qualities required for CRC are as follows:- CRC must have accurately one less bit than the divisor. Adding the CRC to the end of the data block should result in the bit sequence that is divisible by the divisor. Key Takeaways In this article, we have extensively discussed the need forĀ  error detection and correction code techniques and the various techniques like parity code and cyclic redundancy check. Error detection and correction code play an essential role in transmitting data from one source to another. And it is vital to have proper knowledge of this to avoid receiving erroneous data. Recommended Reading:Ā  Spring Boot Architecture We hope that this blog has helped you enhance your knowledge regarding error detection and correction code techniques and if you would like to learn more, check out our articles onĀ  Error Detection and Correction Code: Part 2 . Do upvote our blog to help other ninjas grow. Happy Coding!
Markdown
![](<data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wI iBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI5OTk5OXB4IiBoZWlnaHQ9Ijk5OTk5cHgiIHZpZXdCb3g9IjAgMCA5OTk5OSA5OTk5OSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8v d3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZyBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGZpbGwtb3BhY2l0eT0iMCI+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijk5OTk5IiBoZWlnaHQ9Ijk5OTk5Ij48L3JlY3Q+IDwvZz4gPC9zdmc+>) ![](https://static.naukimg.com/s/0/0/i/transparentImg.png) [![Naukri Code 360](https://files.codingninjas.in/new-cn-logos-1-1711622387.svg)]() - [Learn]() - [Contests & Events]() - [Interview prep]() - [Practice]() - [Resources]() [![Naukri Logo](https://static.naukimg.com/code360/assets/icons/logos/naukri-360-logo.svg)]() ![potd-icon](https://files.codingninjas.in/potd-icon-1752047992.svg) Become AI ready Login ![polygon-arrow](https://static.naukimg.com/code360/assets/icons/polygon-arrow.svg) [![home](https://files.codingninjas.in/vector-15-27020.svg)Naukri Code 360](https://www.naukri.com/code360) ![expand-more](https://files.codingninjas.in/chevron-right-27024.svg) [Library](https://www.naukri.com/code360/library) ![expand-more](https://files.codingninjas.in/chevron-right-27024.svg) [Computer Organization and Architecture](https://www.naukri.com/code360/library/computer-organization-and-architecture) ![expand-more](https://files.codingninjas.in/chevron-right-27024.svg) [Data Representation and Computer Arithmetic](https://www.naukri.com/code360/library/data-representation-and-computer-arithmetic) ![expand-more](https://files.codingninjas.in/chevron-right-27024.svg) Error Detection and Correction Code: Part 1 Browse Categories Table of contents 1\. Introduction 2\. Error Detection and Correction Code 2\.1. Error detection codes 2\.2. Error correction codes 3\. Parity code 3\.1. Even Parity Codes 3\.2. Odd Parity Codes 4\. Cyclic Redundancy Check (CRC) 4\.1. Procedure 4\.2. Example 5\. FAQs 6\. Key Takeaways Last Updated: Mar 27, 2024 # Error Detection and Correction Code: Part 1 [![](https://files.codingninjas.in/article_images/profile20216838ecaf26350bd315ccec99ec17a8325f.webp)Author Hari Sapna Nair](https://www.naukri.com/code360/profile/709e4e41-a596-4cd6-8ac6-eecaedc4da17) ![](https://files.codingninjas.in/share-26616.svg) Share 2 upvotes ![](https://files.codingninjas.in/1f4a1_lightbulb_1024px-1-1727764132.webp) Career growth poll Do you think IIT Guwahati certified course can help you in your career? Yes No ## Introduction The bits 0 and 1 correspond to the two different ranges of analog voltages. So, during the transmission of binary data from one system to the other, the noise also gets added. Due to this, errors might be there in the received data at the other system. This means that a bit 0 may change to 1, or a bit 1 may change to 0. It is impossible to avoid noise interference. But, we can definitely get back the original data first by various error detection and correction code techniques. In this article, we will extensively discuss the need for **error detection and correction code techniques** and the various techniques like parity code and cyclic redundancy check. Recommended Topic - [Shift Registers in Digital Electronics](https://www.naukri.com/code360/library/shift-registers-in-digital-logic) ## Error Detection and Correction Code To get back the original data, we first need to detect whether an error is present or not using error detection codes. If the error is present in the code, we will correct it with the help of error correction codes. This is achieved using the following codes:- - Error detection codes - Error correction codes ### Error detection codes **Error detection codes** detect errors in the received data bitstream. These codes contain some additional bits, which are appended to the original bitstream at the time of transmission. These codes detect the error if it occurs during transmission of the original data bitstream. Error detecting codes encode the message before sending it over the noisy channels. The encoding scheme is performed so that the decoder at the receiving can easily find the errors in the receiving data with a higher chance of success. Example: Parity code, Hamming code, etc. ### Error correction codes **Error correction codes** are used to correct the errors present in the received data bitstream to receive the original data. Error correction codes also use a similar strategy of error detection codes. Error correction codes are generated using a specific algorithm to remove and detect errors from the message transmitted over the noisy channels. The error-correcting codes find the correct number of corrupted bits and their positions in the message. There are two types of Error Correction Codes (ECCs). They are as follows:- - Block codes In block codes, the message is contained in fixed-size blocks of bits, and the redundant bits are added to correct and detect errors. - Convolutional codes The message consists of data streams of a random length in convolutional codes. And here, the parity symbols are generated by the sliding application of the boolean function to the data stream. Let's discuss some popular techniques like parity check, cyclic redundancy check, etc. ## Parity code In the parity code, we add one parity bit either to the left to the MSB(Most Significant Bit) or the right of the LSB(Least Significant Bit) to the original bitstream. Based on the parity type being chosen, there are two types of parity codes: even parity codes and odd parity codes. ### Even Parity Codes In an even parity code, there are an even number of ones present. It contains the data bits as well as an even parity bit. The value of the even parity bit should be zero if an even number of ones are present in the binary code. Otherwise, the even parity bit should be one. The table shows the even parity codes corresponding to each of the 3-bit binary codes. | | | | |---|---|---| | **Binary Code** | **Even Parity bit** | **Even Parity Code** | | 000 | 0 | 0000 | | 001 | 1 | 0011 | | 010 | 1 | 0101 | | 011 | 0 | 0110 | | 100 | 1 | 1001 | | 101 | 0 | 1010 | | 110 | 0 | 1100 | | 111 | 1 | 1111 | **Note:** The even parity bit is included to the right of the LSB of binary code. 4 bits are present in the even parity codes. The parity codes can have 0, 2, or 4 ones to have an even parity code. If the receiver system receives one of the even parity codes, no error is there in the received data. The bits other than even parity bit are the same as that of binary code. If the receiver system receives a code other than an even parity code, the received data will have an error. However, the original binary code cannot be obtained as we are unaware of the bit position of the error. ### Odd Parity Codes There is an odd number of ones present in an odd parity code. It contains the data bits as well as an even parity bit. The value of the odd parity bit should be one if an even number of ones are present in the binary code. Otherwise, the odd parity bit should be zero. The table shows the odd parity codes corresponding to each of the 3-bit binary codes. | | | | |---|---|---| | **Binary Code** | **Odd Parity bit** | **Odd Parity Code** | | 000 | 1 | 0001 | | 001 | 0 | 0010 | | 010 | 0 | 0100 | | 011 | 1 | 0111 | | 100 | 0 | 1000 | | 101 | 1 | 1011 | | 110 | 1 | 1101 | | 111 | 0 | 1110 | **Note:** The even parity bit is included to the right of the LSB of binary code. 4 bits are present in the odd parity codes. The parity codes can have 1 or 3 ones to have an odd parity code. If the receiver system receives one of the odd parity codes, there is no error in the received data. The bits other than the odd parity bit are the same as that of binary code. If the receiver system receives a code other than an odd parity code, the received data will have an error. However, the original binary code cannot be obtained as we are unaware of the bit position of the error. Also see, [what is middleware](https://www.naukri.com/code360/library/what-is-middleware) ## Cyclic Redundancy Check (CRC) **Cyclic Redundancy Check** (CRC) is an error detection mechanism in which a unique number is appended to a data block to detect any errors introduced during storage or transmission). The unique number is recalculated on retrieval and compared to the value originally transmitted, revealing certain error types. CRC is given as a k bit message, and the transmitter creates an (n – k) bit sequence called a frame check sequence. The outcoming frame, including n bits, is precisely divisible by a fixed number. Modulo 2 Arithmetic is used in this binary addition with no carries, similar to the XOR operation. The redundancy bits used by CRC are changed by splitting the data block by a fixed divisor. ### Procedure - A string of 'n' 0s is added to the data block. 'n' is one smaller than the number of bits in the divisor. - Using a binary division procedure, the new data block is divided by a divisor. The remainder obtained from the division is the CRC. - The CRC of 'n' bits interpreted in step 2 restores the added 0s at the end of the data block. ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-0-1645900065.jpg) **CRC Generator** Source: https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-1-1645900065.jpg) **CRC Checker** **Source:** https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check ### Example Consider the case where the data to be transmitted is 1001 and the predetermined divisor is 1011. The further steps are as follows:- Step 1: The data block 1011000 is divided by 1011. ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-2-1645900065.webp) **CRC generated at the sender's side** **Source:** https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check Step 2: During this division process, whenever the leftmost bit of dividend or remainder is 0, we use a string of 0s of the same length as the divisor. Thus, in this case, the divisor 1011 is replaced by 0000. Step 3: At the receiver side, the data received is 1001110. Step 4: This data is again divided by a divisor 1011. Step 5: The remainder obtained is 000. This implies there is no error. ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-3-1645900066.webp) **CRC decoded at the receiver's side** **Source:** https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check ## FAQs 1. **What is an error in data transmission?** An error is when the receiver's information does not match the sender's information. During the transmission, digital signals may suffer from noise that can introduce errors in the binary bits(0/1) traveling from the sender end to the receiver end. 2. **Mention some of the features of error detection codes.** Some of the features of error detection codes are as follows:- Error detection codes are used when we use message backward error correction techniques for reliable data transmission. The receiver sends a feedback message to inform the sender whether the message is received without any error or not at the receiver side. If the message contains errors, the sender retransmits the message. The message is contained in fixed-size blocks of bits in error detection codes. In this, the redundant bits are added for correcting and detecting errors. Error detection codes involve checking the error. 3. **Explain the two-dimensional parity check.** In a two-dimensional parity check, the parity check bits are calculated for each row, like a normal parity check bit. The parity check bits are also calculated for all columns, and then both are sent along with the data. These are compared with the parity bits calculated on the received data at the receiving end. 4. **What are the qualities required for CRC?** The qualities required for CRC are as follows:- CRC must have accurately one less bit than the divisor. Adding the CRC to the end of the data block should result in the bit sequence that is divisible by the divisor. ## Key Takeaways In this article, we have extensively discussed the need for **error detection and correction code techniques** and the various techniques like parity code and cyclic redundancy check. Error detection and correction code play an essential role in transmitting data from one source to another. And it is vital to have proper knowledge of this to avoid receiving erroneous data. Recommended Reading: [Spring Boot Architecture](https://www.naukri.com/code360/library/spring-boot-architecture) We hope that this blog has helped you enhance your knowledge regarding error detection and correction code techniques and if you would like to learn more, check out our articles on [Error Detection and Correction Code: Part 2](https://www.naukri.com/code360/library/error-detection-and-correction-code-part-2). Do upvote our blog to help other ninjas grow. Happy Coding\! [![](https://files.codingninjas.in/vector-8-26475.svg) Previous articleFixed and Floating-Point Representation](https://www.naukri.com/code360/library/fixed-and-floating-point-representation) [![](https://files.codingninjas.in/vector-8-26475.svg) Next articleError Detection and Correction Code: Part 2](https://www.naukri.com/code360/library/error-detection-and-correction-code-part-2) Live masterclass ![author](https://files.codingninjas.in/group-1000004376-1707897701.webp) Zomato Data Analysis Case Study: Ace 25L+ Roles in FoodTech by Abhishek Soni 16 Mar, 2026 01:30 PM ![discord](https://files.codingninjas.in/discord-community-34581.svg) 39+ registered Register now ![author](https://files.codingninjas.in/sumit-shukla-1753426333.webp) Data Analysis for 20L+ CTC@Flipkart: End-Season Sales dataset by Sumit Shukla 15 Mar, 2026 06:30 AM ![discord](https://files.codingninjas.in/discord-community-34581.svg) 267+ registered Register now ![author](https://files.codingninjas.in/cn-1_11zon-1738591718.jpg) Beginner to GenAI Engineer Roadmap for 30L+ CTC at Amazon by Shantanu Shubham 15 Mar, 2026 08:30 AM ![discord](https://files.codingninjas.in/discord-community-34581.svg) 55+ registered Register now ![author](https://files.codingninjas.in/group-1000004215-1706175120.webp) Multi-Agent AI Systems: Live Workshop for 25L+ CTC at Google by Saurav Prateek 16 Mar, 2026 03:00 PM ![discord](https://files.codingninjas.in/discord-community-34581.svg) 8+ registered Register now ![author](https://files.codingninjas.in/group-1000004376-1707897701.webp) Zomato Data Analysis Case Study: Ace 25L+ Roles in FoodTech by Abhishek Soni 16 Mar, 2026 01:30 PM ![discord](https://files.codingninjas.in/discord-community-34581.svg) 39+ registered Register now ![author](https://files.codingninjas.in/sumit-shukla-1753426333.webp) Data Analysis for 20L+ CTC@Flipkart: End-Season Sales dataset by Sumit Shukla 15 Mar, 2026 06:30 AM ![discord](https://files.codingninjas.in/discord-community-34581.svg) 267+ registered Register now [View more events](https://www.naukri.com/code360/events) Library: [Java](https://www.naukri.com/code360/library/introduction-to-java) [Python](https://www.naukri.com/code360/library/python-introduction) [C Programming Language](https://www.naukri.com/code360/library/introduction-to-c-programming) [C++ Programming Language](https://www.naukri.com/code360/library/introduction-to-cpp) [Cloud Computing](https://www.naukri.com/code360/library/introduction-to-cloud-computing) [Node JS](https://www.naukri.com/code360/library/introduction-to-node-js) [Machine Learning](https://www.naukri.com/code360/library/what-is-machine-learning) [Deep Learning](https://www.naukri.com/code360/library/introduction-to-deep-learning) [Big Data](https://www.naukri.com/code360/library/what-is-big-data) [Operating System](https://www.naukri.com/code360/library/introduction-to-operating-system) [Go Language](https://www.naukri.com/code360/library/introduction-to-go) [C\#](https://www.naukri.com/code360/library/introduction-to-csharp) [Ruby](https://www.naukri.com/code360/library/try-ruby) [Amazon Web Services](https://www.naukri.com/code360/library/introduction-to-aws) [Microsoft Azure](https://www.naukri.com/code360/library/introduction-to-microsoft-azure) [Google Cloud Platform](https://www.naukri.com/code360/library/introduction-to-google-cloud-platform) [Data Warehousing](https://www.naukri.com/code360/library/what-is-data-warehousing) [Internet of Things](https://www.naukri.com/code360/library/what-is-iot) Get the tech career you deserve faster with Coding Ninjas courses ![](https://files.codingninjas.in/rating-icon-1707845184.svg)User rating 4.7/5 ![](https://files.codingninjas.in/doubt-support-icon-1707845195.svg)1:1 doubt support ![](https://files.codingninjas.in/placement-record-icon-1707845206.svg)95% placement record Request a callback [![](https://files.codingninjas.in/new-cn-logo-1710838777.svg)](https://www.codingninjas.com/) [About us](https://www.codingninjas.com/about) [Success stories](https://www.codingninjas.com/review) [Privacy policy](https://www.codingninjas.com/policy/privacy.pdf) [Terms & conditions](https://www.codingninjas.com/policy/tnc.pdf) Our courses [![](https://files.codingninjas.in/bootcamp-dark-logo-1707932100.svg)](https://www.codingninjas.com/programs/job-bootcamp-web-development) Follow us on [![instagram](https://files.codingninjas.in/instagram-icon-1707930846.svg)](https://www.instagram.com/coding.ninjas/) [![twitter](https://files.codingninjas.in/twitter-icon-1707930870.svg)](https://twitter.com/CodingNinjasOff) [![facebook](https://files.codingninjas.in/fb-icon-1707930909.svg)](https://www.facebook.com/codingninjas) [![youtube](https://files.codingninjas.in/youtube-icon-1707930919.svg)](https://www.youtube.com/c/CodingNinjasIndia) [![linkedin](https://files.codingninjas.in/linkedin-icon-1707930879.svg)](https://www.linkedin.com/company/coding-ninjas-india/) Contact us [1800-123-3598](tel:1800-123-3598) [code360@codingninjas.com](mailto:code360@codingninjas.com) [![](https://files.codingninjas.in/naukri-new-logo-1710845932.svg)](https://www.naukri.com/) [Privacy policy](https://www.naukri.com/privacypolicy) [Terms & conditions](https://www.naukri.com/termsconditions) Download the naukri app [![](https://files.codingninjas.in/google-play-store-1707987408.svg)](https://play.google.com/store/apps/details?id=naukriApp.appModules.login&pcampaignid=web_share)[![](https://files.codingninjas.in/app-store-1707987418.svg)](https://apps.apple.com/in/app/naukri-com-job-search/id482877505)
Readable Markdown
## Introduction The bits 0 and 1 correspond to the two different ranges of analog voltages. So, during the transmission of binary data from one system to the other, the noise also gets added. Due to this, errors might be there in the received data at the other system. This means that a bit 0 may change to 1, or a bit 1 may change to 0. It is impossible to avoid noise interference. But, we can definitely get back the original data first by various error detection and correction code techniques. In this article, we will extensively discuss the need for **error detection and correction code techniques** and the various techniques like parity code and cyclic redundancy check. Recommended Topic - [Shift Registers in Digital Electronics](https://www.naukri.com/code360/library/shift-registers-in-digital-logic) ## Error Detection and Correction Code To get back the original data, we first need to detect whether an error is present or not using error detection codes. If the error is present in the code, we will correct it with the help of error correction codes. This is achieved using the following codes:- - Error detection codes - Error correction codes ### Error detection codes **Error detection codes** detect errors in the received data bitstream. These codes contain some additional bits, which are appended to the original bitstream at the time of transmission. These codes detect the error if it occurs during transmission of the original data bitstream. Error detecting codes encode the message before sending it over the noisy channels. The encoding scheme is performed so that the decoder at the receiving can easily find the errors in the receiving data with a higher chance of success. Example: Parity code, Hamming code, etc. ### Error correction codes **Error correction codes** are used to correct the errors present in the received data bitstream to receive the original data. Error correction codes also use a similar strategy of error detection codes. Error correction codes are generated using a specific algorithm to remove and detect errors from the message transmitted over the noisy channels. The error-correcting codes find the correct number of corrupted bits and their positions in the message. There are two types of Error Correction Codes (ECCs). They are as follows:- - Block codes In block codes, the message is contained in fixed-size blocks of bits, and the redundant bits are added to correct and detect errors. - Convolutional codes The message consists of data streams of a random length in convolutional codes. And here, the parity symbols are generated by the sliding application of the boolean function to the data stream. Let's discuss some popular techniques like parity check, cyclic redundancy check, etc. ## Parity code In the parity code, we add one parity bit either to the left to the MSB(Most Significant Bit) or the right of the LSB(Least Significant Bit) to the original bitstream. Based on the parity type being chosen, there are two types of parity codes: even parity codes and odd parity codes. ### Even Parity Codes In an even parity code, there are an even number of ones present. It contains the data bits as well as an even parity bit. The value of the even parity bit should be zero if an even number of ones are present in the binary code. Otherwise, the even parity bit should be one. The table shows the even parity codes corresponding to each of the 3-bit binary codes. | | | | |---|---|---| | **Binary Code** | **Even Parity bit** | **Even Parity Code** | | 000 | 0 | 0000 | | 001 | 1 | 0011 | | 010 | 1 | 0101 | | 011 | 0 | 0110 | | 100 | 1 | 1001 | | 101 | 0 | 1010 | | 110 | 0 | 1100 | | 111 | 1 | 1111 | **Note:** The even parity bit is included to the right of the LSB of binary code. 4 bits are present in the even parity codes. The parity codes can have 0, 2, or 4 ones to have an even parity code. If the receiver system receives one of the even parity codes, no error is there in the received data. The bits other than even parity bit are the same as that of binary code. If the receiver system receives a code other than an even parity code, the received data will have an error. However, the original binary code cannot be obtained as we are unaware of the bit position of the error. ### Odd Parity Codes There is an odd number of ones present in an odd parity code. It contains the data bits as well as an even parity bit. The value of the odd parity bit should be one if an even number of ones are present in the binary code. Otherwise, the odd parity bit should be zero. The table shows the odd parity codes corresponding to each of the 3-bit binary codes. | | | | |---|---|---| | **Binary Code** | **Odd Parity bit** | **Odd Parity Code** | | 000 | 1 | 0001 | | 001 | 0 | 0010 | | 010 | 0 | 0100 | | 011 | 1 | 0111 | | 100 | 0 | 1000 | | 101 | 1 | 1011 | | 110 | 1 | 1101 | | 111 | 0 | 1110 | **Note:** The even parity bit is included to the right of the LSB of binary code. 4 bits are present in the odd parity codes. The parity codes can have 1 or 3 ones to have an odd parity code. If the receiver system receives one of the odd parity codes, there is no error in the received data. The bits other than the odd parity bit are the same as that of binary code. If the receiver system receives a code other than an odd parity code, the received data will have an error. However, the original binary code cannot be obtained as we are unaware of the bit position of the error. Also see, [what is middleware](https://www.naukri.com/code360/library/what-is-middleware) ## Cyclic Redundancy Check (CRC) **Cyclic Redundancy Check** (CRC) is an error detection mechanism in which a unique number is appended to a data block to detect any errors introduced during storage or transmission). The unique number is recalculated on retrieval and compared to the value originally transmitted, revealing certain error types. CRC is given as a k bit message, and the transmitter creates an (n – k) bit sequence called a frame check sequence. The outcoming frame, including n bits, is precisely divisible by a fixed number. Modulo 2 Arithmetic is used in this binary addition with no carries, similar to the XOR operation. The redundancy bits used by CRC are changed by splitting the data block by a fixed divisor. ### Procedure - A string of 'n' 0s is added to the data block. 'n' is one smaller than the number of bits in the divisor. - Using a binary division procedure, the new data block is divided by a divisor. The remainder obtained from the division is the CRC. - The CRC of 'n' bits interpreted in step 2 restores the added 0s at the end of the data block. ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-0-1645900065.jpg) **CRC Generator** Source: https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-1-1645900065.jpg) **CRC Checker** **Source:** https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check ### Example Consider the case where the data to be transmitted is 1001 and the predetermined divisor is 1011. The further steps are as follows:- Step 1: The data block 1011000 is divided by 1011. ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-2-1645900065.webp) **CRC generated at the sender's side** **Source:** https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check Step 2: During this division process, whenever the leftmost bit of dividend or remainder is 0, we use a string of 0s of the same length as the divisor. Thus, in this case, the divisor 1011 is replaced by 0000. Step 3: At the receiver side, the data received is 1001110. Step 4: This data is again divided by a divisor 1011. Step 5: The remainder obtained is 000. This implies there is no error. ![](https://files.codingninjas.in/article_images/error-detection-and-correction-code-part-1-3-1645900066.webp) **CRC decoded at the receiver's side** **Source:** https://ecomputernotes.com/computernetworkingnotes/communication-networks/cyclic-redundancy-check ## FAQs 1. **What is an error in data transmission?** An error is when the receiver's information does not match the sender's information. During the transmission, digital signals may suffer from noise that can introduce errors in the binary bits(0/1) traveling from the sender end to the receiver end. 2. **Mention some of the features of error detection codes.** Some of the features of error detection codes are as follows:- Error detection codes are used when we use message backward error correction techniques for reliable data transmission. The receiver sends a feedback message to inform the sender whether the message is received without any error or not at the receiver side. If the message contains errors, the sender retransmits the message. The message is contained in fixed-size blocks of bits in error detection codes. In this, the redundant bits are added for correcting and detecting errors. Error detection codes involve checking the error. 3. **Explain the two-dimensional parity check.** In a two-dimensional parity check, the parity check bits are calculated for each row, like a normal parity check bit. The parity check bits are also calculated for all columns, and then both are sent along with the data. These are compared with the parity bits calculated on the received data at the receiving end. 4. **What are the qualities required for CRC?** The qualities required for CRC are as follows:- CRC must have accurately one less bit than the divisor. Adding the CRC to the end of the data block should result in the bit sequence that is divisible by the divisor. ## Key Takeaways In this article, we have extensively discussed the need for **error detection and correction code techniques** and the various techniques like parity code and cyclic redundancy check. Error detection and correction code play an essential role in transmitting data from one source to another. And it is vital to have proper knowledge of this to avoid receiving erroneous data. Recommended Reading: [Spring Boot Architecture](https://www.naukri.com/code360/library/spring-boot-architecture) We hope that this blog has helped you enhance your knowledge regarding error detection and correction code techniques and if you would like to learn more, check out our articles on [Error Detection and Correction Code: Part 2](https://www.naukri.com/code360/library/error-detection-and-correction-code-part-2). Do upvote our blog to help other ninjas grow. Happy Coding\!
Shard162 (laksa)
Root Hash12824966294148467362
Unparsed URLcom,naukri!www,/code360/library/error-detection-and-correction-code-part-1 s443