title: How negative numbers are stored in memory? How to know the bit representation?
body: <p>I am aware of MSB, LSB, sign and magnitude one's and two's complement etc. Now, I would like to know if I am writing and program which does some bit manipulation, How would I check the actual bit level data in memory?</p>
  
  <p>i.e. <code>int a = -1;</code> How would I know if it is <code>1001</code> or <code>1110</code> or <code>1111</code> in a 4-bit representation?</p>
  
  <p>How do I figure out the method my implementation uses to represent negative numbers?</p>
  
  <p>I am looking for some way to examine the bit level data of a C program.</p>
  
  <p>My current platform is Ubuntu 12.04 LTS. Once again, the question is not about how it is done. It is about how to find out or justify that it is done in some way.</p>