title: Instantiating 4 bit Full Adder
body: <p>I'm having difficulty instantiating the fa0 portion of this code. I'm fairly new to VHDL so maybe more than just an answer would help. </p>
  
  <p>This Logic 4 Module is structural code as a component to an ALU that I'm working on.</p>
  
  <p>Thank you </p>
  
  <pre><code>-----------------------------------------------------------------
  -- 4-bit adder/subtractor module
  -----------------------------------------------------------------
  library ieee;
  use ieee.std_logic_1164.all;
  
  entity addsub4 is
      port (addl_subh : in std_logic;
          X, Y      : in std_logic_vector(3 downto 0);
          S         : out std_logic_vector(3 downto 0);
          cout, ovf : out std_logic);
  end addsub4;
  
  architecture addsub4_arch of addsub4 is
  
      component fa is
          port (cin, x, y : in std_logic;
              s, cout   : out std_logic);
      end component fa;
  
      -- let Yhat denote the signal after Y xor addl_subh
      signal Yhat: std_logic_vector(3 downto 0); 
      -- let carryout denote the cout signal for each fa module
      signal carryout: std_logic_vector(3 downto 0); 
  
  begin
  
      Yhat(0) &lt;= Y(0) xor addl_subh;
      Yhat(1) &lt;= Y(1) xor addl_subh;
      Yhat(2) &lt;= Y(2) xor addl_subh;
      Yhat(3) &lt;= Y(3) xor addl_subh;
  
      fa0: fa
          port map ( cin =&gt; addl_subh, x =&gt; X(0), y =&gt; Yhat(0),
                  s =&gt; S(0), cout =&gt; carryout(0));
  
      fa1: fa
          port map ( cin =&gt; carryout(0), x =&gt; X(1), y =&gt; Yhat(1),
                   s =&gt; S(1), cout =&gt; carryout(1));
  
      fa2: fa
          port map ( cin =&gt; carryout(1), x =&gt; X(2), y =&gt; Yhat(2),
                   s =&gt; S(2), cout =&gt; carryout(2));
  
      fa3: fa
          port map ( cin =&gt; carryout(2), x =&gt; X(3), y =&gt; Yhat(3),
                   s =&gt; S(3), cout =&gt; carryout(3));
  
      cout &lt;= carryout(3);
      ovf &lt;= carryout(2) xor carryout(3);
  
  end addsub4_arch;
  </code></pre>