149k views
5 votes
What is -7 in binary and also what is -5 in binary

User Mgrouchy
by
7.6k points

2 Answers

4 votes

Answer:

-7 in binary is -0b111.

-5 in binary is -0b101.

Explanation:

User Jmcgriz
by
8.5k points
4 votes

Answer:

-111

-101

Explanation:

Binary uses powers of 2.

2^0 = 1

2^1 = 2

2^2 = 4

2^3 = 8

2^4 = 16

7 = 4 + 2 + 1

7 = 1 × 2^2 + 1 × 2^1 + 1 × 2^0

7 in binary is 111

-7 in binary is -111

5 = 4 + 1

5 = 1 × 2^2 + 0 × 2^1 + 1 × 2^0

5 in binary is 101

-5 in binary is -101

User Attila Miklosi
by
7.3k points