|
Построение циклических кодов
Eia ,a eioi?ii
eiaiaay eiiaeiaoey, iieo?aiiay iooai oeeee?aneiai naaeaa ?ac?aoaiiie eiaiaie
eiiaeiaoee yaeyaony oae?a ?ac?aoaiiie eiaiaie eiiaeiaoeae iacuaaaony oeeee?aneei
( iieeiiieaeuiui, eiaii n oeeee?aneeie ecauoi?iuie i?iaa?eaie-OEI). Oeeee?aneee eia ioiineony e eeiaeiui, aei?iui, ei??aeoe?o?uei,
?aaiiia?iui eiaai. A oeeee?aneeo eiaao eiaiaua eiiaeiaoee i?aanoaaey?ony a
aeaa iiiai?eaiia, ?oi iicaieyao naanoe aaenoaey iaa eiaiauie eiiaeiaoeyie e
aaenoaeai iaa iiiai?eaiaie (eniieucoy aiia?ao iieeiiieaeuiie
aeaaa?u). Oeeee?aneea eiau yaey?ony ?aciiaeaiinou? nenoaiaoe?aneeo eiaia e
iiyoiio iaeaaa?o anaie eo naienoaaie. Ia?aiia?aeuii iie auee nicaaiu aey
oi?iuaiey noai eiae?iaaiey e aaeiae?iaaiey. Eo yooaeoeaiinou i?e iaia?o?aiee e
eni?aaeaiee ioeaie iaania?eea ei oe?ieia i?eiaiaiea ia i?aeoeea. Iino?ieou oeeee?aneee eia aey ia?aaa?e 31 ?ac?yaiie
eiaiaie eiiaeiaoee n eni?aaeaieai iaiie?aoiie ioeaee ( n=31 ,s=1)
aaoiy Iieacaou i?ioann iaia?o?aiey e eni?aaeaiey iaiie?aoiie
ioeaee a ia?aaaaaaiie eiaiaie eiiaeiaoee. Ninoaaeou i?ia?aiio, ?aaeeco?uo?
aeai?eoi eiae?iaaiey, aaeiae?iaaiey e eni?aaeaiey ioeaee i?e ia?aaa?a aaiiuo n
eniieuciaaieai oeeee?aneiai eiaa. 1. Naaea ni?aaa iaeaai inouanoaeyaony iooai oiii?aiey iieeiiia ia
x: × 2. Iia?aoee nei?aiey e au?eoaiey
auiieiy?ony ii iiaoe? 2 . 1 I?eia?: +1; 4 3. Iia?aoey aaeaiey
yaeyaony iau?iui aaeaieai iiiai?eaiia, oieuei aianoi au?eoaiey eniieucoaony
nei?aiia ii iiaoe? 2 : +1 . Eaay iino?iaiey oeeee?aneeo eiaia aace?oaony ia
eniieuciaaiee iai?eaiaeiuo iiiai?eaiia. Iai?eaiaeiui iacuaaaony iiiai?eai,
eioi?ue ia ii?ao auou i?aanoaaeai a aeaa i?iecaaaaiey iiiai?eaiia iecoeo
noaiaiae ,o.a. oaeie iiiai?eai aaeeouny oieuei ia naiiai naay eee ia aaeieoo e
ia aaeeouny ie ia eaeie a?oaie iiiai?eai. Ia oaeie iiiai?eai aaeeouny aac
inoaoea aao?eai x ?oiau iiiyou i?eioei iino?iaiey
oeeee?aneiai eiaa, oiii?aai eiiaeiaoe? i?inoiai k-cia?iiai eiaa Q(x) ia iaii?eai
x r Q(x) ia
ia?aco?uee iieeiii iieo?aaony ?anoiia C(x) oaeie ?a noaiaie, eae e
Q(x). ?anoiia C(x) eiaao oaeo? ?a noaiaiu, eae e eiaiaay eiiaeiaoey Q(x)
i?inoiai eiaa, iiyoiio C(x) yaeyaony eiaiaie eiiaeiaoeae yoiai ?a i?inoiai k-
cia?iiai eiaa. Neaaoao caiaoeou, ?oi noaiaiu inoaoea ia ii?ao auou aieuoa
noaiaie ia?aco?uaai iieeiiia, o.a. aai iaeaunoay noaiaiu ii?ao auou ?aaia (r-1).
Neaaiaaoaeuii, iaeaieuoaa ?enei ?ac?yaia inoaoea R(x) ia i?aauoaao ?enea r.
F(x) = C(x) P(x) = Q(x) x auou iieo?aia aaoiy
niiniaaie: e aiaaaeaiea e yoiio i?iecaaaaie? inoaoea R(x) , iieo?aiiiai a
?acoeuoaoa aaeaiey i?iecaaaaiey Q(x) x 2) oiii?aiey eiaiaie eiiaeiaoee C(x) i?inoiai k-cia?iiai ia ia?aco?uee
iieeiii P(x). I?e iino?iaiee oeeee?aneeo eiaia ia?aui niiniaii ?aniiei?aiea
eioi?iaoeiiiuo neiaieia ai anao eiiaeiaoeyo no?iai oii?yai?aii - iie caieia?o k
noa?oeo ?ac?yaia eiiaeiaoee, a inoaeuiua (n-k) ?ac?yaia ioaiayony iia
eiio?ieuiua. I?e aoi?ii niiniaa ia?aciaaiey oeeee?aneeo eiaia eioi?iaoeiiiua e
eiio?ieuiua neiaieu a eiiaeiaoeyo oeeee?aneiai eiaa ia ioaaeaiu a?oa io a?oaa,
?oi cao?oaiyao i?ioann aaeiae?iaaiey. iannea. A ninoaa i?ia?aiiu aoiaeo iniiaiay i?ia?aiia e aaa
iiaoey, Program Cyclic_Code; Switch:byte; SetWindow(24,10,45,14,2,'
Aeaaiia iai? '); TextColor(0); TextBackGround(0); Init(m,p,r,MainFlag); if(i<n-n1+1)then
Textcolor(9); for i:=n1 downto 0
do TextColor(9); GotoXY(2,5); GotoXY(2,6); for i:=n downto 0
do Write('I?iecioea ioeaea...
'); TextColor(9); Correction(m,p,r);
end; for i:=n downto 0 do TextBackGround(0); Init(m,p,r,MainFlag); if(i<n-n1+1)then Textcolor(9); for i:=n1 downto 0
do TextColor(9); MakeError(m,Error);
write(m[i]); for i:=n downto 0
do end; ClrScr;
TextColor(15); ?acoeuoao ?aaiou
i?ia?aiiu i?e ia?aciaaiee eiaa aiaaaeaieai inoaoea Cei?aiee ii iiaoe? 2 (F(x)+P(x)): 1101011111001111011011011000000
I?iecioea ioeaea... 1101011111001110011011011010101 Ia?ieoa e?ao? eeaaeoo... Eioi?iaoeiiiue
iieeiii: 0000001010110000011111010001011 I?iecioea ioeaea...
0110000011111010000100100101101
Aaiiay i?ia?aiia eiae?oao niiauaiey eniieucoy oeeee?aneee eia. I?e aicieeiiaaiee
enee??eoaeuiuo neooaoee, eiaaa eioi?iaoeiiiia neiai ii eaeei-eeai i?e?eiai
?aneiae?iaaou ia oaa?ony, i?ia?aiia iiaoi?yao cai?in ia ia?anueeo aaiiuo, eae
yoi aaeaaony a ?aaeuiuo neooaoeyo iiaiaiiai ?iaa. eioi?iaoeiiiiai neiaa ?a?ac eaiae"
aiioneaao a neiaa iaiie?aoio? ioeaeo, caoai eni?aaeyao aa, aaeiae?oao
eioi?iaoeiiiia neiai e ia?aaa?o ?acoeuoao iieuciaaoae?.
Const
Move_code=array[0..n] of byte; { Ia?aaaaaaiue iieeiii F(x) } Procedure Init(var m1:Move_code;var
p1:Polinom; Procedure Divizion(var m2:Move_code;var r2:Rest; Procedure Decoder(var
m6:Move_Code); Procedure Correction(var m5:Move_code;p5:Polinom;var
r5:Rest); p1[1]:=0; m1[i]:=random(2); while(k>0)
do Procedure Divizion(var m2:Move_code;var
r2:Rest; RETURN:while((j>=0)and(m2[j]=0))do dec(j);
while(j>=0)do if(i1=-1)then goto
RETURN; Kol:=n1-i1; if((j=-1)and(Kol=0)) else
if(n1=j) r2[i]:=r2[i] xor p2[i] Procedure BildMoveCode(var m3:Move_code;r3:Rest;var
flag:integer); m3[k]:=r3[i]; Procedure MakeError(var m4:Move_code;var
err:integer); var dec(k); Procedure BildMoveCodeMultiplication(var
m7:Move_Code); for i:=n downto 1
do m2[i]:=m2[i-1]; m3[j]:=0; for i:=n downto 0 do Procedure
Correction(var m5:Move_code;p5:Polinom;var r5:Rest); Countcarry:=0;
while((i1>=Correctflag)and(r5[i1]=0))do dec(i1); then m5[0]:=m5[0] xor
r5[Correctflag] inc(Countcarry);
while (Countcarry>0) do
end; Unit
_SERV; BorderChar:array[0..2,1..6] of Char= MaxChar=80; (' I
i?ia?aiia...',' Aaiiino?aoey ' 'Auoia '); Procedure
SetWindow(x1,y1,x2,y2,Bord:byte;Header:string); Implementation
if not ((x1<1) or (x2<=x1) or
GotoXY(x1,y1); end; Write(BorderChar[Bord,4]); for i:=1 to x2-x1-1 do end; mov
ah,1
ch,ch1:char; if(i=Count)then GotoXY(25,10+i);
then begin then inc(Count); var
repeat begin if KeyPressed then
dec(Count); GetSubMenuChoice:=Count; GotoXY(6,2); end.
| |