Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    18
    ReputationRep:
    How do I convert numbers to signed 8-bit binary?
    Will the value be the same, if it was signed or unsigned?

    For example, I've got the number 22 as 00010110, but that's in unsigned 8-bit binary, would it be the same for signed 8-bit binary?
    Offline

    2
    ReputationRep:
    'Unsigned can hold a larger positive value, and no negative value. Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative. Signed integers can hold both positive and negative numbers.'

    Do you study computing at A-level at all? In my Computing course we learn two ways to give a binary integer a sign; 2's compliment and sign and magnitude. I'm not sure if there are more standard ways (I'm not at uni yet!), but these are two methods I know that are used to represent negative and positive numbers in binary.

    For an 8 bit byte, with 2's compliment...

    -22

    Name:  minus222scompliment.png
Views: 40
Size:  3.9 KB

    For an 8 bit byte, with sign and magnitude...

    -22

    Name:  minus22signandmagnitude.png
Views: 43
Size:  6.1 KB
    Attached Images
      
    Offline

    17
    ReputationRep:
    (Original post by Me123456789)
    How do I convert numbers to signed 8-bit binary?
    Will the value be the same, if it was signed or unsigned?

    For example, I've got the number 22 as 00010110, but that's in unsigned 8-bit binary, would it be the same for signed 8-bit binary?
    That would be the same since it is not negative. If it was a negative number we use the eighth bit as a sign. We set it to 1 for negative and 0 for positive. The number is then written normally. As you can imagine this reduces the number of numbers we can represent since we waste the eighth bit as a sign.
    • Thread Starter
    Offline

    18
    ReputationRep:
    (Original post by Someboady)
    That would be the same since it is not negative. If it was a negative number we use the eighth bit as a sign. We set it to 1 for negative and 0 for positive. The number is then written normally. As you can imagine this reduces the number of numbers we can represent since we waste the eighth bit as a sign.
    Thank you
    Offline

    17
    ReputationRep:
    (Original post by Me123456789)
    Thank you
    No problem. Absolutely love the Profile picture/avatar btw xD
    • Thread Starter
    Offline

    18
    ReputationRep:
    (Original post by sophiebookley)
    'Unsigned can hold a larger positive value, and no negative value. Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative. Signed integers can hold both positive and negative numbers.'

    Do you study computing at A-level at all? In my Computing course we learn two ways to give a binary integer a sign; 2's compliment and sign and magnitude. I'm not sure if there are more standard ways (I'm not at uni yet!), but these are two methods I know that are used to represent negative and positive numbers in binary.
    Thank you

    I never did it at A-level, but I'm doing it at university now.
    Offline

    2
    ReputationRep:
    (Original post by Me123456789)
    Thank you

    I never did it at A-level, but I'm doing it at university now.
    Oh wow! I hope you're enjoying it, hopefully I'll be in the same position in September!
    • Thread Starter
    Offline

    18
    ReputationRep:
    (Original post by sophiebookley)
    Oh wow! I hope you're enjoying it, hopefully I'll be in the same position in September!
    It is quite good actually I did struggle with it though
    Ooh, you're doing cs? Where are you going?

    (Original post by Someboady)
    No problem. Absolutely love the Profile picture/avatar btw xD
    ]



    I don't know if you do this in your A-level but do any of you know how to evaluate the following expression
    R2C = M2C – D2C
    Offline

    17
    ReputationRep:
    (Original post by Me123456789)
    It is quite good actually I did struggle with it though
    Ooh, you're doing cs? Where are you going?

    ]



    I don't know if you do this in your A-level but do any of you know how to evaluate the following expression
    R2C = M2C – D2C
    Afraid not, what topic is this?
    • Thread Starter
    Offline

    18
    ReputationRep:
    (Original post by Someboady)
    Afraid not, what topic is this?
    I got it now

    It was data representation, two's complement
    Offline

    17
    ReputationRep:
    (Original post by Me123456789)
    I got it now

    It was data representation, two's complement
    o.0 we do two's complement but I've never seen R2C and all that :/ ? I've only seen it in relation to Binary?
    • Thread Starter
    Offline

    18
    ReputationRep:
    (Original post by Someboady)
    o.0 we do two's complement but I've never seen R2C and all that :/ ? I've only seen it in relation to Binary?
    Yeah it's still about the 8-bit binary stuff but I had to use two's complement
    :dontknow: If that makes sense...
    Offline

    17
    ReputationRep:
    (Original post by Me123456789)
    Yeah it's still about the 8-bit binary stuff but I had to use two's complement
    :dontknow: If that makes sense...
    o.0
    So what exactly does this mean?
    R2C = M2C – D2C
    Sorry I'm very curious XD
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Brexit voters: Do you stand by your vote?
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Write a reply...
    Reply
    Hide
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.