From aligned memory to packed records

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

1

Reading

4

4

Sensor code

2

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.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Data Formats and Internal Representations Questions: