package bit_ops is
  function "<" (L, R : bit_vector) return boolean;
end bit_ops;

package body bit_ops is
  function "<" (L, R : bit_vector) return boolean is
    variable result : boolean;
  begin
    assert (L'length = R'length)
    report "Bit_vectors have different lengths"
    severity error;
    result := false;
    for i in L'left to L'right loop
      if (L(i) = R(i)) then
        next;
      elsif (L(i) = '0' and R(i) = '1') then
        result := true;
        exit;
      else
        result := false;
        exit;
      end if;
    end loop;
    return result;
  end "<";
end bit_ops;
