title: Trying to use a buffer in VHDL - not working
body: <p>My code produces the following error when compiling:</p>
  
  <p>ERROR:HDLCompiler:439 - "E:/ELECTRONIC ENGINEERING 2/DIGITAL/Resit_Year/Assignment_7_seg/4_Bit_Counter/Bit_Counter/counter_tb.vhd" Line 47: Formal port count_out of mode buffer cannot be associated with actual port count_out of mode out
  ERROR:Simulator:777 - Static elaboration of top level VHDL design unit counter_tb in library work failed</p>
  
  <p>don't know how to fix this. </p>
  
  <p>full code: </p>
  
  <pre><code>-----------------------------------------------------------------------------------
      entity Four_Bit_Counter is
  
      Port ( clock : in  STD_LOGIC;
             reset : in  STD_LOGIC;
             pause : in  STD_LOGIC;
             count_out : buffer  STD_LOGIC_VECTOR (3 downto 0);
                student_id : buffer STD_LOGIC_VECTOR (3 downto 0)  ); 
        end Four_Bit_Counter;
  
  ----------------------------------------------------------------------------------
       architecture Behavioral of Four_Bit_Counter is
  
      signal temp_count : std_logic_vector(3 downto 0) := "0000" ;
      signal slow_clock : std_logic ;
      signal clock_divider : std_logic_vector(1 downto 0) := "00";
       variable cout_out : std_logic_vector(3 downto 0):= "0000";
  
  
      begin
  
  ---------------------------------------------------------------------------------
  
      clock_division : process (clock, clock_divider)
  
      begin
  
      if 
          clock'event and clock = '1' then
         clock_divider &lt;= clock_divider + 1;
  
      end if;
  
      slow_clock &lt;= clock_divider(1);
  
       end process;
  
  --------------------------------------------------------------------------------
        counting : process(reset, pause, slow_clock, temp_count)
  
       begin
  
       if     reset = '1' then
              temp_count &lt;= "0000";
  
          elsif pause = '1' then
              temp_count &lt;= temp_count;
      else
      if slow_clock'event and slow_clock= '1' then
      if temp_count &lt; 15 then
      temp_count &lt;= temp_count + 1;
          else
              temp_count &lt;= "0000";
              end if;
          end if;
      end if;
  
      count_out &lt;= temp_count;
  
      end process;
  
  ----------------------------------------------------------------------------------
  student : process (reset, pause, slow_clock, temp_count)
  
  begin
  
  
              IF (cout_out = "0010")  THEN
              student_id &lt;= "0010";
              ELSIF (cout_out = "0011")  THEN
              student_id &lt;= "0001";
              ELSIF (cout_out = "0100")  THEN
              student_id &lt;= "0000";
              ELSIF (cout_out = "0101")  THEN
              student_id &lt;= "0000";
              ELSIF (cout_out = "0110")  THEN
              student_id &lt;= "1001";
              ELSIF (cout_out = "0111")  THEN
              student_id &lt;= "0011";
              ELSIF (cout_out = "1000")  THEN
              student_id &lt;= "0010";
              ELSIF (cout_out = "1001")  THEN
              student_id &lt;= "0110";
              ELSE student_id &lt;= "1000";
  
              END IF;
  
  end process student;
  
      --student_id &lt;=  "0010" when count_out &gt;= "0001" else
                          --"0001" when count_out &gt;= "0011" else
                          --"0000" when count_out &gt;= "0101" else
                          --"0000" when count_out &gt;= "0111" else
                          --"1001" when count_out &gt;= "1000" else
                          --"0011" when count_out &gt;= "1001" else
                          --"0000" when count_out &gt;= "1011" else
                          --"0110" when count_out &gt;= "1100" else
                          --"1000";
  
  
  
  end Behavioral;
  </code></pre>