Digital Logic Design
Digital Health Monitoring System
Digital control logic for a remote patient-monitoring concept, from sensor inputs to status and urgent alerts.
Experience In Practice
Skills Applied
Technical Skills
Soft Skills
Turn Monitoring Rules Into Three Logic Blocks
The system concept supports patients recovering at home after hospital treatment. It combines pulse-oximeter, heart-rate, breathing-rate and temperature inputs to identify a Healthy, Observe, Alarm or Urgent status. The design challenge is to turn those monitoring rules into a clear digital control path.
I developed the three combinational blocks in sequence: decode a keypad-selected oxygen setpoint, compare it with the pulse-oximeter reading, then combine the result with the other sensor codes. This allowed each block to be derived and checked before becoming the next block’s input.
The user selects an oxygen setpoint between 90% and 99% by entering its units digit. The pulse oximeter supplies the measured units digit in BCD plus an independent U flag for oxygen below 90%. The complete system specification also calls for a seven-bit SEVEN output to a status display and a buzzer that is reset manually.
Follow The Complete Gate Network
These two sheets bring the separate gate drawings together into a complete view of the documented combinational logic. The first follows the keypad through BCD decoding and oxygen comparison; the second follows the encoded sensor inputs through the monitoring decisions and buzzer request.
Matching net labels represent connections between gates, and a small circle on a pin means inversion. In sheet 2, BR names the breathing-rate signals so they cannot be confused with the keypad’s BCD bits B3…B0. Open either vector sheet in a new tab to zoom into the gates without losing clarity.
Derive A Decimal Output From A Matrix Keypad
A 4 × 3 keypad identifies each key by an asserted row and column. I wrote the ten valid combinations first, then formed the BCD output bits by OR-ing together the key combinations that require a 1 in that bit position.
For example, the most significant BCD bit is high only for 8 and 9. Both are on row X3, in columns Y2 and Y3, so B3 = X3·(Y2 + Y3). The same method produces the other three output bits.
The keypad permits one valid key at a time; the two empty positions are excluded. The circuit includes an explicit zero-key mask: detecting X4·Y2 forces all four outputs low. My solution assumes the selected row and column remain asserted until the next key press, keeping input persistence at the keypad interface.
| Key | Row | Column | BCD B3 B2 B1 B0 |
|---|---|---|---|
| 0 | X4 | Y2 | 0000 |
| 1 | X1 | Y1 | 0001 |
| 2 | X1 | Y2 | 0010 |
| 3 | X1 | Y3 | 0011 |
| 4 | X2 | Y1 | 0100 |
| 5 | X2 | Y2 | 0101 |
| 6 | X2 | Y3 | 0110 |
| 7 | X3 | Y1 | 0111 |
| 8 | X3 | Y2 | 1000 |
| 9 | X3 | Y3 | 1001 |
Unlisted row/column combinations are outside the valid single-key input set.
B0 = X1·Y1 + X1·Y3 + X2·Y2 + X3·Y1 + X3·Y3
B1 = X1·Y2 + X1·Y3 + X2·Y3 + X3·Y1
B2 = X2·Y1 + X2·Y2 + X2·Y3 + X3·Y1
B3 = X3·Y2 + X3·Y3
G = ¬(X4·Y2); final output bit = Bi·G
Notation: · means AND, + means OR and ¬ means NOT.
Compare The Most Significant Difference First
The oxygen comparator takes A, the sensed oxygen units digit, and B, the selected setpoint digit. Equality at a bit position allows the comparison to continue to the next lower bit. The first unequal pair determines which number is larger.
I reused per-bit product terms across equality and magnitude comparisons, then encoded the result into the two bits expected by the alarm circuit. This avoids treating the four bit positions as equally significant.
For a 95% setpoint, a 97% reading produces 00, a 95% reading produces 01 and a 93% reading produces 11. The comparison of units digits applies within the 90–99% range; U separately identifies the below-90% condition.
| Reading A vs Setpoint B | OX1 OX0 | Meaning |
|---|---|---|
| A > B | 00 | Above the setpoint |
| A = B | 01 | Exactly at the setpoint |
| A < B | 11 | Below the setpoint |
Ei = ¬(Ai XOR Bi)
LT = ¬A3·B3 + E3·¬A2·B2 + E3·E2·¬A1·B1 + E3·E2·E1·¬A0·B0
EQ = E3·E2·E1·E0
OX1 = LT; OX0 = LT + EQ
Each equality term gates the next less-significant comparison. Equality uses XNOR: a bit pair must match.
Translate The Decision Table Into Gates
The heart-rate, breathing-rate and temperature sensors each supply two threshold flags. Bit 0 identifies a reading above the lower threshold, and bit 1 identifies a reading above the upper threshold. The valid codes are therefore 00, 01 and 11; 10 cannot occur under those nested threshold definitions.
I grouped the Healthy, Observe and Alarm conditions separately, built an AND term for each valid condition group, then OR-ed the terms into each output. Shared high-category, nonzero-category and middle-category signals reduce repeated logic.
These thresholds define this digital-design scenario. The table below shows how the encoded inputs map to outputs; each row is a sufficient condition. An input may match two Observe rows, but it still asserts only the single Observe output.
| Code | Heart Rate (beats/min) | Breathing Rate (breaths/min) | Temperature (°C) |
|---|---|---|---|
| 00 | ≤ 100 | ≤ 25 | ≤ 37.5 |
| 01 | > 100 and ≤ 120 | > 25 and ≤ 28 | > 37.5 and ≤ 38.5 |
| 11 | > 120 | > 28 | > 38.5 |
The sensor bits use strict “greater than” thresholds. A reading exactly at 100 beats/min, for example, remains in code 00; exactly 120 beats/min is code 01. The ranges above follow those bit definitions.
| Output | Oxygen vs Setpoint | Heart Code | Breathing Code | Temperature Code |
|---|---|---|---|---|
| Healthy | At / above | 00 or 01 | 00 or 01 | 00 |
| Healthy | At / above | 00 | 00 | 01 |
| Observe | At / above | 11 | 00 or 01 | 00 |
| Observe | At / above | 00 or 01 | 11 | 00 |
| Observe | At / above | Any valid | 01 | 01 |
| Observe | At / above | 01 | Any valid | 01 |
| Observe | At / above | 11 | 00 | 01 |
| Observe | At / above | 00 | 11 | 01 |
| Alarm | Below | Any valid | Any valid | Any valid |
| Alarm | At / above | 11 | 11 | Any valid |
| Alarm | At / above | Any valid | Any valid | 11 |
“Any valid” means 00, 01 or 11. “At / above” covers comparator outputs 00 and 01; “Below” is 11. These are the H/O/A decision conditions; the independent U flag supplies the urgent oxygen indication.
Connect Status Indication And Urgent Alerts
The buzzer request is the OR of Alarm and U. If the pulse oximeter asserts U for oxygen below 90%, the request is high regardless of the setpoint comparison, heart rate, breathing rate or temperature.
The specified seven-segment interface uses a seven-bit signal, SEVEN, to show H, O, A or U. This translates the decision outputs into a compact status indication, with U identifying the independent urgent oxygen condition.
The brief specifies manual reset for the buzzer. The retained solution shows the combinational request Z = Alarm + U; keeping the buzzer on until manual reset requires a separate state-holding element. The consolidated schematics show the documented gate network and identify the display and reset requirements at its interfaces.
| Symbol | Meaning | Trigger |
|---|---|---|
| H | Healthy | Healthy decision output is asserted |
| O | Observe | Observe decision output is asserted |
| A | Alarm | Alarm decision output is asserted |
| U | Urgent oxygen condition | U = 1: measured oxygen is below 90% |
SEVEN is a seven-bit segment-control interface. The retained gate drawings document the decision and buzzer logic; they do not provide a complete segment-decoder schematic.
Z = Alarm + U
Z is the combinational turn-on request shown in the solution. Manual-reset persistence is a system-level requirement.
Check The Logic Against Simulation
I used Verilog testbenches to drive the keypad and comparator circuits, then inspected their inputs and outputs in ISim. The retained waveforms connect the truth-table decisions to the simulated gate-level behaviour.
The comparator test sweeps 256 pairs of four-bit values. Of those, 100 pairs use valid decimal BCD digits from 0 to 9; the remaining pairs exercise the wider four-bit comparison logic.
The two consolidated gate sheets connect the truth-table derivations to the complete logic path. The slideshow also retains the keypad and comparator waveforms, input encoding and original decision table; individual gate close-ups remain available in the image library.
The Engineering Journey
Partition
Separate input decoding, magnitude comparison and monitoring decisions.
Derive
Turn valid input cases into Boolean expressions and shared gate signals.
Inspect
Use Verilog stimuli and ISim waveforms to trace the implemented behaviour.
What This Experience Achieved
The result
A documented three-block monitoring logic design, from keypad truth table to comparator and alarm gates, supported by keypad and comparator simulation evidence.
Technical decisions & tools
The design brief supplies already-encoded sensor values. Physical sensing and signal conditioning are outside the three combinational blocks shown.
The comparator equations follow its truth table. Per-bit equality is XNOR; LT means the measured units digit is less than the selected setpoint digit.
The sensor-bit definitions determine threshold boundaries: bit 0 is high above the lower threshold and bit 1 above the upper threshold. Only codes 00, 01 and 11 are valid.
The two consolidated SVG sheets are functional redraws of the retained gate logic. Shared net names connect the stages; BR labels identify breathing-rate signals to distinguish them from the BCD setpoint bits B3…B0.
The specified SEVEN display interface and manually reset buzzer are identified separately from the documented combinational gate network.











