actually 5 bits required to represent -15 in 2's compement

because range of 2's complement no is -2^{n-1 }to +2^{n-1}-1

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+17 votes

+22 votes

Best answer

+11 votes

**Convert the magnitude, -15 to binary.**

**1111**

**To make it 8 bits pad 4 extra bits to 1111 (Always Before)**

**00001111**

Negate the number by inverting the bits and adding 1.In simple words

Take the 2's complement of the no

11110001 (from LSB when u see ist 1 leave it as it is and thereafter flip the all bits.)

To match the answer ignore most significant 3 bits ANS - 10001

0 votes

steps:-

1.compliment of the bits (0000)

2.add one to the result (0001)

the answer is front of you (10001)

1.compliment of the bits (0000)

2.add one to the result (0001)

the answer is front of you (10001)

0 votes

For -15, we have to complement its binary value - 01111..

actually 5 bits required to represent -15 in 2's compement

because range of 2's complement no is -2^{n-1 }to +2^{n-1}-1 .. therefore it will be 10001

In 2's complement representation positive integers are represented in its normal binary form while negative numbers are represented in its 2's complement form.

- All categories
- General Aptitude 1.6k
- Engineering Mathematics 7.5k
- Digital Logic 3k
- Programming & DS 4.9k
- Algorithms 4.3k
- Theory of Computation 5.9k
- Compiler Design 2.1k
- Databases 4.2k
- CO & Architecture 3.5k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.5k
- Admissions 588
- Exam Queries 568
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,071 questions

53,207 answers

184,562 comments

70,425 users