5
log2 200 = ln 200 ÷ ln 2 = 7.6... → need 8 bits. If a signed number is being stored, then 9 bits would be needed as one would be needed to indicate the sign of the number.
To represent the days of the week, you would need at least 3 bits. With 3 bits, you can represent up to 8 different values (2^3 = 8), which is sufficient to cover all 7 days of the week (Monday to Sunday). Each additional bit would double the number of possible values, but 3 bits are the minimum required to uniquely represent all 7 days.
byte has 8 bits all bits at 0 = zero all bits at 1 = 255
There are 8 bits in a byte, so a two byte integer would be 16 bits. The largest 16 bit integer possible would be 11111111111111112, which is 65535 in base 10.
45 in binary is 101101, so you need at least 6 bits to represent 45 characters.
8 bits if unsigned, 9 bits if signed
how many bits are needed to represent decimal values ranging from 0 to 12,500?
5
log2 200 = ln 200 ÷ ln 2 = 7.6... → need 8 bits. If a signed number is being stored, then 9 bits would be needed as one would be needed to indicate the sign of the number.
1200
23 can be represented in binary as 10111 and would therefore require 5 bits to represent.
18 in binary is 10010 Since 18 can't be written in term of 2 to the power x, the number of bits needed is 5. The answer is 5
4.1 bit for 2,2 bits for 4,3 bits for 8,4 bits for 16.
Packing a lot of meaning into a small space
To represent the days of the week, you would need at least 3 bits. With 3 bits, you can represent up to 8 different values (2^3 = 8), which is sufficient to cover all 7 days of the week (Monday to Sunday). Each additional bit would double the number of possible values, but 3 bits are the minimum required to uniquely represent all 7 days.
17 bits would allow a value up to 131071.