0

Binary->HELLPP!!😩

With all the bits being used to represent zero and positive integer values, what are the integers that can be represented by those bits? List them all from smallest to largest values.

18th Jun 2018, 3:15 PM
RaVon
RaVon - avatar
10 Réponses
+ 4
It could have 16 different values. 0001 0010 0100 1000 1 2 4 8 and so on
18th Jun 2018, 3:59 PM
Toni Isotalo
Toni Isotalo - avatar
+ 4
Basically the amount of numbers binary can represent is infinite. We could have like a binary string with 8 bits that repercents a number 01101011 which is 107. Every bit has its decimal value which doubles on every bit starting from right to left. 64 + 32 + 8 + 2 + 1 is 107. 0 bits are ignored
18th Jun 2018, 3:51 PM
Toni Isotalo
Toni Isotalo - avatar
+ 3
Take a look at BCD code
18th Jun 2018, 3:35 PM
Toni Isotalo
Toni Isotalo - avatar
+ 2
If the first bit from the left repercents the sign then the actual number is half less. With 4 bits we can have numbers between 0 and 15. But if the left bit is used for the sign we can then have number from -7 to 7. We used 4 bits for number 15 but for negative -15 we actually need 5 bits.
18th Jun 2018, 4:10 PM
Toni Isotalo
Toni Isotalo - avatar
0
so im on the website tutorialspoint.com; im confused on the question itself.. could you help
18th Jun 2018, 3:40 PM
RaVon
RaVon - avatar
0
for instance i have 4 bits, so i would list all the possible combinations along with its value?
18th Jun 2018, 3:55 PM
RaVon
RaVon - avatar
0
okay cool, one more question; then what if the leftmost bit being used to represent the sign, and the rest of the bits being used to represent integer values, what are the integers that can be represented by those bits
18th Jun 2018, 4:01 PM
RaVon
RaVon - avatar
0
so that will be 2^5=32 combinations
18th Jun 2018, 4:19 PM
RaVon
RaVon - avatar
0
Toni Isotalo " Basically the amount of numbers binary can represent is infinite. " Theoritically, yes. But in reality, for example, in a PC machine with 4GB ram and a custom library which allows you to define data type with ridiculosly huge size like 1GB for each data type, the underlying binary sequence is still finite. That is, 1GB * 8 = 8 Gbit = 8,000,000,000 bits. 8 billion combination of 1's and 0's is still finite.
18th Jun 2018, 8:41 PM
To Seek Glory in Battle is Glorious
To Seek Glory in Battle is Glorious - avatar
0
as i understand it depends on the data type and what those bits represent but in the simplest sense it depends mostly it depends on the number of bits used aproxximatly 2^n where n is the number of bits used in a (word? //standard size used in memory )
19th Jun 2018, 6:10 AM
Rational Agent