Title: Extraction of TimeSpace Information
1Chapter 4 Cyclic Codes and Arithmetic Codes
Reading Wakely 80 pp.34-49 Prad 86 pp.299-318
2Application of Systematic Cyclic Code
- Applied to Magnetic Tapes in CRC (Cyclic
Redundancy Check) code - Note there are 9 horizontal tracks, 8 data, one
parity - Parity track syndrome used to correct data in
cyclic code
Byte B0 is cyclic check on B1-B7 in (64, 56)
cyclic code
8 tracks of data arranged vertically as bytes
B0
B1
B2
B3
B4
B5
B7
B6
9th track Vertical parity Check
3Outline
- Codes for storage and communication
- Cyclic Codes
- Checksum codes
- Codes for arithmetic
- AN Codes
- Residue codes
- Codes for control units (unidirectional errors)
- m-out-of-n codes
- Berger Codes
- Alternate Readings
- Pages 98-125, Johnson89, Pages 94-104, SiSw82
- Pages 299-318, Pradhan
4Cyclic Codes
- Cyclic codes are parity check codes with
additional property that cyclic shift of codeword
also a codeword - If (Cn-1, Cn-2,, C1, C0) is a codeword, (Cn-2,
Cn-3,, C0, Cn-1) is also codeword - Parity check codes require complex encoding,
decoding circuit using arrays of EX-OR gates, AND
gates, etc. - Cyclic codes require far less hardware, in form
of linear feedback shift registers - Cyclic codes are used in sequential storage
devices, e.g. tapes, disks, and data links - An (n, k) cyclic code can detect single bit
errors, and multiple adjacent bit error affecting
fewer than (n-k) bits, burst transient errors.
5Cyclic Code and Polynomials
- Cyclic codes depend on the representation of data
by polynomial - If (Cn-1, Cn-2,, C1, C0) is a codeword, its
polynomial representation - C(x) Cn-1xn-1 Cn-2xn-2 C1x1 C0
- Cyclic codes are characterized by its generator
polynomial g(x) - g(x) is a polynomial of degree (n-k) for an (n,
k) code, with unity coefficient in (n-k) term - Example for (7, 4) code,
- C(x) C6x6 C5x5 C1x1 C0
- g(x) x3 x 1
-
6Cyclic And Polynomial Algebra
- Definition A cyclic code is a parity check code,
where every cyclic shift of a code word is a code
word, e.g. if (Cn-1, Cn-2,, C1, C0) is a code
word, then (Cn-2, Cn-3,, C0, Cn-1) is also a
code word - Cyclic codes are conveniently described as
polynomials C(x) Cn-1xn-1 Cn-2xn-2 C1x1
C0 - Use key concept of polynomial division using
Euclidean division algorithm f(x) q(x)p(x)
r(x), degree (r(x)) lt degree (q(x)), q
quotient and r remainder
7Cyclic And Polynomial Algebra(Cont.)
- Most important modulo base polynomial for cyclic
codes is Xn -1 is since 1 Xnmod(Xn-1) - Now we have
8Basic Operations on Polynomials
- Can multiply or divide one polynomial by another,
follow modulo 2 arithmetic, coefficients are 1 or
0, and addition and subtraction are same. - Multiplication (x4 x3 x2 1)(x3 x)
Division
x Quotient
x4 x3 x2 1
x5 x4
x5 x4 x3 x
x3 x
Remainder
9Properties of Generator Polynomials
- g(x) is unique lowest degree nonzero polynomial
with degree n-k - Every code polynomial is some multiple of g(x)
- g(x) is a factor of xn - 1, i.e., it divides it
with zero remainder - If polynomial with degree n-k divides xn -1, then
g(x) generated cyclic code
10Unidirectional Error Model
- Given a bit string (X1X2X3Xn), Xi 0, 1
- Under error, either some 0 ? 1 or 1 ? 0, but not
both - at the same time, e.g., if you know that
s-a-0 faults - are the only faults that can occur
11Berger Codes
- Used in Control Units
- Systematic Code
- For an n-component vector, add a check vector
equal to count of zeros in vector - If information is X, c(X) number of zeros in X
- Example X lt10010001gt, c(X) 5 101
so, Code lt10010001101gt - Detects unidirectional multiple errors
12Berger Code Error Detection
- If unidirectional errors in information part,
- 1 ? 0 number of zeros in information gt check
value - 0 ? 1 number of zeros in information lt check
value - If unidirectional error in check part
- 0 ? 1 number of zeros in information lt check
value - 1 ? 0 number of zeros in information gt check
value - Unidirectional errors in both information and
check - parts,
- 1? 0 number of zeros in information increases,
check value decreases - 0 ?1 number of zeros in information decreases,
check value increases
13M-Out-of-N Codes
- Non-systematic codes
- Used in control units
- An n-bit code word contains exactly
- m-bit 1s. e.g., 3-of-5 code
- Detects all unidirectional
- multiple errors
14Arithmetic Codes
- Useful to check arithmetic operations
- Parity codes are not preserved under addition,
subtraction - Arithmetic codes can be separate (check symbols
disjoint from data symbols) or nonseparate
(combined check and data) - Several Arithmetic codes
- AN codes, Residue codes, Bi-residue codes
- Arithmetic codes have been used in STAR fault
tolerant computer for space applications
15Arithmetic Codes
- Useful for integer arithmetic
- Parity-check codes are useful for checking data
transmission and storage, but are NOT preserved
by arithmetic operations - i.e., if A, B ?? S, A ? B ? S
16Arithmetic Error Model
- Given a binary vector (bn-1,,b0) representing
an integer N where - Instead of viewing an error as changing a certain
number of bits, we consider its effect on the
integer - N ? N E
- Absolute value of error is error magnitude.
17Distance, Weight of Arithmetic Codes
- Definition Arithmetic Weight of an integer I is
the minimum possible number of nonzero terms in
an expression of the form - e.g., 29 (11101)2 25 22 20. so
w(29) 3 - Definition The weight of an arithmetic error
which changes N to N E is the arithmetic weight
of E
e.g., if each single fault in an adder produces
an error value of ? 2i for some I, then at least
k faults are needed to produce an error with
weight k - Definition The arithmetic distance between two
integers N1 and N2 is the arithmetic weight of N2
- N1
18Types of Arithmetic Codes
- Separate codes (where information and the check
are processed separately) - Encoding of datum X to form f(X) ltc(X), Xgt
(code word), i.e., concatenation of X and check
symbol on X - Furthermore, there are different non-interacting
arithmetic operations
X
C
f(X) ltC(X), Xgt
Y
C(X)
C
C(Y)
f(Y) ltC(Y), Ygt
19Types of Arithmetic Codes(Cont.)
- Advantage
- It can perform arithmetic and checking
operations in parallel - Nonseparate Codes
- Encoding of datum X ? X f(X)
- Encoding of sum of X and Y is obtained by a
single binary operation
X
f(X)X
f
Y
f(Y)Y
f
20AN Codes
- Data X is multiplied by check base A to form
- AX (nonseparate code)
- Addition of code words performed modulo M where A
divides M - A
- Check operation by dividing result by A
- If result 0, no error, else error
AX
AY
Residue Mod A
21AN Code
- There is a cost in number of radix r digits to
represent a set of number. If NM is the largest
actual number to be represented, the number of
digits to be provided must exceed logrANM logrA
logrNM instead of logrNM.
22Example of 3N Code
3N CODE B
3N CODE A
Resulting 3N code words for 4-bit information
words Original Information
3N code word 0000
000000 0001 000110
0010 001001 0011
001100 0100
001111 0101
010010 0110 010101
0111 011000 1001
011011 1010
011110 1011
100001 1100 100100
1101 100111 1110
101010 1111
101101
ADDER
3N CODE of Sum
Illustration of the error detection capabilities
of the 3N arithmetic code. The presence of the
fault results in the sum being an invalid 3N code.
23Residue Codes
- Separate (X, X Mod A) created by appending the
residue of a number to that number - Addition of code words performed modulo M, such
that A divides M
24Residue Code
- (N1 ? N2) mod A (R1 ? R2) mod A
- (N1N2) mod A (R1R2) mod A
- Resides do not preserve the similar property in
the division. - N2 S QN1
- (R2 RS) mod A (RQR1) mod A
- Assume that the sum of two integers N1 and N2
exceeds the maximum integer M, which the register
can represent. Then N1 N2 M, instead of N1
N2 itself, will be placed in the register and the
residue will be calculate from this content.
25Residue Code
- The residue thus calculated is not necessary
equal to (R1 R2) mod A. - Theorem
- If and only if M is a multiple of A,
- (N1 N2 M) mod A (R1 R2) mod A
26Low Cost Residue/AN Codes
- Function c(X)X mod A has to be computed in both
codes - General division is costly
- Choose A 2a -1
- X mod A ? Xi mod (2a 1), compute through
- tree of adders, Xi is a byte of a-bit width.
X (Xn-1 Xn-2 X0)
a
a
a
a
a
a
a
a
27Low Cost Codes
- The function, c(X) X modulo A, must be computed
in both residue and AN codes - In general, requires long division ? slow and
complex - Choose A 2a -1,then w wi ? (2a)i modulo 2a
1 for i ? (non-negative integer)
28Low Cost Codes (Cont.)
- Hence X modulo 2a -1 can be accomplished by
end-around-carry addition of n a-bit bytes - Example Consider N (110111010011)2, A 23 1
7
29Low Cost Codes (Cont.)
Decimal Binary N
N 5N code Residue code 0
000 000000
(000,000) 1 001
000101 (001,001) 2
010 001010 (010,010)
3 011 001111
(011,011) 4 100
010100 (100,100) 5
101 011001 (101,000)
6 110 011110
(110,001) 7 111
100011 (111,010)
30Inverse Residue Codes
- Separate code
- Check symbol function
- c(X)A - (X modulo A)
- More effective than residue codes for detecting
unidirectional multiple errors. - Operate on X and Y to produce Z (main result)
- Operate on X and Y to produce Z (check
symbols) - Checking algorithm computes the expression F
- FZ modulo A Z modulo A
- If F0, no error, else detectable error
31Summary
- Codes for storage and communication
- Cyclic Codes
- Checksum Codes
- Codes for arithmetic
- AN Codes
- Residue Codes
- Codes for control units (unidirectional errors)
- m-out-of-n Codes
- Berger Codes
32Time Redundancy
- Time redundancy uses additional time to perform
the functions of a system such that fault
detection and often fault tolerance can be
achieved. - Attempt to reduce the amount of extra hardware at
the expense of using additional time. - In many applications, the time is of much less
importance than the hardware.
33Transient Fault Detection
- The basic concept of time redundancy is the
repetition of computations in ways that allow
faults to be detected. - The approach shown in Fig. 3. 62 is often good
for detecting errors resulting from transient
faults, but they cannot protect against errors
resulting from permanent faults.
34Permanent Fault Detection
- Alternating logic, Recomputing with shifted
operands (RESO), recomputing with swapped
operands (RESWO), and recomputing with
duplication with comparison (REDWC)
35Alternating Logic
- The alternating logic concept has been applied to
the transmission of digital data over wire media
and the detection of faults in digital circuits. - A combinational circuit is said to be self dual
if and only if f(X) f(X), where f is the
output of the circuit and X is the input vector
for the circuit. - The full-adder is a self-dual circuit.
36Alternating Logic
- A key advantage of the alternating logic approach
is that any combinational circuit with n input
variables can be transformed into a self-dual
circuit with no more than n 1 input variables. - The dual of a function fd is given by
- fd f(x1, x2, , xn)
- The function fsd given by
- fsd xn1f xn1fd
- is then a self-dual function
37Recomputing with Shifted Operands (RESO)
- RESO was developed as a method to provide
concurrent error detection in arithmetic logic
units. - RESO uses the basic time redundancy method that
was shown in Fig. 3. 63, and the encoding
function is selected as the left shift operation
with the decoding function being the right shift
operation.
38Recomputing with Shifted Operands (RESO)
B7
A7
B6
A6
B5
A5
B4
A4
B3
A3
B2
A2
B1
A1
B0
A0
Unshifted Operation at time t0
R7
R6
R5
R4
R3
R2
R1
R0
Faulty Bit Slice
B7
A7
B6
A6
B5
A5
B4
A4
B3
A3
B2
A2
B1
A1
B0
A0
0 0
Shifted Operation at time t0?
R7
R6
R5
R4
R3
R2
R1
R0