Understanding 2's Complement w/ 4 Bits

  • Thread starter ECE
  • Start date
  • Tags
    Bits
In summary, 2's complement is a mathematical operation used to represent negative numbers in binary form. It is used to simplify arithmetic operations on binary numbers and allows for the addition, subtraction, and multiplication of both positive and negative numbers. The number of bits needed for 2's complement representation depends on the range of numbers that need to be represented. To convert a positive number to 2's complement, first convert to binary and then flip the bits and add 1 if the number is negative. 2's complement cannot be used for decimal numbers.
  • #1
ECE
7
0
Why in 2's complement the range of numbers that can be represented with 4 bits are from -8 to +7? Wouldn't the numbers with 4 bits be till 15? I am confused.Please help me out.

-Thankyou
 
Last edited:
Engineering news on Phys.org
  • #3
With four bits, you can store 16 different values. You make them represent 0 through 15, which is called unsigned magnitude, or you can make them represent -8 through +7, which is called 2's complement. You cannot represent all the numbers from, say, -8 to +15, because you do not have enough bits.

- Warren
 

1. What is 2's complement?

2's complement is a mathematical operation used to represent negative numbers in binary form. It involves flipping the bits of a number and adding 1 to the result.

2. Why is 2's complement used?

2's complement is used to simplify arithmetic operations on binary numbers. It allows for the addition, subtraction, and multiplication of both positive and negative numbers using the same set of rules.

3. How many bits are needed for 2's complement representation?

For 2's complement representation, the number of bits needed depends on the range of numbers that need to be represented. With 4 bits, the range of numbers that can be represented is -8 to 7.

4. What is the process for converting a positive number to 2's complement?

To convert a positive number to 2's complement with 4 bits, first convert the number to binary. Then, if the number is positive, leave the bits as is. If the number is negative, flip all the bits and add 1 to the result.

5. Can 2's complement be used for decimal numbers?

No, 2's complement is only used for representing negative and positive numbers in binary form. It is not used for decimal numbers.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
624
Replies
5
Views
1K
  • Electrical Engineering
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Electrical Engineering
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
Replies
7
Views
840
  • Precalculus Mathematics Homework Help
Replies
6
Views
3K
Back
Top