Page 360 - Hardware Implementation of Finite-Field Arithmetic
P. 360
340 App endix D
and a test_reducer.adb file is generated:
with Gnat.Io; use Gnat.Io;
with reducer_parameters; use reducer_parameters;
procedure test_reducer is
--insert here Algorithm 2
x, m, z: integer;
begin
loop
Put(“m = “); Get(m); Put(“x = “); Get(x);
nr_reducer(x, m, z);
Put(x); Put(“ mod “); Put(m); Put(“ = “); Put(z);
New_Line; New_Line;
end loop;
end test_reducer;
Observe that the way the package contents are made visible is
slightly different:
with reducer_parameters; use reducer_parameters; -- (Ada)
use work.test_reducer_parameters.all; -- (VHDL)
The Gnat.Io package includes input-output functions such as get,
put, and New_Line. They allow one to input values from the keyboard
and to display the results.
The complete Ada file test_reducer.adb is available at www.
arithmetic-circuits.org.