0

The binary number I was given is 1100101111001000 (16 bits). I understand that this is negative, so, therefore, I have to find the bit representation for the positive number (0100101111001000 - 16 bit) and then flip the bits (101101000110111) and then add one. This is where I am stuck. I know that if the first bit were to be 0, then I would just change it to 1, so does the first bit just become 0 in this case?

  • If you're stuck you've got C code you should be including in your question that demonstrates *how* you're stuck. Please edit and include that. – tadman Feb 06 '18 at 18:34
  • @tadman There is no C code, just working with binary code. Edited my tag. – liquidOfficer Feb 06 '18 at 18:36
  • You'll need to come up with something, anything, to show you're invested in solving the problem. – tadman Feb 06 '18 at 18:37
  • You've answered your own question -- to negate a two's complement number, you invert all the bits and add 1. That's it. – Chris Dodd Feb 06 '18 at 18:38

0 Answers0