library ieee;
use ieee.std_logic_1164.all;

package spi_pkg is

  type natural_vector is array (natural range <>) of natural;

  function get_max_natural (
    constant divisors : natural_vector)
    return natural;

end package spi_pkg;

package body spi_pkg is

  function get_max_natural (
    constant divisors : natural_vector)
    return natural is
    variable max : natural := divisors(divisors'left);
  begin
    for i in divisors'range loop
      if divisors(i) > max then
        max := divisors(i);
      end if;
    end loop;  -- i

    return max;
  end function;

end package body spi_pkg;
