Apie Hamming kodas

I

iamczx

Guest
už 512 baitų, naudojant Hamming kodas nustatyti 1 bit, aptikti 2 bitų klaidų.
Application Note st (AN1823 Error Correction Code kalba Single Level Cell NAND Flash atmintinės), duoti šį kodą, o aš esu mįslingas paskutinį judement nuo
if (i & A0), kuris manau turėtų būti, jeigu (i & 0x100).Kas nors atlikti šį darbą? Pasakykite man, kas yra teisinga.Thanks in advance
KodasPseudo kodekso ECC karta

Šį kodą įgyvendina Parity karta parodyta 4 paveiksle.

For i = 1 256 (1)

pradėti

if (i & 0x01)

LP1 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP1;

kitas

LP0 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP1;

if (i & 0x02)

LP3 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP3;

kitas

LP2 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP2;

if (i & 0x04)

LP5 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP5;

kitas

Lp4 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR lp4;

if (i & 0x08)

LP7 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP7;

kitas

LP6 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP6;

if (i & 0x10)

LP9 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP9;

kitas

LP8 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP8;

if (i & 0x20)

LP11 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP11;

kitas

LP10 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP10;

if (i & 0x40)

LP13 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP13;

kitas

LP12 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP12;

if (i & 0x80)

LP15 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP15;

kitas

LP14 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR bit3 XOR bit2 XOR bit1 XOR bit0 XOR LP14;

//************************************************ *************

if (i & A0) / / čia aš manau, kad turėtų būti 0x100

//************************************************ *************

LP17 = bit7 (Xor) bit6 (Xor) bit5 (Xor) bit4 (Xor) bit3 (Xor) bit2 (Xor) bit1

(Xor) bit0 (Xor) LP17

kitas

LP16 = bit7 (Xor) bit6 (Xor) bit5 (Xor) bit4 (Xor) bit3 (Xor) bit2 (Xor) bit1

(Xor) bit0 (Xor) LP16 (2)

CP0 = bit6 XOR bit4 XOR bit2 XOR bit0 XOR CP0;

CP1 = bit7 XOR bit5 XOR bit3 XOR bit1 XOR CP1;

CP2 = bit5 XOR bit4 XOR bit1 XOR bit0 XOR CP2;

CP3 = bit7 XOR bit6 XOR bit3 XOR bit2 XOR CP3

CP4 = bit3 XOR bit2 XOR bit1 XOR bit0 XOR CP4

CP5 = bit7 XOR bit6 XOR bit5 XOR bit4 XOR CP5

pabaiga

Kur XOR tai Bitinis XOR operaciją.

1.
Už 512 Baitų Tiekimas "aš" diapazonas yra nuo 1 iki 512 baitų.

2.
Paskutinis kontrolė "if (i & A0)" yra įvykdyti tik 512 baitų Inputs atveju.
 

Welcome to EDABoard.com

Sponsor

Back
Top