79721624

Date: 2025-07-31 17:16:56
Score: 1.5
Natty:
Report link

When you are finding 2's compliment, the size of the number (number of bits) matters. Since the question explicitly mentions 3 bit number, any carry out beyond the 3rd bit is ignored and you will get the correct answer. Moreover, you can't store 4 bits as you have only 3. One thing to keep in mind is when you take 2's compliment, the number switches sign (except the last -ve number which would remain unchanged).

Let's see your example:

000 is actually 0.

Inverting bits to get 1's compliment : 111

Adding 1 to get 2's compliment 000 (ignoring 1) which is again 0. This makes sense as -(0) = 0

Incase you consider that 1 in front, you will get 1000 which is actually -16 which doesn't make any sense -(0) ≠ -16.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Starts with a question (0.5): When you are findin
  • Low reputation (1):
Posted by: Vasanth P