Ch 1. Number Systems
Ch 1. Case Study
Designing a Smart Home Energy Monitor
A startup is developing a smart home energy-monitoring system that tracks electricity usage in real time. The system collects data from multiple sensors installed in appliances and transmits it to a central hub for processing and display. To ensure efficient data transmission, storage, and analysis, the development team must choose appropriate number systems and data types.
Each sensor sends the following data every second:
-
- Device ID: A unique identifier for each appliance (e.g.,
0x1A,0x2F) - Power usage: A real number in watts (e.g., 123.7 W)
- Status: A Boolean indicating whether the device is on or off
- Timestamp: A binary-encoded time value
- Device ID: A unique identifier for each appliance (e.g.,
Task 1
For each sensor data type (Device ID, Power usage, Status, Timestamp), decide which mathematical data type to use and explain the advantages of your choice.
A sensor reports the following:
- Device ID:
2F16 - Power usage: 78.5 watts
- Status: true
- Timestamp:
0001111010110010₂
Task 2
For each sensor data type, explain what the central hub must do with the data. For example, the central hub must convert the hexadecimal ID 2F16 to binary (determine the conversion yourself) for internal processing.
Using hexadecimal and binary reduces the size of transmitted packets, which is critical for low-power wireless communication. Floating-point representation ensures accurate energy readings, and Boolean values simplify automation logic (e.g., turning off idle devices). Understanding how to convert between number systems and choose the right data types is essential for building efficient, reliable digital systems.
Task 3
Answer the following questions:
- Why is hexadecimal preferred over decimal for representing device IDs in this system?
- What are the trade-offs of using floating-point numbers for power usage?
- How does binary encoding of timestamps improve performance?
- What would happen if the system used strings instead of binary or hexadecimal for data transmission?