What's changed: Initial version
2.6Hardware and Embedded Systems
Building on the FE/SG basics of logic circuits and flip-flops, this section digs deeper into the design of combinational circuits (half adders/full adders) and sequential circuits, and reading circuits from truth tables. It also covers practical design decisions for IoT devices (sensors/actuators), the responsiveness of a real-time OS (RTOS), and embedded-specific power-saving design (dynamic voltage and frequency scaling, etc.).
FE/SG asks you to distinguish combinational from sequential circuits. AP goes a step further, requiring the ability to read a concrete circuit (an adder) from its truth table, as well as an understanding of the practical requirements of real-time responsiveness and power efficiency that embedded systems cannot avoid.
2.6.1Half adders and full adders
| Input A | Input B | Carry-in (Cin) | Sum (S) | Carry-out (Cout) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
- A half adder is a combinational circuit that adds two 1-bit inputs and outputs a sum (S) and a carry (C). For inputs A and B, it is realized by the logic expressions S = A XOR B (exclusive OR) and C = A AND B. However, a half adder has the limitation that it cannot accept a carry-in from a lower digit, so it cannot be chained on its own to add numbers with multiple digits.
- A full adder resolves the half adder's limitation: it accepts two 1-bit inputs plus a carry-in (Cin) from a lower digit, producing a sum (S) and a carry-out (Cout) to the next digit. Chaining full adders for however many digits are needed (feeding each Cout into the next digit's Cin) builds a binary adder circuit for numbers of any length. The table above is a full adder's truth table (example S/Cout values for combinations of A, B, and Cin).
The staples: a half adder cannot accept a carry-in from a lower digit (S = XOR, C = AND); a full adder also accepts a carry-in (Cin), so it can be chained across multiple digits; chaining full adders builds a binary adder circuit for any number of digits. Questions asking you to read S/Cout values from a truth table, or to build a logic expression from combinations of AND/OR/XOR, also recur.
Let us verify a full adder's truth table with real numbers. Consider inputs A = 1, B = 1, and a carry-in from a lower digit Cin = 1. Adding these naively in binary: 1 + 1 + 1 = 3 (decimal) = 11 (binary). Binary "11" means the low digit is 1 and the high digit (the carry) is 1, so sum S = 1 and carry-out Cout = 1, matching the last row of the table above (A=1, B=1, Cin=1 gives S=1, Cout=1). Likewise, for A = 1, B = 1, Cin = 0: 1 + 1 + 0 = 2 (decimal) = 10 (binary), giving S = 0, Cout = 1. This match is not a coincidence—the full adder's logic expressions are designed precisely so that the sum of three 1-bit inputs is correctly represented as a 2-digit binary number (S and Cout). Building on this, an 8-bit binary adder can be realized by chaining 8 full adders, with each digit's Cout feeding into the next digit's Cin in sequence (the lowest digit either has its Cin fixed at 0, or uses a half adder instead). Turning to practical IoT device design, many embedded devices run on a real-time OS (RTOS). Whereas a general-purpose OS prioritizes "average throughput," an RTOS prioritizes guaranteeing that processing always completes within a set time (predictable response time) above all else. In automotive airbag control, for instance, "fast on average" is not sufficient for the input from a collision sensor—the requirement is that the actuator (the ignition device) must always fire within a specified time, even in the worst case—and the design philosophy that guarantees this is called hard real-time (use cases that can tolerate some delay are instead called soft real-time). For battery-powered IoT devices, power-saving design—cutting power to unused circuit blocks, or DVFS (Dynamic Voltage and Frequency Scaling), which dynamically lowers clock frequency and voltage according to processing load—becomes a key design factor governing operating time.
Trap: "a half adder can accept a carry-in from a lower digit, so it can build a multi-digit adder on its own" is wrong—only the full adder accepts a carry-in (Cin); the half adder lacks this capability and cannot be chained for multi-digit addition on its own. Also, "a real-time OS prioritizes the fastest average processing speed above all" is wrong—what an RTOS prioritizes above all is not average speed but the predictability of always completing processing within a set time. "DVFS only adjusts clock frequency and does not change voltage" is also wrong—DVFS dynamically adjusts both clock frequency and voltage according to load, as a power-saving technique.
2.6.2Section summary
- Half adder = cannot accept a carry-in from a lower digit (S = XOR, C = AND). Full adder = also accepts Cin and can be chained; chaining builds an adder for any number of digits
- Real-time OS (RTOS) prioritizes not average speed but the predictability of response time (hard real-time vs. soft real-time)
- DVFS dynamically adjusts both clock frequency and voltage based on load, as a power-saving technique. IoT devices consist of a sensor (input) plus an actuator (output)
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. Which circuit accepts two 1-bit inputs plus a carry-in from a lower digit, and outputs a sum and a carry to the next digit? Chaining this circuit builds a binary adder for any number of digits.
Q2. For a full adder with inputs A=1, B=0, and Cin=1, what are the resulting sum (S) and carry-out (Cout)?
Q3. Which design requirement demands that processing (firing the ignition device) always complete within a specified time, even in the worst case—as in automotive airbag control?

