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

Exam Cell Storage and Serial-Code Width

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

All case studies

Exam Cell Storage and Serial-Code Width

The exam cell of a higher secondary school has scanned 2,400 answer sheets. Each scan is saved as a separate file of about 400 KB. The cell owns one 2 GB pen drive that already contains 300 MB of question papers, and one blank 4.7 GB DVD-R. When the pen drive is plugged in, the computer reports its capacity as 1.86 GB, although the label says 2 GB. Separately, every answer sheet carries a four-digit serial number from 0000 to 9999. The exam cell wants to store these serial numbers in a fixed-width binary field and has received two conflicting suggestions: a vendor says 12 bits are sufficient, while a clerk wants to store each serial as four-digit BCD. The cell must choose a storage medium for a second copy and settle the binary-field question before the records are sent to the district office.

1. Calculate the total size of the 2,400 scans, decide whether the pen drive can hold them together with the existing 300 MB, and explain the 2 GB versus 1.86 GB discrepancy. Which medium would you choose for the second copy?

Read the worked answer

Total scan size = 2,400 × 400 KB = 960,000 KB. Dividing by 1024 gives 937.5 MB, and adding the existing 300 MB gives 1,237.5 MB, which is about 1.21 GiB. The label uses decimal units: 2 GB = 2,000,000,000 bytes ≈ 1.86 GiB. So the pen drive really has about 1.86 GiB, and after the scans and question papers it still has roughly 0.65 GiB free. The scans fit, but the margin is not large, so the drive should not be used for anything else. The 4.7 GB DVD-R is about 4.38 GiB, which comfortably holds the 1.21 GiB set. I would write the second copy to the DVD-R and keep the pen drive as the working copy, because the DVD gives an independent physical copy. Checking free space before copying avoids the common mistake of comparing a decimal label with a binary reading.

2. Test the vendor's claim that 12 bits can store every serial from 0000 to 9999. State the minimum field width, then convert serial 2025 to binary and hexadecimal.

Read the worked answer

A 12-bit field has 2^12 = 4,096 patterns, numbered 0 to 4,095, so it cannot represent 9,999. The next power of two is 2^14 = 16,384, so 14 bits are needed; 13 bits give only 8,192 values. The vendor is wrong. For 2025, subtract the largest powers of two: 2025 = 1024 + 512 + 256 + 128 + 64 + 32 + 8 + 1, so the bits from 2^10 down to 2^0 are 11111101001. Grouping from the right into fours gives 0111 1110 1001, which is 7E9 in hexadecimal. Hexadecimal is convenient because each hex digit maps exactly to four binary bits, so a clerk can read or transcribe the code with far less chance of error than with a long binary string.

3. A clerk proposes storing all 2,400 serial numbers as four-digit BCD instead of pure binary. Compare the two representations for this range and recommend one, giving a reason.

Read the worked answer

In four-digit BCD each decimal digit uses four bits, so every serial takes 4 × 4 = 16 bits regardless of its value. Pure binary needs 14 bits for the full range 0000–9999, because 2^13 is only 8,192. For 2,400 serials, BCD would use 2,400 × 16 = 38,400 bits, while 14-bit binary would use 33,600 bits, so BCD costs about 14% more space. BCD is easier for humans to read and for simple seven-segment displays, since each digit is stored separately. Pure binary is more compact and is the natural form for arithmetic and for computer storage. For an exam cell that mainly stores and prints codes, the space difference is small, but the fixed-width binary field is the better technical choice because it stores every value from 0000 to 9999 without wasting a whole extra digit position.