Anonymous #1
#1
Report Thread starter 4 months ago
#1
How many numbers can be represented in an 8 bit two's complement? i got 256 numbers for unsigned integers but what about two's complement(8 bit)?
0
reply
simonmorrish
Badges: 11
Rep:
?
#2
Report 4 months ago
#2
(Original post by Anonymous)
How many numbers can be represented in an 8 bit two's complement? i got 256 numbers for unsigned integers but what about two's complement(8 bit)?
I love that this is in 'advice on everyday issues'!

It's also 256 numbers, from -128 through 0 to 127.
Last edited by simonmorrish; 4 months ago
0
reply
Anonymous #1
#3
Report Thread starter 4 months ago
#3
(Original post by simonmorrish)
I love that this is in 'advice on everyday issues'!

It's also 256 numbers, from -128 through 0 to 127.
If I'm at -128.. to get to 128 that leaves me having to go up or count up 128 times. And then to get to 127 I have to count up 127 times so I just did 128 plus 127 to get 255? Silly me though because I do think I'm wrong.. and this is definitely an issue society is trying to tackle everyday so... I feel it is only right!!
0
reply
simonmorrish
Badges: 11
Rep:
?
#4
Report 4 months ago
#4
Hi. True, when you count up from -128 to 0, you've 'moved' 128 times, then another 127 times from 0 to 127, making 255 'moves' in total. But that only counts the numbers you've 'moved to', and forgets to count the number you started on. You need to add that on, giving 256 numbers in total.

It's similar for unsigned integers. The smallest value that can be represented is zero (00000000) and the largest value that can be represented is 255 (11111111); but the number of different values that can be represented is 256.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

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.

Personalise

How are you feeling being back in school?

Happy (44)
23.28%
Unhappy (53)
28.04%
Conflicted (92)
48.68%

Watched Threads

View All