ffa_ch5_egypt.kv 1
ffa_ch5_egypt.kv 2
ffa_ch5_egypt.kv 3
ffa_ch5_egypt.kv 4
ffa_ch5_egypt.kv 5
ffa_ch5_egypt.kv 6
ffa_ch5_egypt.kv 7
ffa_ch5_egypt.kv 8
ffa_ch5_egypt.kv 9
ffa_ch5_egypt.kv 10
ffa_ch5_egypt.kv 11
ffa_ch5_egypt.kv 12
ffa_ch5_egypt.kv 13
ffa_ch5_egypt.kv 14
ffa_ch5_egypt.kv 15
ffa_ch5_egypt.kv 16
ffa_ch5_egypt.kv 17
ffa_ch5_egypt.kv 18
ffa_ch5_egypt.kv 19
ffa_ch5_egypt.kv 20 with Words; use Words;
ffa_ch7_turbo_egy... 21 with W_Shifts; use W_Shifts;
ffa_ch5_egypt.kv 22 with FZ_Basic; use FZ_Basic;
ffa_ch5_egypt.kv 23 with FZ_Arith; use FZ_Arith;
ffa_ch5_egypt.kv 24 with FZ_Shift; use FZ_Shift;
ffa_ch5_egypt.kv 25
ffa_ch5_egypt.kv 26
ffa_ch5_egypt.kv 27 package body FZ_Mul is
ffa_ch5_egypt.kv 28
ffa_ch5_egypt.kv 29
ffa_ch5_egypt.kv 30 procedure FZ_Mul_Egyptian(X : in FZ;
ffa_ch5_egypt.kv 31 Y : in FZ;
ffa_ch5_egypt.kv 32 XY_Lo : out FZ;
ffa_ch5_egypt.kv 33 XY_Hi : out FZ) is
ffa_ch5_egypt.kv 34
ffa_ch7_turbo_egy... 35 L : constant Indices := X'Length;
ffa_ch7_turbo_egy... 36
ffa_ch5_egypt.kv 37
ffa_ch5_egypt.kv 38 XY : FZ(1 .. X'Length + Y'Length);
ffa_ch5_egypt.kv 39
ffa_ch5_egypt.kv 40
ffa_ch5_egypt.kv 41 XS : FZ(1 .. X'Length + Y'Length);
ffa_ch5_egypt.kv 42
ffa_ch5_egypt.kv 43 begin
ffa_ch5_egypt.kv 44
ffa_ch5_egypt.kv 45 FZ_Clear(XY);
ffa_ch5_egypt.kv 46
ffa_ch5_egypt.kv 47
ffa_ch5_egypt.kv 48 XS(1 .. X'Length) := X;
ffa_ch5_egypt.kv 49 XS(X'Length + 1 .. XS'Last) := (others => 0);
ffa_ch5_egypt.kv 50
ffa_ch7_turbo_egy... 51
ffa_ch7_turbo_egy... 52 for i in Y'Range loop
ffa_ch5_egypt.kv 53
ffa_ch7_turbo_egy... 54 declare
ffa_ch7_turbo_egy... 55
ffa_ch7_turbo_egy... 56 W : Word := Y(i);
ffa_ch7_turbo_egy... 57
ffa_ch7_turbo_egy... 58
ffa_ch7_turbo_egy... 59 Cut : constant Indices := L + i;
ffa_ch7_turbo_egy... 60 XYc : FZ renames XY(1 .. Cut);
ffa_ch7_turbo_egy... 61 XSc : FZ renames XS(1 .. Cut);
ffa_ch7_turbo_egy... 62
ffa_ch7_turbo_egy... 63 begin
ffa_ch7_turbo_egy... 64 for b in 1 .. Bitness loop
ffa_ch7_turbo_egy... 65
ffa_ch7_turbo_egy... 66
ffa_ch7_turbo_egy... 67 FZ_Add_Gated(X => XYc, Y => XSc, Sum => XYc,
ffa_ch7_turbo_egy... 68 Gate => W and 1);
ffa_ch7_turbo_egy... 69
ffa_ch7_turbo_egy... 70
ffa_ch7_turbo_egy... 71 W := Shift_Right(W, 1);
ffa_ch7_turbo_egy... 72
ffa_ch7_turbo_egy... 73
ffa_ch7_turbo_egy... 74 FZ_ShiftLeft(XSc, XSc, 1);
ffa_ch7_turbo_egy... 75
ffa_ch7_turbo_egy... 76 end loop;
ffa_ch7_turbo_egy... 77 end;
ffa_ch5_egypt.kv 78
ffa_ch5_egypt.kv 79 end loop;
ffa_ch5_egypt.kv 80
ffa_ch5_egypt.kv 81
ffa_ch5_egypt.kv 82 XY_Lo := XY(1 .. XY_Lo'Length);
ffa_ch5_egypt.kv 83 XY_Hi := XY(XY_Lo'Length + 1 .. XY'Last);
ffa_ch5_egypt.kv 84
ffa_ch5_egypt.kv 85 end FZ_Mul_Egyptian;
ffa_ch5_egypt.kv 86 pragma Inline_Always(FZ_Mul_Egyptian);
ffa_ch5_egypt.kv 87
ffa_ch5_egypt.kv 88 end FZ_Mul;