title: Two's complement of a std_logic_vector
body: <p>I am trying to convert a std_logic_vector in its two's complement. I am trying to perform -2 multiplication on a vector. </p>
  
  <pre><code>library ieee;
  use ieee.std_logic_1164.all;
  
  entity twoscomplement is 
  port ( x : in std_logic_vector(15 downto 0);
         y : out std_logic_vector(15 downto 0)
        );
  end entity;
  
  architecture model of twoscomplement is 
  signal x_c : std_logic_vector (15 downto 0);
  
  x_c &lt;= (not(x) +'1')*2 ; -- x_c = -2*x
  
  end model;
  </code></pre>