Numbers Outside of Address Range (Sign-Magnitude Rep.)

This is possible because the first bit is used as a sign indicator, so it is not included in the actual number representation. In summary, using sign-magnitude representation with 8 bits allows for a range of -128 to 127, with the first bit indicating the sign and not being included in the actual number representation.
  • #1
KongMD
10
0

Homework Statement



+35 + -80 with only 8-bits using sign-magnitude representation

Homework Equations


The Attempt at a Solution



Why is this possible? Allowing for one sign bit, the maximum range (in my mind) should be -63 < N < 63. I can see from my notes, however, that the limits of an 8-bit addressing scheme for sign-magnitude representation is -127 < N < 127. How can the left-most bit be both the sign and part of the number?! I'm not asking for anyone to do the problem for me, but I just want to understand why the left-most bit can perform both functions.

EDIT: I think I figured it out. 80 can be represented in 7-bits - I must've had my counting off somewhere. Sorry!
 
Last edited:
Physics news on Phys.org
  • #2
Yes, your counting was off. With 7 bits you can represent 0 through 127. With the eighth bit for the sign, you can represent the numbers -128 through 127.
 

What are numbers outside of address range?

Numbers outside of address range refer to numbers that fall outside the range of addresses that can be represented by a specific computer system or programming language.

What is the sign-magnitude representation?

The sign-magnitude representation is a system for representing numbers in binary form, where the leftmost bit represents the sign (positive or negative) and the remaining bits represent the magnitude of the number.

Why is it important to consider numbers outside of address range?

It is important to consider numbers outside of address range because they can lead to errors or unexpected results in computer programs if not properly handled.

How can numbers outside of address range be handled in programming?

Numbers outside of address range can be handled in programming by using error handling techniques such as range checking, data type conversions, or exception handling.

What are some potential issues with using numbers outside of address range?

Some potential issues with using numbers outside of address range include data loss, incorrect calculations, and program crashes. It is important to properly handle these numbers to avoid these issues.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
624
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Computing and Technology
Replies
4
Views
763
  • Engineering and Comp Sci Homework Help
Replies
10
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Quantum Physics
Replies
22
Views
599
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
776
  • Programming and Computer Science
Replies
32
Views
1K
Back
Top