49.0k views
3 votes
In class we learned that in order to uniquely identify one of N equally likely symbols, ceiling (〖log〗_2 N) bits of information must be communicated. Answer the questions below:

(a) How many bits are necessary to encode an integer in the range of 0 to 512 (inclusive)?
(b) It must require 10 bits at least, not 9, because 2^9 = 512, however this is inclusive so it is actually 513 numbers and therefore 10 bits. How many bits are necessary to encode an integer in the range of 0 to 75 (inclusive)?
(c) It would require at least 7 bits. 2^6 = 64 which is not enough, so it must be 2^7 = 128 bits. How many bits are necessary to encode an integer in the range of -20 to 13 (inclusive)?

User Boomah
by
5.4k points

1 Answer

2 votes

Answer:

a. 10bits

b. 7 bits

c. 6 bits

Step-by-step explanation:

a. for 0 to 512

# of numbers = 512 - 0 + 1 =513

[log ₂513] = 9 bits

we actually need 10 bits

b. for 0 to 75

# of numbers = 75 - 0 + 1 =76

[log ₂76] = 6 bits

we actually need 7 bits

c. for -20 to 13

# of numbers = 13 - (-20) + 1 =34

[log ₂34] = 5 bits

we actually need 6 bits

User Arcanox
by
5.4k points