Binary representation of negative numbers

how can -8 be represented in 4 bits ? I didn’t understand that because to write in negative you need you have to find it’s complement and add 1. But if you write 8 in four bits you need four digits which maximum we have. Since it is signed integer we need one more digit 0 to represent it as positive no. But in this video sir has used this 1000 value without any sign which is supposed to be positive and used it to find -ve number. How is this possible? Please help!

@rishabhindora,
There are 3 types of representation of integers,

  • Signed bit
  • 1’s Compliment
  • 2’s Compliment

And in 2’s Compliment representation, unlike signed bit representation, we don’t need an extra bit to represent the ‘-’ sign. Rather we reserve the MSB to signify whether the representation is original or it’s 2’s compliment representation. Thus if the MSB is 1, it means we are in 2’s compliment and thus proceed accordingly, and if it is 0, means it is the actual number.

For more, refer here.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.