Number Systems and Boolean Algebra
Move fluently between binary, hex and decimal including signed and fixed-point representations, and simplify logic expressions algebraically and with Karnaugh maps.
Two ways in. Work the material, or if you already know this, go straight to the project and prove it.
Where this sits
- Prerequisites
- None. This is an entry point.
- Unlocks
- Combinational Logic Design
- Used by tracks
- Digital PCB DesignerEmbedded Hardware Prototyper
How this skill is structured
- 1. Concepts — the ideas stated plainly, with the equations worth memorising.
- 2. Worked example — one real problem solved end to end, numbers included.
- 3. Tool demonstration — do the thing in a real open-source tool.
- 4. Resources — the specific free readings and videos, and what part of each to use.
- 5. Project — built alone, producing something a reviewer can check.
- 6. Competence checklist — what you must be able to do. This is also the audit rubric.
1. Concepts
Read these first. Tick each one when you could explain it to someone else without notes.
2. Worked example
From a specification to a minimised NAND-only implementation
ProblemA safety interlock must assert an ENABLE output when: the door is closed (D=1) AND at least two of three sensors (S1, S2, S3) read healthy. Derive minimal logic and convert to NAND-only.
- 1Build the truth table for the 'two of three' majority function M(S1,S2,S3). Output is 1 for the rows 011, 101, 110, 111 — that is 4 of the 8 rows.
- 2Sum of products (canonical): M = !S1.S2.S3 + S1.!S2.S3 + S1.S2.!S3 + S1.S2.S3.
- 3K-map the three variables. The four 1-cells group into three overlapping pairs: (S1.S2), (S1.S3), (S2.S3). Each pair covers the 111 cell, which is why they overlap.
- 4Minimised: M = S1.S2 + S1.S3 + S2.S3. Three 2-input ANDs and one 3-input OR, down from four 3-input ANDs and a 4-input OR.
- 5Add the door term: ENABLE = D . M = D . (S1.S2 + S1.S3 + S2.S3).
- 6Convert to NAND-only. Start with the OR of ANDs. By De Morgan, A + B + C = !(!A . !B . !C), so an OR of terms is a NAND of the inverted terms.
- 7Each AND term becomes a NAND followed by an inverter; but the inverter is cancelled by the De Morgan conversion of the OR. So: M = NAND( NAND(S1,S2), NAND(S1,S3), NAND(S2,S3) ). Three 2-input NANDs feeding one 3-input NAND.
- 8Final ENABLE = D AND M = NAND(NAND(D, M), NAND(D, M)) — a NAND used as an inverter on a NAND. Or more cleanly, fold D into the structure.
- 9Sanity check: put S1=1, S2=1, S3=0, D=1 through the NAND network by hand. NAND(1,1)=0, NAND(1,0)=1, NAND(1,0)=1. NAND(0,1,1)=1. M=1. With D=1, ENABLE=1. Correct.
- 10Safety note: for a real interlock, consider what happens on a broken wire. If a broken sensor wire floats high, this design fails dangerous. Active-low sensor signals with pull-downs would fail safe. Logic minimisation does not excuse you from thinking about failure modes.
AnswerENABLE = D . (S1.S2 + S1.S3 + S2.S3), implemented as four NAND gates for the majority function plus a NAND-inverter pair for the door term. And the fail-safe polarity question matters more than the gate count.
3. Tool demonstration
Build the interlock circuit, verify it against a generated truth table, and let the tool minimise it for you so you can check your own work.
4. Resources
Free and, wherever possible, openly licensed. The note tells you which part to actually use — do not read them cover to cover.
5. Project — build this on your own
About 2.5 hours. This is the artifact that proves the skill. Work it without a walkthrough.
Specify, minimise, implement and machine-verify a piece of real control logic: a 4-input priority encoder with an enable, or an equivalent function of your choosing with at least four inputs and two outputs.
Deliverables
Acceptance criteria — how you know it is good enough
If you want to push further
- Add a 4-bit two's complement adder/subtractor to the design and verify overflow detection with test vectors at the boundary values.
- Implement the same function using only a 16x1 lookup ROM and compare the resource cost and the timing to the gate implementation.
6. Competence checklist
Tick these honestly. If you are auditing this skill, this is your rubric — you should be able to demonstrate every line from the project you just built.