raw
ffa_ch3_shifts.kv       1 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 2 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
ffa_ch3_shifts.kv 4 -- --
ffa_ch3_shifts.kv 5 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
ffa_ch3_shifts.kv 6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
ffa_ch3_shifts.kv 7 -- --
ffa_ch3_shifts.kv 8 -- You do not have, nor can you ever acquire the right to use, copy or --
ffa_ch3_shifts.kv 9 -- distribute this software ; Should you use this software for any purpose, --
ffa_ch3_shifts.kv 10 -- or copy and distribute it to anyone or in any manner, you are breaking --
ffa_ch3_shifts.kv 11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
ffa_ch3_shifts.kv 12 -- continue doing so for the indefinite future. In any case, please --
ffa_ch3_shifts.kv 13 -- always : read and understand any software ; verify any PGP signatures --
ffa_ch3_shifts.kv 14 -- that you use - for any purpose. --
ffa_ch3_shifts.kv 15 -- --
ffa_ch3_shifts.kv 16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
ffa_ch3_shifts.kv 17 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 18 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 19
ffa_ch3_shifts.kv 20 with Words; use Words;
ffa_ch3_shifts.kv 21 with FZ_Type; use FZ_Type;
ffa_ch3_shifts.kv 22
ffa_ch3_shifts.kv 23
ffa_ch3_shifts.kv 24 package FZ_Shift is
ffa_ch3_shifts.kv 25
ffa_ch3_shifts.kv 26 pragma Pure;
ffa_ch3_shifts.kv 27
ffa_ch3_shifts.kv 28 --------------------------------------------------------------
ffa_ch3_shifts.kv 29 -- Shift Right
ffa_ch3_shifts.kv 30 --------------------------------------------------------------
ffa_ch3_shifts.kv 31
ffa_ch3_shifts.kv 32 -- ShiftedN := N >> Count (with Overflow Input and Output)
ffa_ch3_shifts.kv 33 procedure FZ_ShiftRight_O_I(N : in FZ;
ffa_ch3_shifts.kv 34 ShiftedN : out FZ;
ffa_ch3_shifts.kv 35 Count : in WBit_Index;
ffa_ch3_shifts.kv 36 Overflow : out Word;
ffa_ch3_shifts.kv 37 OF_in : in Word);
ffa_ch3_shifts.kv 38 pragma Precondition(N'Length = ShiftedN'Length);
ffa_ch3_shifts.kv 39
ffa_ch3_shifts.kv 40 -- ShiftedN := N >> Count (with Overflow Output only)
ffa_ch3_shifts.kv 41 procedure FZ_ShiftRight_O(N : in FZ;
ffa_ch3_shifts.kv 42 ShiftedN : out FZ;
ffa_ch3_shifts.kv 43 Count : in WBit_Index;
ffa_ch3_shifts.kv 44 Overflow : out Word);
ffa_ch3_shifts.kv 45 pragma Precondition(N'Length = ShiftedN'Length);
ffa_ch3_shifts.kv 46
ffa_ch3_shifts.kv 47 -- ShiftedN := N >> Count (no Overflow output or input)
ffa_ch3_shifts.kv 48 procedure FZ_ShiftRight(N : in FZ;
ffa_ch3_shifts.kv 49 ShiftedN : out FZ;
ffa_ch3_shifts.kv 50 Count : in WBit_Index);
ffa_ch3_shifts.kv 51 pragma Precondition(N'Length = ShiftedN'Length);
ffa_ch3_shifts.kv 52
ffa_ch3_shifts.kv 53 --------------------------------------------------------------
ffa_ch3_shifts.kv 54 -- Shift Left
ffa_ch3_shifts.kv 55 --------------------------------------------------------------
ffa_ch3_shifts.kv 56
ffa_ch3_shifts.kv 57 -- ShiftedN := N << Count (with Overflow Input and Output)
ffa_ch3_shifts.kv 58 procedure FZ_ShiftLeft_O_I(N : in FZ;
ffa_ch3_shifts.kv 59 ShiftedN : out FZ;
ffa_ch3_shifts.kv 60 Count : in WBit_Index;
ffa_ch3_shifts.kv 61 Overflow : out Word;
ffa_ch3_shifts.kv 62 OF_in : in Word);
ffa_ch3_shifts.kv 63 pragma Precondition(N'Length = ShiftedN'Length);
ffa_ch3_shifts.kv 64
ffa_ch3_shifts.kv 65 -- ShiftedN := N << Count (with Overflow Output only)
ffa_ch3_shifts.kv 66 procedure FZ_ShiftLeft_O(N : in FZ;
ffa_ch3_shifts.kv 67 ShiftedN : out FZ;
ffa_ch3_shifts.kv 68 Count : in WBit_Index;
ffa_ch3_shifts.kv 69 Overflow : out Word);
ffa_ch3_shifts.kv 70 pragma Precondition(N'Length = ShiftedN'Length);
ffa_ch3_shifts.kv 71
ffa_ch3_shifts.kv 72 -- ShiftedN := N << Count (no Overflow output or input)
ffa_ch3_shifts.kv 73 procedure FZ_ShiftLeft(N : in FZ;
ffa_ch3_shifts.kv 74 ShiftedN : out FZ;
ffa_ch3_shifts.kv 75 Count : in WBit_Index);
ffa_ch3_shifts.kv 76 pragma Precondition(N'Length = ShiftedN'Length);
ffa_ch3_shifts.kv 77
ffa_ch3_shifts.kv 78 end FZ_Shift;