185 stored as a signed 8-bit number?

  • Thread starter joel amos
  • Start date
  • Tags
    Binary
In summary, the conversation discusses several exercises in a textbook that start with assumptions about signed 8-bit decimal integers stored in different formats. The question asks the reader to find the sum or difference of these numbers and state if there is overflow, underflow, or neither. However, the maximum number that can be represented in an 8-bit integer is 127, making three of the numbers listed too large to fit in 8 bits. The question also asks about overflows and underflows, which are not possible with these numbers.
  • #1
joel amos
104
0
Several exercises in my textbook start with assumptions that confuse me. For example:

  • Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude format.
  • Assume 151 and 214 are signed 8-bit decimal integers stored in two's complement format.
I am then to go on to find the sum or difference (varies by exercise) of the numbers and state if there is overflow, underflow, or neither.

But...isn't the maximum number that can be represented here 2^7−1=127?
 
Mathematics news on Phys.org
  • #2
joel amos said:
Several exercises in my textbook start with assumptions that confuse me. For example:

  • Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude format.
  • Assume 151 and 214 are signed 8-bit decimal integers stored in two's complement format.
I am then to go on to find the sum or difference (varies by exercise) of the numbers and state if there is overflow, underflow, or neither.

But...isn't the maximum number that can be represented here 2^7−1=127?
These questions don't make sense to me, either. 127 is the largest number that can be stored as a signed 8-bit integer. So three of the numbers listed above are already too large to fit in 8 bits (with one bit for the sign).
 
  • #3
joel amos said:
But...isn't the maximum number that can be represented here 2^7−1=127

And doesn't the question ask you if there are overflows or underflows?
 
  • #4
joel amos said:
Several exercises in my textbook start with assumptions that confuse me. For example:

  • Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude format.
  • Assume 151 and 214 are signed 8-bit decimal integers stored in two's complement format.
I am then to go on to find the sum or difference (varies by exercise) of the numbers and state if there is overflow, underflow, or neither.

But...isn't the maximum number that can be represented here 2^7−1=127?
Can you provide a sample: one exercise, together with the textbook's answer?
 

Related to 185 stored as a signed 8-bit number?

1. What is a signed 8-bit number?

A signed 8-bit number is a numerical data type that can hold a range of values from -128 to 127. It is represented using 8 bits (or 1 byte) of data, with the first bit being used as a sign bit to indicate whether the number is positive or negative.

2. How is 185 stored as a signed 8-bit number?

In a signed 8-bit number, the first bit (also known as the most significant bit) is used to indicate the sign. In this case, since 185 is a positive number, the first bit will be 0. The remaining 7 bits will be used to represent the value 185 in binary form, which is 10111001.

3. What is the range of values that can be stored in a signed 8-bit number?

The range of values that can be stored in a signed 8-bit number is -128 to 127. This is because the first bit is used as a sign bit, which allows for one extra negative value compared to the positive values that can be represented.

4. How many bits are used to store a signed 8-bit number?

As the name suggests, a signed 8-bit number is stored using 8 bits (or 1 byte) of data. This means that there are a total of 8 binary digits (0s and 1s) that can be used to represent a signed 8-bit number.

5. What are the advantages of using signed 8-bit numbers?

Signed 8-bit numbers have a relatively small range of values, but they are useful in situations where memory usage is a concern. They take up less space compared to larger data types, making them more efficient for storing and processing data in certain applications.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
9
Views
1K
  • Computing and Technology
Replies
4
Views
912
  • Programming and Computer Science
Replies
17
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
3K
  • Programming and Computer Science
Replies
12
Views
3K
  • Programming and Computer Science
Replies
2
Views
8K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
Back
Top