Generating QR Codes from Oracle Database - Appendix

Slides:



Advertisements
Similar presentations
The Binary Numbering Systems
Advertisements

Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Data Representation Computer Organization &
Data Representation COE 205
Connecting with Computer Science, 2e
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Exponents and Polynomials
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
The Binary Number System
Data Representation Number Systems.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
Binary Arithmetic & Data representation
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
Objective 1.To write very large or very small numbers in standard form, in scientific notation, and vice versa. To compare and order numbers in scientific.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Data Representation Conversion 24/04/2017.
IFS Intro to Data Management Chapter 5 Getting More Than Simple Columns.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Operations with Decimals
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
Digital Communications I: Modulation and Coding Course Term Catharina Logothetis Lecture 9.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
OPERATORS IN C CHAPTER 3. Expressions can be built up from literals, variables and operators. The operators define how the variables and literals in the.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Topic: Binary Encoding – Part 2
Data Representation COE 308 Computer Architecture
Simple Parity Check The simplest form of error detection is the parity check used with ASCII codes, originally on asynchronous modem links Each 7 bit ASCII.
Invitation to Computer Science, C++ Version, Fourth Edition
Data Representation ICS 233
Lec 3: Data Representation
Binary 1 Basic conversions.
Data Representation.
Lesson Objectives Aims
Dr. Clincy Professor of CS
Statistical Analysis with Excel
COMPUTING FUNDAMENTALS
REALLY BIG & REALLY small Numbers
Why use Binary? There are only four rules for addition in binary compared to 100 in decimal [0+0=0 ; 0+1=1 ; 1+0=1; 1+1=10]
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Data Structures Mohammed Thajeel To the second year students
Invitation to Computer Science, Java Version, Third Edition
Statistical Analysis with Excel
Multiplying Integers.
Data Representation COE 301 Computer Organization
Statistical Analysis with Excel
Ch2: Data Representation
Digital Logic & Design Lecture 03.
Scientific Notation.
Fundamentals of Data Representation
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Data Representation ICS 233
Barcode and QR code 此页可以删除 Yuan Qu, Xuansheng Lu.
Erasure Correcting Codes for Highly Available Storage
Functions continued.
Data Representation COE 308 Computer Architecture
Presentation transcript:

Generating QR Codes from Oracle Database - Appendix Zoran Tica

1. Data Analysis and Encoding 1.1 Data Analysis - 4 different data modes: Numeric mode (only numbers 0-9; “0038670212278”) Alphanumeric mode (numbers + uppercase characters + $%*+-./: + space; “HELLO WORLD.”) Byte mode (ISO 8859-1; 255 different characters; “Hello World!”) Kanji mode (two-bytes Japanese characters; “茗荷”)

1. Data Analysis and Encoding 1.2 Determine the version using the table with maximum character capacity for data mode and error correction

1. Data Analysis and Encoding 1.3.1 Encode data (byte mode): convert ASCII codes of data characters into binary numbers join them into 1/0 array (string) Example: H->01001000 e->01100101 l->01101100 l->01101100 o->01101111 0100100001100101011011000110110001101111

1. Data Analysis and Encoding 1.3.2 Encode data (numeric mode): split data into groups of 3 numbers convert groups of 3 numbers into 10-bit binary numbers last group could be of 2 or 1 number – group of 2 is converted into 7-bit number and group of 1 into 4-bit if group of 3 starts with 0 then it is treated as group of 2 if group of 3 starts with 00 then it is treated as group of 1 join them into 1/0 array (string) Example: 8675309 -> 867 530 9 -> 110110001110000100101001

1. Data Analysis and Encoding 1.3.3 Encode data (alphanumeric mode table): 0 0 A 10 K 20 U 30 + 40 1 1 B 11 L 21 V 31 - 41 2 2 C 12 M 22 W 32 . 42 3 3 D 13 N 23 X 33 / 43 4 4 E 14 O 24 Y 34 : 44 5 5 F 15 P 25 Z 35   6 6 G 16 Q 26 36 (space) 7 7 H 17 R 27 $ 37 8 8 I 18 S 28 , 38 9 9 J 19 T 29 * 39

1. Data Analysis and Encoding 1.3.3 Encode data (alphanumeric mode): split data into groups of 2 characters (C1 C2) determine a number for every character (N1 N2) from alphanumeric table (shown on following slide) use a formula (N1 * 45 + N2) convert a number into 11-bit string if a group has only 1 character convert it into 6-bit string Example: HELLO -> HE LL O -> (17 *45 + 14)(21*45+21)(24) -> (779)(966)(24) -> 0110000101101111000110011000

1. Data Analysis and Encoding 1.4 Construct complete binary array start with mode indicator (numeric 0001, alphanumeric 0010, byte 0100, Kanji 1000) add the Character Count Indicator (8-16 bits, version + mode) add encoded data from previous step fill maximum capacity for determined version (max bytes from table * 8) by adding terminator zeros, more zeros to make the array length a multiple of 8, pad bytes (repeating 236 and 17)

1. Data Analysis and Encoding 1.4 Construct complete binary array data HELLO WORLD and M error correction (16*8= 128 bit) mode indicator for alphanumeric data - 0010 character count indicator (11 characters) - 000001011 encoded data - 01100001011 01111000110 10001011100 10110111000 10011010100 001101 terminator – 0000 length is 78 , so add “00” to get multiple of 8 128-80= 48 (6 bytes) – add 236,17,236,17,236,17 - 11101100 00010001 11101100 11101100 00010001 11101100

1. Data Analysis and Encoding 1.4 Construct complete binary array data HELLO WORLD and M error correction (16*8= 128 bit) 00100000010110110000101101111000110100010111001011011100010011010100001101000000111011000001000111101100111011000001000111101100

2. Error Correction Coding Reed–Solomon error correction algorithm using Polynomial Long Division The Message Polynomial divided by The Generator Polynomial Reminder are error correction codewords Bit-wise modulo 2 arithmetic, byte-wise modulo 100011101 (285) arithmetic, the Galois Field GF(256), addition and subtraction by XOR-ing the two numbers together, log and anti-log / integer and alpha notation

2. Error Correction Coding 2.1 Convert encoded data binary array to decimal bytes (codewords) 00100000010110110000101101111000110100010111001011011100010011010100001101000000111011000001000111101100111011000001000111101100 32, 91, 11, 120, 209, 114, 220, 77, 67, 64, 236, 17, 236, 17, 236, 17

2. Error Correction Coding 2.2 Break codewords into groups and blocks regarding to table

2. Error Correction Coding 2.3 Define Message Polynomial for each group and block integer notation 00100000010110110000101101111000110100010111001011011100010011010100001101000000111011000001000111101100111011000001000111101100 32, 91, 11, 120, 209, 114, 220, 77, 67, 64, 236, 17, 236, 17, 236, 17 32x15+91x14+11x13+120x12+209x11+114x10+220x9+77x8+67x7+64x6+236x5+17x4+236x3+17x2+236x1+17

2. Error Correction Coding 2.4 Define Generator Polynomial alpha notation always the same values (not dependent of data) (x - α0) * ... * (x - αn-1) n – number of error correction codewords (our example 10) x10 + α251x9 + α67x8 + α46x7 + α61x6 + α118x5 + α70x4 + α64x3 + α94x2 + α32x + α45

2. Error Correction Coding 2.5 Prepare Polynomials for division multiply Message Polynomial with xn (n – number of error correction codewords – our example 10) 32x25+91x24+11x23+120x22 ... +17x10 The lead term of the Generator Polynomial should also have the same exponent (multiply with x15) α0x25 + α251x24 + α67x23 + α46x22 + ... + α45x15

2. Error Correction Coding 2.6 Divide the Message Polynomial by the Generator Polynomial Step 1 a) Multiply the Generator Polynomial by the Lead Term of the Message Polynomial: 32x25 -> α5x25 (convert lead term to alpha notation) multiply Generator Polynomial with α5 α0x25 + α251x24 + α67x23 + α46x22 + ... + α45x15 / * α5 -> α5x25 + α (256%255=1)x24 + α72x23 + α51x22 + ... + α50x15 Convert Generator Polynomial back to integer notation 32x25 + 2x24 + 101x23 + 10x22 + ... + 5x15

2. Error Correction Coding 2.6 Divide the Message Polynomial by the Generator Polynomial Step 1 b) XOR with the Message Polynomial 32x25+91x24+11x23+120x22 ... +17x10 / ⊕ 32x25+2x24+101x23+10x22+ ... + 5x15 (32 ⊕ 32)x25+(91 ⊕ 2)x24 + (11 ⊕ 101)x23 + (120 ⊕ 10)x22 + ... (236 ⊕ 5)x15 + (17 ⊕ 0)x14 + ... + (236 ⊕ 0)x11 + (17 ⊕ 0)x10 Result of step 1: 0x25 + 89x24 + 110x23 + 114x22 + ... + 236x11 + 17x10

2. Error Correction Coding 2.6 Divide the Message Polynomial by the Generator Polynomial Step 2 a) Multiply the Generator Polynomial by the Lead Term of the result from step 1: 89x24 -> α210x24 (convert lead term to alpha notation) multiply Generator Polynomial with α210 α0x24 + α251x23 + α67x22 + α46x21 + ... + α45x14 / * α210 -> α210x24 + α (461%255=206)x23 + α(277%255=22)x22 + α(256%255=1)x21 + ... + α(255%255=0)x14 Convert Generator Polynomial back to integer notation 89x24 + 83x23 + 234x22 + 2x21 + ... + 1x14

2. Error Correction Coding 2.6 Divide the Message Polynomial by the Generator Polynomial Step 2 b) XOR with the result from step 1 89x24 + 110x23 + 114x22 + ... + 236x11 + 17x10 / ⊕ 89x24 + 83x23 + 234x22 + ... + 1x14 (89 ⊕ 89)x24 + (110 ⊕ 83)x23 + (114 ⊕ 234)x22 + ... + (236 ⊕ 0)x11 + (17 ⊕ 0)x10 Result of step 2: 0x24 + 61x23 + 152x22 + 178x21 + ... + 236x11 + 17x10

2. Error Correction Coding 2.6 Divide the Message Polynomial by the Generator Polynomial Step 3 Step 4 ... Step n (number of data codewords – in our example 16) Final result are error correction codewords (in our example 10) 196x9 + 35x8 + 39x7 + 119x6 + 235x5 + 215x4 + 231x3 + 226x2 + 93x1 + 23 196, 35, 39, 119, 235, 215, 231, 226, 93, 23

3. Structure final message Interleave data codewords (CW 1 from block 1, CW 1 from block 2, CW 2 from block 1, CW 2 from block 2...) Interleave error correction codewords (CW 1 from block 1, CW 1 from block 2, CW 2 from block 1, CW 2 from block 2...) Put interleaved error correction codewords after interleaved data codewords and convert to binary array Add reminder zero bits if necessary (table)

3. Structure final message data HELLO WORLD and M error correction 32, 91, 11, 120, 209, 114, 220, 77, 67, 64, 236, 17, 236, 17, 236, 17, 196, 35, 39, 119, 235, 215, 231, 226, 93, 23 0010000001011011000010110111100011010001011100101101110001001101010000110100000011101100000100011110110000010001111011000001000111000100001000110010011101110111111010111101011111100111111000100101110100010111 reminder zero bits are not necessary for version 1

4. Module Placement in Matrix Fixed elements: Finder patterns Separators Timing patterns Dark module Alignment patterns (for version 2 and above – table with coordinates)

4. Module Placement in Matrix Version information (for version 7 and larger) table with 18-bit data

4. Module Placement in Matrix Format information modules are reserved in advance data is filled during data masking (next and last step)

4. Module Placement in Matrix User and error correction data (skip already used modules) Skip Vertical Timing Pattern

5. Data Masking Transform QR matrix – dark module to light and vice versa Goal – to choose the most readable QR code Only user and error correction data 8 mask patterns – 8 QR Code Matrix copies 4 penalty rules to evaluate which masking pattern is the most readable

5. Data Masking 8 mask pattern formulas

5. Data Masking Fill format information for every masking pattern copy 8 completely filled QR Codes table with 15-bit data

5. Data Masking 4 Penalty Rules: group of five or more same-colored modules in a row (or column) each 2x2 area of same-colored modules patterns that look similar to the finder patterns more than half of the modules are dark or light Total penalty is sum of all 4 penalty rules.