title: Convert 11 bit hex value to a signed 32 bit int
body: <p>I am given a 11 bit signed hex value that must be stored in an int32 data type. When I cast the hex value to an int 32, the 11 bit hex value is obviously smaller then the int32 so it 0 fills the higher order bits. </p>
  
  <p>Basically i need to be able to store 11 bit signed values in an int32 or 16 from a given 11 bit hex value.</p>
  
  <p>For example.
  String hex = 0x7FF;</p>
  
  <p>If i cast this to int32 using Int.parse(hex, System.Globalization.Numbers.Hexvalue);
  I get 2047 when it should be -1 (according to the 11 bit binary 111 1111)</p>
  
  <p>How can I accomplish this in c#?</p>