title: 2's complement binary expected output
body: <p>I'm studying for my exam, and I would like to check my answers to this question:</p>
  
  <p>Suppose binary values are signed 8-bit values, representing twos-complement format with a decimal range from -128 to 127. Which of the following statements are true/false?</p>
  
  <p>1) 11111111 > 0111111</p>
  
  <p>I think this is false because the first digit represents the sign, so we're comparing a negative value to a positive value.</p>
  
  <p>2) (11111111 + 11111111) > (00000001 - 00000010)</p>
  
  <p>I'm not so sure about this one because I don't know what happens when it overflows. I think the computer just drops the last digit. So I think the left-hand side is like -128 - 128 = -256. Then the right-hand side is 1 - 2 = -1, which is represented as 1000001.  This means the inequality, in decimal, becomes -256 > -1, which is false. But again, I am not so sure about this one. </p>
  
  <p>3) (10000000 / 00000100) == 11100000 </p>
  
  <p>The first part is -0/4 and the second part is non-zero, so would it be false?</p>
  
  <hr>
  
  <p>Also, there are only sample problems, and I would like to practice/explore on my own. Is there any way in which I can write a C++ program to see the expected output of questions of this form? </p>
  
  <p>Thank you.</p>