Year 11 Exam  >  Year 11 Notes  >  Computer for GCSE/IGCSE  >  Check Digits

Check Digits | Computer for GCSE/IGCSE - Year 11 PDF Download

Check Digits

  • Check Digits are used to determine if data has been corrupted without revealing where the corruption occurred.
  • Data is transmitted in blocks with an additional check digit added at the end of each block.
  • Check Digits are custom user-created algorithms designed to perform specific mathematical calculations on data.
  • For example, consider the ISBN value found on books: 
    • Each book has a unique ISBN number that serves as an identifier. 
    • A standard ISBN number can consist of ten digits, such as 965-448-765-9. 
    • The final digit, known as the check digit (e.g., 9 in this case), is strategically chosen so that after applying the algorithm, the result is a whole number with no remainders. 
    • By performing a check digit algorithm on the ISBN number, its validity can be confirmed.

ISBN Check Digit Walkthrough

To verify the validity of an ISBN, a specific algorithm is applied. Let's take an example with the ISBN "965-448-765-9":

  • Multiply each digit of the ISBN by numbers from 1 to 10 and sum them up:
  • 9x1 + 6x2 + 5x3 + 4x4 + 4x5 + 8x6 + 7x7 + 6x8 + 5x9 + 9x10 = 352
  • Divide the total sum by 11:
  • 352 ÷ 11 = 32
  • Since 32 is a whole number without any remainder, the ISBN is considered valid.

Another instance of a check digit application is in barcodes found on purchasable items:

  • Barcodes are comprised of black and white lines, scannable by barcode scanners. These scanners emit a laser onto the lines, capturing the reflected light. By measuring the distances between these lines, the scanner deciphers numbers, thereby identifying the item.
  • Additionally, barcodes employ a sequence of digits to uniquely distinguish each item, with the number of digits varying across codes. For instance, 9780201379624.
  • Typically, the last digit in a barcode serves as the check digit, akin to an ISBN, which aids in validating and authenticating the item.

Barcode Check Digit Walkthrough

Understanding how to calculate a check digit for a barcode involves a specific algorithm that helps ensure the accuracy of the code. Let's break down the process step by step:

Basic Barcode Check Digit Calculation

  • Take, for example, the barcode number 9780201379624. The last digit (4) is the check digit.
  • Next, multiply each digit by 1 or 3, alternating between these two values, and then sum them up:
    • 9x1 + 7x3 + 8x1 + 0x3 + 2x1 + 0x3 + 1x1 + 3x3 + 7x1 + 9x3 + 6x1 + 2x3 = 96
  • The check digit is calculated by finding the difference between the sum and the nearest multiple of 10 that is equal to or greater than the sum. In this case:
    • Rounded sum to the nearest 10: 100
    • Check digit calculation: 100 - 96 = 4
  • Therefore, the check digit for the barcode number 9780201379624 is 4, which validates the original barcode.

Custom Check Digit Algorithm in Computer Science

  • In computer science, a custom check digit algorithm may be implemented for data integrity verification:
  • A check digit byte, ranging from 1 to 255 and stored in 8 bits, is used for this purpose.
  • When the sum of all bytes in a data block is 255 or less, the check digit is simply the sum of all bytes.
  • If the sum exceeds 255, an algorithm is applied:
    • Let X be the sum of all bytes.
    • Calculate Y: Y = X / 256 (round down to the nearest whole number).
    • Set Z: Z = Y * 256.
    • The check digit is then determined as: Check digit = X - Z.

Question for Check Digits
Try yourself:
What is the purpose of check digits?
View Solution

Custom Check Digit Walkthrough

  • For instance, if X equals 1496, Y would be 1496 divided by 256, resulting in 5.84. Rounded down, Y becomes 5.
    • Subsequently, Z is calculated as 5 multiplied by 256, which equals 1280.
    • The check digit is deduced by finding the difference between 1496 and 1280, yielding 216.
    • In this scenario, the check digit value is 216.
  • When data is transmitted, the check digit is first computed and sent alongside the data block.
  • Upon receiving the data, the check digit is recalculated based on the received information and matched against the transmitted check digit.
  • If both values align, the data is error-free. However, in case of discrepancies, a resend request is initiated for data retransmission.
The document Check Digits | Computer for GCSE/IGCSE - Year 11 is a part of the Year 11 Course Computer for GCSE/IGCSE.
All you need of Year 11 at this link: Year 11
92 docs|30 tests

Top Courses for Year 11

FAQs on Check Digits - Computer for GCSE/IGCSE - Year 11

1. What is a check digit?
Ans. A check digit is a digit added to a number, such as an ISBN or barcode, to help verify the accuracy of the number. It is calculated based on the other digits in the number using a specific algorithm.
2. Why are check digits important in identifying codes like ISBNs and barcodes?
Ans. Check digits are important because they help to detect errors in the codes. By using a check digit, it is possible to determine if a code has been entered or scanned correctly, reducing the likelihood of mistakes.
3. How is a check digit calculated for an ISBN?
Ans. To calculate the check digit for an ISBN, each digit in the ISBN is multiplied by a weight factor, alternating between 1 and 3. The products of these multiplications are then added together, and the check digit is the number that needs to be added to this sum to make it a multiple of 10.
4. Can a check digit be used to prevent fraudulent activities?
Ans. While check digits can help to detect errors in codes, they are not foolproof in preventing fraudulent activities. However, they do serve as an additional layer of security and can help to verify the authenticity of a code.
5. Are check digits used in all types of codes and identification numbers?
Ans. Check digits are commonly used in codes like ISBNs and barcodes, but they may not be used in all types of identification numbers. The use of check digits depends on the specific system and the need for accuracy and error detection.
92 docs|30 tests
Download as PDF
Explore Courses for Year 11 exam

Top Courses for Year 11

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

practice quizzes

,

Check Digits | Computer for GCSE/IGCSE - Year 11

,

study material

,

Exam

,

video lectures

,

Check Digits | Computer for GCSE/IGCSE - Year 11

,

past year papers

,

Previous Year Questions with Solutions

,

ppt

,

Free

,

MCQs

,

mock tests for examination

,

Semester Notes

,

Objective type Questions

,

pdf

,

Extra Questions

,

Summary

,

Viva Questions

,

Sample Paper

,

Important questions

,

Check Digits | Computer for GCSE/IGCSE - Year 11

,

shortcuts and tricks

;