2 Digital Logic
Learn how Boolean algebra represents binary logic, how logic gates implement its operations, and how truth tables guide the design of combinational circuits such as a half adder.
Representing binary logic
Digital logic uses two values, and , to represent false and true. provides rules for combining these values and describing how inputs determine an output. In circuit notation, NOT may be written or , AND as or , and inclusive OR as or .
Several identities make expressions easier to simplify:
and .
and .
and .
For example, . The first term reduces to , while the second reduces to .
relate complements to AND and OR:
These identities can simplify a Boolean expression before it is implemented as a circuit.
Gates and truth tables
A implements one Boolean operation. A describes the gate by listing its output for every possible input combination. With binary inputs, the table has input combinations.
For two inputs, the rows give these outputs, in the same order:
AND: . It outputs only when both inputs are .
OR: . It outputs when at least one input is .
XOR: . It outputs when the inputs differ.
NAND: . It is the complement of AND.
NOR: . It is the complement of OR.
XNOR: . It outputs when the inputs match.
A NOT gate has one input and reverses it: becomes , and becomes . These operations can be combined to implement more complex Boolean functions.
From behavior to a circuit
A connects logic gates so that its outputs depend only on the current inputs. Because it has no dependence on earlier inputs or stored state, its behavior can be specified with a Boolean expression or a .
A practical design sequence is:
Identify the inputs and the required output or outputs.
List the output for each possible input combination in a .
Derive a Boolean expression for each output.
Connect gates to implement the expressions.
The is the bridge between a circuit’s required behavior and its Boolean equations. Gate-level design then turns those equations into an implementation.
Example: the
A adds two one-bit inputs, and , and produces a sum bit, , and a carry bit, . For input pairs , the corresponding sum values are , and the carry values are .
The sum is precisely when the inputs differ, so . The carry is only when both inputs are , so . Thus, a can be implemented with one XOR gate and one AND gate.
The example follows the full design sequence: specify the input-output behavior, express each output with , and implement the expressions using gates. The key distinction is that the sum and carry are separate outputs, each with its own Boolean expression.