Altera Integer Arithmetic IP User Manual
Page 52

• All bits have their bit positions, and bit positions that are powers of 2 are used as parity bits
(positions 1, 2, 4, 8 …). Table 38 lists the bit positions and the positions of the parity bits in a 13-bit
code word.
Table 5-13: Design Example 2: Position of Parity Bits for a 13-Bit Code Word
Position
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10 )
(11)
(12 )
(13)
Parity Bits
and Data
Bits
P1
0
P2
0
—
P3
1
—
—
—
P4
0
—
—
—
—
P5
1
• All other bit positions are for the data bits. The LSB of the data bit fills the lowest bit position. In
this case, starting from the LSB of the data, F0 (1111 0000 in binary) fills the empty bit positions,
starting from position (3), as shown in the following table.
Table 5-14: Design Example 2: Filling of Data Bits (1111 0000) for a 13-Bit Code Word
Position
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
Parity Bits
and Data
Bits
P1
0
P2
0
D1
0
P3
1
D2
0
D3
0
D4
0
P4
0
D5
1
D6
1
D7
1
D8
1
P5
1
• Recalculate parity bits to generate the syndrome code. Each syndrome bit calculates the parity (even
parity) for some of the bits in the code word. The following table lists how the syndrome bits are
derived.
Table 5-15: Design Example 2: Calculation of Parity Bits
Position
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10) (11) (12) (13)
Parity Bits
and Data
Bits
P1
0
P2
0
D1
0
P3
1
D2
0
D3
0
D4
0
P4
0
D5
1
D6
1
D7
1
D8
1
P5
1
Syndrome
Code
Calculate
P1
0
—
0
—
0
—
0
—
1
—
1
—
— S1=0
Calculate
P2
—
0
0
—
—
0
0
—
—
1
1
—
— S2=0
Calculate
P3
—
—
—
1
0
0
0
—
—
—
—
1
— S3=0
Calculate
P4
—
—
—
—
—
—
—
0
1
1
1
1
— S4=0
Calculate
P5
0
0
0
1
0
0
0
0
1
1
1
1
1 S5*=0
• Calculate the additional syndrome bit using an even parity checking on all the bits in the code
word. In this example, the additional syndrome bit S5* is calculated using an even parity checking
on all the bits from position (1) to position (13) as shown in the table. The generated syndrome
code gives the status of the data, whether an error has occurred, and if so, whether it is a single-bit
or double-bit error.
2. In this case, the syndrome code is zero (S5*S4S3S2S1=0 0000). No error is detected and no correction
5-14
Understanding the Simulation Results
UG-01063
2014.12.19
Altera Corporation
ALTECC (Error Correction Code: Encoder/Decoder)