Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Cracking the Code Moshe Kam, VP for Educational Activities A Presentation to IEEE TISP workshop in Piura Peru August 2007 Version 001 29 July 2006.

Similar presentations


Presentation on theme: "1 Cracking the Code Moshe Kam, VP for Educational Activities A Presentation to IEEE TISP workshop in Piura Peru August 2007 Version 001 29 July 2006."— Presentation transcript:

1 1 Cracking the Code Moshe Kam, VP for Educational Activities A Presentation to IEEE TISP workshop in Piura Peru August 2007 Version 001 29 July 2006

2 2 A Note on Sources l This presentation is based on multiple on-line and other archived sources l See bibliography page for a list

3 3 The History of Bar Codes

4 4 Bar Code l A machine-readable representation of information in a visual format on a surface l Using dark ink on white substrate l Creating high and low reflectance, which is converted to 1s and 0s l Used for computer data entry through optical scanners l Barcode readers

5 5 History l Bernard Silver (1923-1962), a graduate student at Drexel Institute of Technology in Philadelphia, overheard the president of a local food chain asking one of the deans to undertake research to develop a system to automatically read product information during checkout. l Silver told his friend, Norman Joseph Woodland, about the food chain president's request l Woodland was a twenty seven year old graduate student and teacher at Drexel l The problem fascinated Woodland and he began to work on it

6 6 History l Officially, Jordin Johanson, Bernard Silver and Norman Joseph Woodland from Drexel Institute of Technology invented the Bar Code in 1948 l Woodland described how he ‘elongated’ the Morse Code on the sand while at the beach to develop the key idea l Applied for patent in 1949 l Granted 1952 l U.S. patent 2,612,994 l "Classifying Apparatus and Method."

7 7 Norman Joseph Woodland l Born 1921 l WWII – Technical Assistant at the Manhattan Project l BSME, Drexel 1947 l Lecturer at Drexel 1948-1949 l Joined IBM in 1951 1992 National US Medal of Technology ceremony

8 8 First industrial application of automatic identification l Late 1950s: The Association of American Railroad decide to fund automatic identification l 1967: optical bar code l October 10, 1967: car labeling and scanner installation begins l 1974: 95% of the fleet is labeled l l Late 1970s: system abandoned

9 9 A long road to commercialization 1966-1967 l Bar code was not commercialized until 1966 l The National Association of Food Chains (NAFC) put out a call to equipment manufacturers for systems that would speed the checkout process. l l In 1967 RCA installed one of the first scanning systems at a Kroger store in Cincinnati l The product codes were represented by "bull's- eye barcodes", a set of concentric circular bars and spaces of varying widths.

10 10 A long road to commercialization 1969-1973 l 1970: “Universal Grocery Products Identification Code (UGPIC)” l l 1970: The U.S. Supermarket Ad Hoc Committee on a Uniform Grocery Product Code l 1973 the Committee recommended the adoption of the UPC symbol set still used in the USA today l UPC was submitted by IBM and developed by George Laurer

11 11 A long road to commercialization 1974 l June 1974: one of the first UPC scanner, made by National Cash Register Co., was installed at Marsh's supermarket in Troy, Ohio l June 26, 1974, the first product with a bar code was scanned at a check-out counter l A 10-pack of Wrigley's Juicy Fruit chewing gum l On display at the Smithsonian Institution's National Museum of American History

12 12 A long road to commercialization US DoD mandates use l September 1, 1981: the United States Department of Defense adopted the use of Code 39 for marking all products sold to the United States military l This system was called LOGMARS

13 13 Bar Codes Today l $16-billion-a-year business l l 600,000 manufacturing companies l 5 billion scans a day l UPC codes account for half of today's bar code technology

14 14 The UPC Code

15 15 The UPC-A Code l UPC version A barcodes (12 digits) l UPC version E shortened version (8 digits) l ISBN-13 barcodes on books l ISSN symbols on non-U.S. periodicals l EAN-13 and EAN-8 are used outside the U.S. l JAN-13 and JAN-8 are used in Japan Vendor number (5) Product number (5) Checksum Digit (1) Prefix (1) A 1 A 2 A 3 A 4 A 5 A 6 A 7 A 8 A 9 A 10 A 11 A 12

16 16 Restrictions: Prefix (A 1 ) l 0, 1, 6, 7, 8, or 9 for most products l l 2 reserved for local use (store/warehouse), for items sold by variable weight l 3 reserved for drugs by National Drug Code number l 4 reserved for local use (store/warehouse), often for loyalty cards or store coupons l 5 reserved for coupons A 1 A 2 A 3 A 4 A 5 A 6 A 7 A 8 A 9 A 10 A 11 A 12

17 17 The Checksum Digit

18 18 Checksum Digit Calculation (A 12 ) l Add the digits in the odd-numbered positions (first, third, fifth, etc.) together and multiply by three l Add the digits in the even-numbered positions (second, fourth, sixth, etc.) to the result l Calculate how much you need to add so that the number become a multiple of 10 l The answer is the checksum digit (A 12 )

19 19 In symbols l Calculate l 3 (A 1 + A 3 + A 5 + A 7 + A 9 + A 11 ) + A 2 + A 4 + A 6 + A 8 + A 10 = S l How much do we have to add to S to make it a multiple of 10 l If S=2 we need to add 8 to make it 10 l If S=17 we need to add 3 to make it 20 l If S=45 we need to add 5 to make it 50

20 20 088542318258

21 21 l Add the digits in odd- numbered positions l SO = 0+8+4+3+8+5 = 28 l Multiply by 3 l SO3 = 28 times 3 =84 l Add the digits in even- numbered positions (but not the 12 th ) l SE = 8+5+2+1+2 = 18 l Add SO3 to SE l S= 84+18 = 102 l How much you need to add so that S become a multiple of 10 l To get to 110 we need to add 8 l So the checksum digit is 8 08854231825 8 08854231825 8 08854231825 8

22 22 025467406387

23 23 l Add the digits in odd- numbered positions l SO = 0+5+6+4+6+8 = 29 l Multiply by 3 l SO3 = 29 times 3 =87 l Add the digits in even- numbered positions (but not the 12 th ) l SE = 2+4+7+0+3 = 16 l Add SO3 to SE l 87+16 = 103 l How much you need to add so that S become a multiple of 10 l To get to 110 we need to add 7 l So the checksum digit is 7 02546740638?

24 24 l Add the digits in odd- numbered positions l SO = 0+5+6+4+6+8 = 29 l Multiply by 3 l SO3 = 29 times 3 =87 l Add the digits in even- numbered positions (but not the 12 th ) l SE = 2+4+7+0+3 = 16 l Add SO3 to SE l 87+16 = 103 l How much you need to add so that the number become a multiple of 10 l To get to 110 we need to add 7 l So the checksum digit is 7 025467406387

25 25 Activity 1 Detect the Fake Products!

26 26 Activity 1: detect the fake products! l You are given four products l Some of them are original l Some of them are cheap imitations l The imitators did not know about calculating the checksum digit properly l Which one of the products are original and which are fake?

27 27 Rolex Watch Wrangler Jeans A DVD Player A Personal Digital Assistant

28 28 Rolex Watch Wrangler Jeans A DVD Player A Personal Digital Assistant

29 29 Watch – authentic or not?

30 30 Jeans – authentic of not?

31 31 PDA – authentic or not?

32 32 DVD Player – authentic or not?

33 33 The UPC bar code as an Error Detecting Code

34 34 The UPC barcode detects single errors l If any one of the digits is corrupted, then there will be an error in the checksum digit calculation and we will know that an error has occurred

35 35 Detecting an error l If there is an error of +m (m>0) in A 2 A 4 A 6 A 8 A 10 then the checksum digit does not calculate correctly l If is New_A 2 = Old_A 2 + m where m>0 l If the check digit A 12 is greater than or equal to m (Old_A 12 ≥ m) l New_A 12 = Old A 12 -m l If the check digit A 12 is less than m (A 12 < m) l New_A 12 = 10 - (m- Old_A 12 ) This material is for the teacher

36 36 Detecting an error l If there is an error of +m in A 1 A 3 A 5 A 7 A 9 A 11 then the checksum digit does not calculate correctly l If is New_A 1 = Old_A 1 + m where m>0 l If the checksum digit A 12 is greater than or equal to 3m (A 12 ≥ 3m) l New_A 12 = Old A 12 - 3m l If the checksum digit A 12 is less than 3m (A 12 < 3m) l New_A 12 = 10 - (3m - Old_A 12 ) This material is for the teacher

37 37 New_A 1 = Old_A 1 + m ConditionChange in A 12 Old_A 12 ≥ 3mNew_A 12 = Old A 12 - 3m 0 < 3m – Old_A 12 ≤10New_A 12 = 10 – (3m – Old_A 12 ) 10 < 3m – Old_A 12 ≤20New_A 12 = 20 – (3m – Old_A 12 ) 20 < 3m – Old_A 12 New_A 12 = 30 – (3m – Old_A 12 ) This material is for the teacher

38 38 Activity 2 The Checksum Digit

39 39 Activity 2: effect of error on the checksum digit l Use code 088542318258 to draw the value of the checksum digit against all possible values of l A 2 (A 2 = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) l A 3 (A 3 = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

40 40 Value of digit A 2 Value of checksum digit 0 9 0 9

41 41 Value of digit A 3 Value of checksum digit 0 9 0 9

42 42 Activity 3 Properties of the Code

43 43 Activity 3: Answer a few questions… l Based on activity 2 – does it appear that if there is a single error in one of the digits, this code will detect it? l If there is a single error in one of the digits, will this code tell us which digit is wrong? l Prove your answer!

44 44 Activity 3 (continued) l Can this code always distinguish between a single error (an error in one and only one of the digits) and two errors (simultaneous errors in two digits)? l Prove your answer! l Is it possible that two errors will occur simultaneously and we will not be able to detect them using this code? l Prove your answer!

45 45 Error Correcting Code What happens if one of the digits is missing?

46 46 Code: 025467406387 l 025467406387 l 3(0+5+6+4+6+8)+(2+4+7+0+3)=103 l So to complete to 110 we needed 7 l Now suppose the fourth digit (4) is missing (M) l 025M67406387

47 47 Code 025M67406387 l Can we find M? 3(0+5+6+4+6+8)+(2+M+7+0+3)+7= 106+M l We know that the only number that would add to 106 to create the nearest multiple of 10 is 4 l 106 + 4 = 110 l So if the single digit 4 was missing the code can reconstruct it

48 48 Second example: Code 02M467406387 l Can we find M? 3(0+M+6+4+6+8)+(2+4+7+0+3)+7= 95+ 3M l This is harder… l What is the closest multiple of 10? l If it is 100 then 3M=5 l No, because M is not an integer l If it is 110 then 3M=15 and M=5 l If it is 120 then 3M=25 and M is greater than 9 and non-integer

49 49 Second example: Code 02M467406387 l Can we find M? 3(0+M+6+4+6+8)+(2+4+7+0+3)+7= 95+ 3M l This is harder… l What is the closest multiple of 10? l If it is 100 then 3M=5 l No, because M is not an integer l If it is 110 then 3M=15 and M=5 l If it is 120 then 3M=25 and M is greater than 9 and non-integer

50 50 Third example: Code 025467M06387 l Can we find M? 3(0+5+6+M+6+8)+(2+4+7+0+3)+7= 98+ 3M l What is the closest multiple of 10? l If it is 100 then 3M=2 l No, because M is not an integer l If it is 110 then 3M=12 and M=4 l If it is 120 then 3M=22 and M is not an integer

51 51 Third example: Code 025467M06387 l Can we find M? 3(0+5+6+M+6+8)+(2+4+7+0+3)+7= 98+ 3M l What is the closest multiple of 10? l If it is 100 then 3M=2 l No, because M is not an integer l If it is 110 then 3M=12 and M=4 l If it is 120 then 3M=22 and M is not an integer

52 52 Activity 4 Find the Missing Digit

53 53 Activity 4: Find the Missing Digit 014M91293368 0347M1295765

54 54 Answers

55 55 Transposition Error

56 56 Transposition error l Transposition error occurs when two adjacent digits interchange places Example l 025467406387 becomes 024567406387 l Does the UPC barcode correct transposition errors?

57 57 Transposition errors l If the digits A i and A i+1 are interchanged then the check sum would l change by either: l 3A i + A i+1 – 3A i+1 – A i = 2(A i – A i+1 ) l or l A i + 3 A i+1 – A i+1 – 3A i = 2(A i+1 – A i ). l Thus, if |A i – A i+1 | = 5, the change would be ±10 and so, the error would not be detected. This material is for the teacher

58 58 Activity 5 Does the Code Correct Transposition Errors?

59 59 Activity 5: Transposition Errors Check whether the UPC barcode detect a transposition error of 4-7, 7-1 and 1-6 in the left-hand side code Check whether the UPC barcode detect a transposition error of 2-7, 7-1, and 1-6 in the right-hand side code WHAT ARE YOUR CONCLUSIONS?

60 60 Summary

61 61 Summary – what have we learnt today? l The history of bar codes l How barcodes are designed and used l Some properties of UPC bar codes l New terms: l Error Detecting Code l Error Correcting Code

62 62 References (1) l Bar Code History Page http://www.adams1.com/pub/russadam/history.ht ml http://www.adams1.com/pub/russadam/history.ht ml l Bar Codes http://inventors.about.com/library/inventors/blbar _code.htm http://inventors.about.com/library/inventors/blbar _code.htm l UPC Bar Code FAQs http://www.makeupcbarcodes.com/UPC-barcode- FAQ/ http://www.makeupcbarcodes.com/UPC-barcode- FAQ/

63 63 References (2) l Free Barcode Image Generator http://www.idautomation.com/java/linearservlet.html http://www.idautomation.com/java/linearservlet.html l Joseph Woodland http://www.mem.drexel.edu/alumni/Joseph_Woodland.php http://www.mem.drexel.edu/alumni/Joseph_Woodland.php l Bar Code Symbologies l http://www.neodynamic.com/Products/BarcodeSysmbologi es.aspx http://www.neodynamic.com/Products/BarcodeSysmbologi es.aspx l Error Detection Schemes l http://www- math.cudenver.edu/~wcherowi/courses/m6409/errschemes. pdf http://www- math.cudenver.edu/~wcherowi/courses/m6409/errschemes. pdf

64 64 References: Wikipedia l http://en.wikipedia.org/wiki/Universal _Product_Code http://en.wikipedia.org/wiki/Universal _Product_Code l http://en.wikipedia.org/wiki/Barcode http://en.wikipedia.org/wiki/Barcode l http://en.wikipedia.org/wiki/Norman_ Joseph_Woodland http://en.wikipedia.org/wiki/Norman_ Joseph_Woodland

65 65 Questions or comments?


Download ppt "1 Cracking the Code Moshe Kam, VP for Educational Activities A Presentation to IEEE TISP workshop in Piura Peru August 2007 Version 001 29 July 2006."

Similar presentations


Ads by Google