First or last value checker component/funtion
Assuming you're sure you need this, your code would probably look something like this:

p_main: process(clk, reset_n)

  type flowstate is (initial, gathering);
  variable r_state : flowstate;

  variable r_first_val : integer range 0 to c_max;
  variable r_second_val : integer range 0 to c_max;

begin

  if reset_n = '0' then
    r_state := initial;
    r_first_val := 0;
    r_second_val := 0;
    first_val_output_signal &lt;= 0;
    second_val_output_signal &lt;= 0;
  elsif rising_edge(clk) then
    -- determine if the input is valid, depends on protocol
    if inputsvalid then
      case r_state is
        when initial =&gt;
          r_first_val := received_input;
          r_second_val := received_input;
          r_state := gathering;
        when gathering =&gt;
          r_second_val := received_input;
          -- determine if the gathering is done, depends on protocol
          if finished_gathering then
            r_state := initial;
            -- go back to initial state
            first_val_output_signal &lt;= r_first_val;
            second_val_output_signal &lt;= r_second_val;
          end if;
      end case;
    end if;
  end if;

end process;


As you can see, much would depend on the actual protocol the data uses. You mention a bus, but not what kind of bus. Determining what data is valid and how to signal to other blocks/processes that you updated the output signals depends on your application.