64.5k views
4 votes
5) [4 points] Suppose you have a simple computer that is capable of storing only the months of the year. The number of bits available to the computer is very limited and can only hold one month at any given time. Invent an encoding scheme in which you assign a unique binary number to each month. A bit is able to store either a zero or a one. What is the minimum number of bits you need to implement your encoding scheme?

User Bguiz
by
8.4k points

1 Answer

1 vote

Answer:

A minimum of 4 bits will be needed.

Step-by-step explanation:

As there are 12 months in a year so will need 12 need combinations.

Number of bits can be determined by the powers of 2. By this we mean:

  • If 1 bit is used


2^1 = 2 Two unique combinations can be made that are 0 and 1.

  • If 2 bits are used


2^2 = 4 4 unique combinations can be made.

  • If 3 bits are used


2^3 = 8 8 unique combinations can be made.

  • If 4 bits are used


2^4 = 16 16 unique combinations can be made.

Now we will have to use 4 bits so that 12 unique combinations may be assigned to each month.

Following is given the bit pattern for each month:

JANUARY => 0000

FEBRUARY => 0001

MARCH => 0010

APRIL => 0011

MAY => 0100

JUNE => 0101

JULY => 0111

AUGUST => 0110

SEPTEMBER => 1000

OCTOBER => 1001

NOVEMBER => 1010

DECEMBER => 1011

i HOPE IT WILL HELP YOU!

User Temuri
by
7.6k points