-

         

,


,   C   D 8 ( . . " "),   E   D 24  23  1 = 7 "",   F     25  24  1 = 15 "".

, , , ( 21.7) , ( 21.8).:

 21.7. 

main()

{

int a;

int _pow = 1;

int old_pow = 1;

int N, old_N = 1;



printf( "* * * hamming code efficiency test * * * by Kris Kaspersky\n"\

" BLOCK_SIZE FUEL UP EFFICIENCY\n"\

"-----------------------------------\n");

for (a = 0; a < MAX_POW; a++)

{

N = _pow - old_pow - 1 + old_N;



printf("%8d %8d %8.1f%%\n",_pow, N, (float) N/_pow*100);



// NEXT

old_pow = _pow; _pow = _pow * 2; old_N = N;



} printf("-----------------------------------\n");

}

 21.888. 

BLOCK_SIZE FUEL UP EFFICIENCY

-----------------------------------

1 0 0.0%

2 0 0.0%

4 1 25.0%

8 4 50.0%

16 11 68.8%

32 26 81.3%

64 57 89.1%

128 120 93.8%

256 247 96.5%

512 502 98.0%

1024 1013 98.9%

2048 2036 99.4%

4096 4083 99.7%


    







Forekc.ru
, , , , , , , , , ,