Results 1 to 2 of 2

Math Help - finding smallest and largest number given n binary bits

  1. #1
    Member Jskid's Avatar
    Joined
    Jul 2010
    Posts
    160

    finding smallest and largest number given n binary bits

    Given n bits that can hold 0s or 1s what is the largest and smallest integer they can hold? I know the formula min=-2^{n-1}, max=2^{n-1}-1 but is that only for numbers stored using two's compliment? Is there a formula for one's compliment and signed magnitude? If a number is unsigned then it would be 2^n right?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,539
    Thanks
    778

    Re: finding smallest and largest number given n binary bits

    Quote Originally Posted by Jskid View Post
    Given n bits that can hold 0s or 1s what is the largest and smallest integer they can hold? I know the formula min=-2^{n-1}, max=2^{n-1}-1 but is that only for numbers stored using two's compliment?
    Yes.

    Quote Originally Posted by Jskid View Post
    Is there a formula for one's compliment and signed magnitude?
    "An n-bit ones' complement numeral system can represent integers in the range -(2^{n-1}-1) to 2^{n-1}-1" (Wikipedia). For the sign-and-magnitude method, the interval is the same because n - 1 bits represent the absolute value.

    Quote Originally Posted by Jskid View Post
    If a number is unsigned then it would be 2^n right?
    The largest representable integer is not 2^n. Consider the example when n = 3 and the largest integer is 111_2.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Largest and smallest possible dimension?
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: April 15th 2010, 06:08 AM
  2. Replies: 1
    Last Post: October 2nd 2009, 04:32 AM
  3. Help finding the largest and smallest value
    Posted in the Calculus Forum
    Replies: 3
    Last Post: September 20th 2009, 05:25 AM
  4. Domain and largest/smallest integer
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: January 3rd 2009, 03:00 PM
  5. Find the largest and smallest
    Posted in the Algebra Forum
    Replies: 2
    Last Post: December 18th 2007, 06:29 PM

Search Tags


/mathhelpforum @mathhelpforum