The ith row in a square, Row[i], is constructed from the preceding row, Row[i-1], according to the following formula:
Row[i] = Row[i-1] - InterRow[i] + IntraRow[i] for i = 1,2,...,8.Each term in the equation is a 32-bit quantity, and operations are performed using standard integer arithmetic. When constructing the 1st row in a square, Row[i-1] is always taken to be 0x88888888. The value of InterRow[i] is determined from a 4-bit code, C[i], according to the table given below. The value of IntraRow[i] is determined by 0, 8, 16 or 32 bits of additional data, the amount of which is determined by C[i] according to the IntraRow Bits column in the table below. The values of C and InterRow are displayed in hexadecimal.
C InterRow IntraRow Bits 1 DDDDDDDE 0 4 EEEEEEEF 0 7 00000000 0 A 11111111 0 D 22222222 0 2 EEEEEEEF 8 5 00000000 8 8 11111111 8 B 22222222 8 E 33333333 8 3 00000000 16 6 11111111 16 9 22222222 16 C 33333333 16 F 44444444 16 0 00000000 32When there are 0 IntraRow Bits, the value of IntraRow is 0. When there are 8 IntraRow Bits, the value of IntraRow satisfies 0xEEEEEEEE & IntraRow = 0, with the 8 bits of additional data corresponding to the least significant bits of each of the 4-bit nibbles in IntraRow. When there are 16 IntraRow Bits, the value of IntraRow satisfies 0xCCCCCCCC & IntraRow = 0, with the 16 bits of additional data corresponding to the least significant 2 bits of each 4-bit nibble in IntraRow. The following table displays the conversion of 1 or 2 bytes of IntraRow Data into an IntraRow value, in binary notation:
IntraRow Bits IntraRow Data IntraRow 8 abcdefgh 000a000b000c000d000e000f000g000h 16 abcdefgh ijklmnop 00ab00cd00ef00gh00ij00kl00mn00opWhen there are 32 IntraRow Bits, then the additional data is the actual value of the current row.
0 8 16 24 31 +--------------+--------------+--------------+--------------+ | Square ID | C1 | C2 | C3 | C4 | +--------------+--------------+--------------+--------------+ | C5 | C6 | C7 | C8 | IntraRow Data | +--------------+--------------+ | ... | +--------------+ | | +--------------+--------------+--------------+