A sensor program stores records in memory using the following field order. Each record begins at an address divisible by 4, and offsets are measured in bytes from that record's start.
Here, alignment requires a field's starting offset to be divisible by its stated boundary. Place each field at the earliest permitted offset after the preceding field, inserting padding when necessary.
Field
Stored size (bytes)
Alignment boundary (bytes)
Status
1
Reading
4
Sensor code
2
After placing all fields, add the minimum trailing padding needed to make the complete record size divisible by 4. Records in an array occupy consecutive complete record slots.
For export, the program writes the same field bytes in the same order but omits all padding. The export has no header or additional bytes.
Find the reading's starting offset, the complete size of one memory record, and the total number of padding bytes omitted when 90 records are exported. Give all three answers in bytes as exact integers.
Unlock full course notes by signing up
When packing starts to save space
An instrument can store records in text at 14 bytes per record with no header, or in a packed format at 8 bytes per record with a 300-byte header per file. Both preserve all required information, and neither has other storage overhead. What is the smallest number of records in one file for which the packed format uses strictly fewer bytes? Answer in records, as an integer with zero decimal places.
Storage savings and decoding time
An application downloads one dataset before displaying it. The raw format is 8 MB and needs no decoding time. A lossless packed format is 3 MB and needs 1.0 s to decode after the entire download finishes. Both recover the same data. The transfer rate is a constant 2 MB/s, and all other delays are negligible. Only these two formats are available.
Calculate each format's total time until the data are ready, in seconds to one decimal place. Then enter raw or packed for the format that meets a 3.0 s readiness limit.
Characters and stored bytes
A text export tool offers UTF-8 and UTF-16. The encoded size of a string is the number of bytes produced by its character encoding.
Use these rules for the strings in the table:
Each ordinary Latin letter occupies 1 byte in UTF-8.
Preserving meaning across systems
A laboratory exchanges measurement files between two different computer systems. Every value is an exact multiple of 0.01 mg within the supported range of every candidate format. Identifiers contain digits with significant leading zeros and varying lengths. The receiving system must recover identifiers exactly and values exactly in mg. Both systems support the stated text and packed encodings. Which proposals satisfy these requirements? Select all that apply.