ECC Algorithm
(512Byte)
Flash Planning Group
Memory Division
Samsung Electronics Co., Ltd
This is only example algorithm for SW ECC.
In case of OneNAND which supports HW ECC, parity bit position can be changed.
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology
Processing Procedure
For 512Byte
Generate ECC Parity Code(24bit)
during program operation on 512byte &
∗ Two methods for ECC generation of Spare area data
Write it to NAND Flash’s spare area
( In spare area, only Logical address data, 3byte, is
available for ECC )
1) Sequentially program or read spare area data
following main area data Mode1
2) After selecting spare area(by 50h command),
Generate New ECC Parity Code (24bit) program or read spare area data Mode2
during read main area data (512byte)
Compare original ECC Parity Code with
new generated ECC Parity Code & Original ECC Parity Code (24bit)
Generate compared result
(14bit for main, 7bit for spare ) (XOR)
New generated ECC Parity Code(24bit)
If values of the code No
24bit = 0 : No Error
are all same
12bit = 1 : 1bit Error
1bit = 1 : Original ECC Parity 1bit Error
Yes others : Multi_Error (more 2bit Error)
No Error Error detected
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology
Parity Generation for Main Array (Column)
For 512Byte
1st byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8`
P16`
2nd byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8
P32`
3rd byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8` P2048`
P16
4th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8
509th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8`
P16`
510th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8 P32 P2048
511th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8`
P16
512th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8
P1 P1' P1 P1' P1 P1' P1 P1'
P2 P2' P2 P2'
P4 P4'
P1=bit7 + bit5 + bit3 + bit1 + P1
P2=bit7 + bit6 + bit3 + bit2 + P2
P4=bit7 + bit6 + bit5 + bit4 + P4
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology
Parity Generation for Main Array (Row)
For 512Byte
1st byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8`
P16`
2nd byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8
P32`
3rd byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8` P2048`
P16
4th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8
509th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8`
P16`
510th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8 P2048
P32
511th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8`
P16
512th byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8
P1 P1' P1 P1' P1 P1' P1 P1'
P2 P2' P2 P2'
P4 P4'
P8= bit7 + bit6 + bit5 + bit4 + bit3 + bit2 + bit1 + bit0 + P8
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology
Parity Generation for Spare Array (Logical Address)
For 512Byte
1st byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8`
P16`
2nd byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8
3rd byte Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 P8` P16
P1 P1' P1 P1' P1 P1' P1 P1'
P2 P2' P2 P2'
P4 P4'
P1_s=bit7 + bit5 + bit3 + bit1 + P1
P2_s=bit7 + bit6 + bit3 + bit2 + P2
P4_s=bit7 + bit6 + bit5 + bit4 + P4
P8_s = bit7 + bit6 + bit5 + bit4 + bit3 +bit2 +bit1 +bit0 +P8
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology
ECC CODE FORMAT STANDARD
For 512Byte
ECC Code for Main area data P1~P4 : Column Parity , P8~P2048 : Row Parity
I/O7 I/O6 I/O5 I/O4 I/O3 I/O2 I/O1 I/O0
ECC0 ~P64 ~P64’ ~P32 ~P32’ ~P16 ~P16’ ~P8 ~P8’
ECC1 ~P1024 ~P1024’ ~P512 ~P512’ ~P256 ~P256’ ~P128 ~P128’
ECC2 ~P4 ~P4’ ~P2 ~P2’ ~P1 ~P1’ ~P2048 ~P2048’
ECC Code for LSN data P1_s: Column Parity , P2_s~P16_s : Row Parity
I/O7 I/O6 I/O5 I/O4 I/O3 I/O2 I/O1 I/O0
S_ECC0 ~P2_s ~P2’_s ~P1_s ~P1’_s ~P16_s ~P16’_s ~P8_s ~P8’_s
S_ECC1 1 1 1 1 1 1 ~P4_s ~P4’_s
* ~ : Logically Inverse operation
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology
SPARE AREA ASSIGNMENT STANDARD
For 512Byte
Main area Spare area
512 B 16 B
RESER RESER RESER RESER RESER RESER RESER
LSN0 LSN1 LSN2 VED VED
BI ECC0 ECC1 ECC2 S-ECC0 S-ECC1
VED VED VED VED VED
1st B 2nd B 3rd B 4th B 5th B 6th B 7th B 8th B 9th B 10th B 11th B 12th B 13h B 14h B 15th B 16th B
> LSN : Logical Sector Number
> ECC0,ECC1,ECC2 : ECC code for Main area data
> S_ECC0,S_ECC1 : ECC code for LSN data
> BI : Bad block Information
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology
Compare Result Table
For 512Byte
For Main Array 512byte
Stored ECC(in Spare area) [P2048P2048’P1024P1024’…P2P2’P1P1’]
+ Computed data’s ECC result [P2048P2048’P1024P1024’…P2P2’P1P1’]
No Error 1bit Error ECC Parity 1bit Error Multi_Error
XORed
24 bits : 0 12 bits : 1 1 bit : 1 Others
Results
error position is
P2048P1024P512…P4P2P1
For Spare Array 3byte
Stored ECC(in Spare area) [P16P16’P8P8’P4P4’P2P2’P1P1’]
+ Computed LSN’s ECC result [P16P16’P8P8’P4P4’P2P2’P1P1’]
No Error 1bit Error ECC Parity 1bit Error Multi_Error
XORed
10 bits : 0 5 bits : 1 1 bit : 1 Others
Results
error position is
P16P8P4P2P1
Product
Product Planning
Planning &
Application
Application Eng.
&
Eng. Team
Team
The
The Leader
Leader in
in Memory
Memory Technology
Technology