0

(10000000)2 = -128 % there are 8 digits 2^7-1=127=(01111111)2 & there are 8 digits

My MATLAB instructor says that these are true, but I don't know how this works.

I understand 127, but I don't understand about -128. She says something like the first digit in -128, which is 1, is used for determining a sign. But if that is the cases, in (10000000)2, there is no digit that makes it 2^7. Can anyone explain?

Explorer
  • 1,491
  • 4
  • 26
  • 67
Eric Kim
  • 2,493
  • 6
  • 33
  • 69
  • 1
    Wouldn't this be a good question to ask your instructor? – sco1 Mar 06 '17 at 18:55
  • can't reach her for a while from now – Eric Kim Mar 06 '17 at 18:59
  • 1
    Try reading up on [signed number representations](https://en.wikipedia.org/wiki/Signed_number_representations). In general i do not think that this is a matlab question. – mpaskov Mar 06 '17 at 19:00
  • That representation is known as [Two's Complement](https://en.wikipedia.org/wiki/Two's_complement). It is not specific to MATLAB. It is a number representation valid on any digital computer. I've marked an appropriate duplicate for you to read. – rayryeng Mar 06 '17 at 20:08

0 Answers0