Ch 2. Internal Data Representation of Characters, Integers, Real Numbers
Ch 2. Case Study
Developing a Vehicle Telemetry System for Electric Cars
The scenario is that an automotive company is developing a vehicle-telemetry system for its new line of electric cars. The system collects and transmits real-time data from various sensors to a central processing unit (CPU) and to cloud servers for diagnostics, performance monitoring, and predictive maintenance.
Each vehicle must continuously transmit the following data:
- Vehicle ID: A unique identifier for each car
- Speed: A real number in km/h
- Battery Level: A percentage (0 to 100%)
- Motor Temperature: A real number in degrees Celsius
- Timestamp: Time of data capture
- Status Flags: A set of Boolean indicators (e.g., charging, overheating, low battery)
Task 1
For each data type (Vehicle ID, Speed, Battery Level, Motor Temperature, Timestamp, Status Flags), decide how to represent the data and provide reasoning.
Task 2
Provide solutions to the following challenges:
- Speed or temperature values exceeding expected ranges may cause overflow.
- Very small temperature changes (e.g., 0.00001°C) may underflow in single-precision.
- Misinterpreting Vehicle ID as ASCII instead of UTF-8 could corrupt logs.
- Misinterpreting status flags due to bit-shift errors.
Task 3
Provide four real-world applications in which the telemetry data is used.