How many numbers
Watch
Announcements
Page 1 of 1
Skip to page:
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
Report
#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)?
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)?
It's also 256 numbers, from -128 through 0 to 127.
Last edited by simonmorrish; 4 months ago
0
reply
(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.
I love that this is in 'advice on everyday issues'!
It's also 256 numbers, from -128 through 0 to 127.
0
reply
Report
#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.
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
Page 1 of 1
Skip to page:
Quick Reply
Back
to top
to top