 ****** UART_LED_pkg.txt ******

  function and_bits_together ( data_in : std_logic_vector ) return std_logic;
  function or_bits_together ( data_in : std_logic_vector ) return std_logic;


  function and_bits_together ( data_in : std_logic_vector ) return std_logic is
  begin
    for i in data_in'range loop
      if data_in(i) = '0' then return '0';
      end if;
    end loop;
    return '1';
  end function and_bits_together;

  function or_bits_together ( data_in : std_logic_vector ) return std_logic is
  begin
    for i in data_in'range loop
      if data_in(i) = '1' then return '1';
      end if;
    end loop;
    return '0';
  end function or_bits_together;


  ****** string_utilities_sim_pkg.vhd ******

  function strposnext(s: string; c: character; pos: integer) return integer;
  function strposlast(s: string; c: character) return integer;
  

      function strposnext(s : string; c : character; pos: integer) return integer is
       begin
          spos: for i in pos to s'length loop
             if (s(i) = c) then
                return i;
             end if;
          end loop;
          return 0;
       end function strposnext;

    function strposlast(s : string; c : character) return integer is
       begin
          spos: for i in s'length downto 1 loop
             if (s(i) = c) then
                return i;
             end if;
          end loop;
          return 0;
       end function strposlast;


