Tamil Nadu HSE First Year Computer Applications study materials
Tamil Nadu HSE First Year Computer Applications study resources

Fixed-Width Inventory Labels for 3,000 Machines

Tamil Nadu HSE First Year Computer Applications · Put your knowledge to work in context.

All case studies

Fixed-Width Inventory Labels for 3,000 Machines

A school in Coimbatore is labelling 3,000 desktop machines. Each machine has a decimal inventory number from 1 to 3,000. The lab technician wants to engrave a fixed-width binary code and a four-digit hexadecimal code on every CPU cabinet. A vendor quotes a laser engraver that accepts only 12 binary digits, while the school's asset register software stores the hexadecimal form. Machine number 2,745 is the first unit to be labelled. A student volunteer converts 2,745 by repeatedly dividing by 2 and writes 101010111001, then claims the same bit pattern can be read as octal without change. The technician is unsure whether 12 bits can cover all 3,000 machines, and whether a four-digit hex code is enough. The labels must be identical in width so that a scanner can compare them; leading zeros are allowed.

1. Can a 12-bit binary label represent every inventory number from 1 to 3,000? Show the range calculation and the minimum bit width, then convert 2,745 to binary and to hexadecimal, showing the division steps.

Read the worked answer

12 bits give 2^12 = 4,096 patterns, numbered 0 to 4,095. The inventory range 1–3,000 fits, so 12 bits is sufficient. It is also the minimum: 2^11 = 2,048, which is less than 3,000, so 11 bits would fail at machine 2,049.

Converting 2,745 by repeated division by 2, collecting remainders:

  • 2745 ÷ 2 = 1372 remainder 1
  • 1372 ÷ 2 = 686 remainder 0
  • 686 ÷ 2 = 343 remainder 0
  • 343 ÷ 2 = 171 remainder 1
  • 171 ÷ 2 = 85 remainder 1
  • 85 ÷ 2 = 42 remainder 1
  • 42 ÷ 2 = 21 remainder 0
  • 21 ÷ 2 = 10 remainder 1
  • 10 ÷ 2 = 5 remainder 0
  • 5 ÷ 2 = 2 remainder 1
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1

Reading the remainders from the last to the first gives 101010111001₂. Check: 2048 + 512 + 128 + 32 + 16 + 8 + 1 = 2,745.

For hexadecimal, group the binary bits in fours from the right: 1010 1011 1001 = A B 9, so the four-digit label is 0AB9₁₆. Check: 10×256 + 11×16 + 9 = 2,560 + 176 + 9 = 2,745. Four hex digits cover 16^4 = 65,536 values, so the format is safe.

2. The volunteer claims that 101010111001 can be read as an octal number 'without change'. Assess this claim and give the correct octal value, explaining the grouping rule.

Read the worked answer

The claim is partly right but imprecise. Binary-to-octal conversion groups bits in threes from the right, because each octal digit maps to exactly three bits. The bit string is not changed, only regrouped and relabelled.

101010111001 has 12 bits, a multiple of 3, so:

101 010 111 001 = 5 2 7 1 = 5271₈

Check: 5×512 + 2×64 + 7×8 + 1 = 2,560 + 128 + 56 + 1 = 2,745.

The volunteer must not read the binary digits as decimal digits, and the rule only works directly when the bit count is a multiple of 3. If it were not, leading zeros would be added before grouping. For example, 1010 would become 001 010 = 12₈, not 10₈. So the grouping works for this particular 12-bit label, but the reason should be stated correctly.