ffa_ch13_measure_... 1
ffa_ch13_measure_... 2
ffa_ch13_measure_... 3
ffa_ch13_measure_... 4
ffa_ch13_measure_... 5
ffa_ch13_measure_... 6
ffa_ch13_measure_... 7
ffa_ch13_measure_... 8
ffa_ch13_measure_... 9
ffa_ch13_measure_... 10
ffa_ch13_measure_... 11
ffa_ch13_measure_... 12
ffa_ch13_measure_... 13
ffa_ch13_measure_... 14
ffa_ch13_measure_... 15
ffa_ch13_measure_... 16
ffa_ch13_measure_... 17
ffa_ch13_measure_... 18
ffa_ch13_measure_... 19
ffa_ch13_measure_... 20 with Word_Ops; use Word_Ops;
ffa_ch13_measure_... 21 with W_Pred; use W_Pred;
ffa_ch13_measure_... 22 with W_Shifts; use W_Shifts;
ffa_ch13_measure_... 23
ffa_ch13_measure_... 24
ffa_ch13_measure_... 25 package body FZ_Measr is
ffa_ch13_measure_... 26
ffa_ch13_measure_... 27
ffa_ch13_measure_... 28 function FZ_Measure(N : in FZ) return Word is
ffa_ch13_measure_... 29
ffa_ch13_measure_... 30
ffa_ch13_measure_... 31 Index : Word := 0;
ffa_ch13_measure_... 32
ffa_ch13_measure_... 33
ffa_ch13_measure_... 34 Ni : Word;
ffa_ch13_measure_... 35
ffa_ch13_measure_... 36
ffa_ch13_measure_... 37 W : Word := 0;
ffa_ch13_measure_... 38
ffa_ch13_measure_... 39
ffa_ch13_measure_... 40 NiZ : WBool;
ffa_ch13_measure_... 41
ffa_ch13_measure_... 42 begin
ffa_ch13_measure_... 43
ffa_ch13_measure_... 44
ffa_ch13_measure_... 45 for i in 0 .. Indices(N'Length - 1) loop
ffa_ch13_measure_... 46 Ni := N(N'First + i);
ffa_ch13_measure_... 47 NiZ := W_ZeroP(Ni);
ffa_ch13_measure_... 48 Index := W_Mux(Word(i), Index, NiZ);
ffa_ch13_measure_... 49 W := W_Mux(Ni, W, NiZ);
ffa_ch13_measure_... 50 end loop;
ffa_ch13_measure_... 51
ffa_ch13_measure_... 52
ffa_ch13_measure_... 53 Index := Shift_Left(Index, BitnessLog2);
ffa_ch13_measure_... 54
ffa_ch13_measure_... 55
ffa_ch13_measure_... 56 for b in 1 .. Bitness loop
ffa_ch13_measure_... 57
ffa_ch13_measure_... 58 Index := W_Mux(Index + 1, Index, W_ZeroP(W));
ffa_ch13_measure_... 59
ffa_ch13_measure_... 60 W := Shift_Right(W, 1);
ffa_ch13_measure_... 61 end loop;
ffa_ch13_measure_... 62
ffa_ch13_measure_... 63
ffa_ch13_measure_... 64 return Index;
ffa_ch13_measure_... 65
ffa_ch13_measure_... 66 end FZ_Measure;
ffa_ch13_measure_... 67
ffa_ch13_measure_... 68 end FZ_Measr;