Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Must work on Big Endian 7!! Most goods sold in U.S. and Canadian stores are marked with a Universal Product Code (UPC) The meanings of
Must work on Big Endian 7!!
Most goods sold in U.S. and Canadian stores are marked with a Universal Product Code (UPC) The meanings of the digits underneath the bar code (from left to right) are: * First digit: type of item, . First group of five digits: manufacturer * Second group of five digits: product, and Final digit: check digit, used to help identify an error in the preceding digits 0 13800"15073"8 To compute the check digit, * Add the first, third, fifth, seventh, ninth, and eleventh digits Add the second, fourth, sixth, eighth, and tenth digits . Multiply the first sum by 3 and add it to the second sum * The check digit is the digit which, when added to the above sum, produces a sum that is multiple of 10 o Subtract 1 from the total o o Compute the remainder when the adjusted total is divided by 10 Subtract the remainder from 9 Example for UPC 0 13800 15073 8: First sum: 0+3+0+1 0+3-7 Second sum: 1 +8 +0+5 + 7-21 Multiplying the first sum by 3 and adding the second vields 42 * Subtracting 1 gives 41 * Remainder upon dividing by 10 is 1 Remainder is subtracted from 9 Result is 8 Draw a detailed flowchart and write an ARM assembly program to justverifywhether a string of 12 ASCII encoded digits stored in memory is a valid UPC or not. If valid, vou should store1 in r0, if not, you should store 2 in r0 Your code should be highly optimized. Use as few instructions as possible (as little as 19 assembly instructions only)!! Define in your assembly program the 12 digits UPC string as follow: UPC DCB "013800150738"UPC stri ng To test your program, you can use the following UPCs 0 60383 75557 7 0 65633 45471 2 You can also get more UPC codes from your own kitchen items Most goods sold in U.S. and Canadian stores are marked with a Universal Product Code (UPC) The meanings of the digits underneath the bar code (from left to right) are: * First digit: type of item, . First group of five digits: manufacturer * Second group of five digits: product, and Final digit: check digit, used to help identify an error in the preceding digits 0 13800"15073"8 To compute the check digit, * Add the first, third, fifth, seventh, ninth, and eleventh digits Add the second, fourth, sixth, eighth, and tenth digits . Multiply the first sum by 3 and add it to the second sum * The check digit is the digit which, when added to the above sum, produces a sum that is multiple of 10 o Subtract 1 from the total o o Compute the remainder when the adjusted total is divided by 10 Subtract the remainder from 9 Example for UPC 0 13800 15073 8: First sum: 0+3+0+1 0+3-7 Second sum: 1 +8 +0+5 + 7-21 Multiplying the first sum by 3 and adding the second vields 42 * Subtracting 1 gives 41 * Remainder upon dividing by 10 is 1 Remainder is subtracted from 9 Result is 8 Draw a detailed flowchart and write an ARM assembly program to justverifywhether a string of 12 ASCII encoded digits stored in memory is a valid UPC or not. If valid, vou should store1 in r0, if not, you should store 2 in r0 Your code should be highly optimized. Use as few instructions as possible (as little as 19 assembly instructions only)!! Define in your assembly program the 12 digits UPC string as follow: UPC DCB "013800150738"UPC stri ng To test your program, you can use the following UPCs 0 60383 75557 7 0 65633 45471 2 You can also get more UPC codes from your own kitchen itemsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started