Digital logic, memory & state
Binary, Boolean logic & arithmetic
A bit is a symbol; a circuit decides which voltage represents it.
Binary uses place values that are powers of two; hexadecimal groups four bits into one digit. AND, OR and NOT form Boolean expressions, while XOR is useful in adders and comparisons. A truth table lists every input combination. Combining gates builds adders, multiplexers and decoders. A four-bit unsigned number ranges from 0 to 15, so arithmetic needs a plan for overflow.
Flip-flops, clocks & timing
Memory adds a “when” to digital logic.
Combinational logic depends on present inputs; sequential logic also remembers state. A D flip-flop samples D at its active clock edge and holds Q between edges. Setup time requires data to be stable before that edge; hold time requires stability after it. Violating either can cause metastability, a delayed and uncertain resolution. Synchronizers reduce the probability of a failure when crossing clock domains; they do not make it mathematically impossible.
State machines & dependable logic
Describe behavior before assembling a pile of conditions.
A finite-state machine has a current state, transition rules and outputs. Draw the states and conditions first, then implement them with logic or software. Moore outputs depend on state; Mealy outputs can also depend on current inputs. Reset behavior and recovery from invalid states deserve explicit decisions. FPGAs use hardware description languages to describe concurrent hardware, not a processor executing ordinary software line by line.