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, 00 and 11, 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 ¬A\neg A or A′A', AND as A∧BA \land B or ABAB, and inclusive OR as A∨BA \lor B or A+BA+B.

Several identities make expressions easier to simplify:

  • A+0=AA+0=A and A∧1=AA\land 1=A.

  • A+A=AA+A=A and A∧A=AA\land A=A.

  • A+A′=1A+A'=1 and A∧A′=0A\land A'=0.

For example, (A∧1)+(A∧0)=A+0=A(A\land 1)+(A\land 0)=A+0=A. The first term reduces to AA, while the second reduces to 00.

relate complements to AND and OR:

¬(A∧B)=¬A∨¬B\neg(A\land B)=\neg A\lor\neg B
¬(A∨B)=¬A∧¬B\neg(A\lor B)=\neg A\land\neg B

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 nn binary inputs, the table has 2n2^n input combinations.

For two inputs, the rows (A,B)=(0,0),(0,1),(1,0),(1,1)(A,B)=(0,0),(0,1),(1,0),(1,1) give these outputs, in the same order:

  • AND: 0,0,0,10,0,0,1. It outputs 11 only when both inputs are 11.

  • OR: 0,1,1,10,1,1,1. It outputs 11 when at least one input is 11.

  • XOR: 0,1,1,00,1,1,0. It outputs 11 when the inputs differ.

  • NAND: 1,1,1,01,1,1,0. It is the complement of AND.

  • NOR: 1,0,0,01,0,0,0. It is the complement of OR.

  • XNOR: 1,0,0,11,0,0,1. It outputs 11 when the inputs match.

A NOT gate has one input and reverses it: 00 becomes 11, and 11 becomes 00. 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:

  1. Identify the inputs and the required output or outputs.

  2. List the output for each possible input combination in a .

  3. Derive a Boolean expression for each output.

  4. 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, AA and BB, and produces a sum bit, SS, and a carry bit, CC. For input pairs (A,B)=(0,0),(0,1),(1,0),(1,1)(A,B)=(0,0),(0,1),(1,0),(1,1), the corresponding sum values are 0,1,1,00,1,1,0, and the carry values are 0,0,0,10,0,0,1.

The sum is 11 precisely when the inputs differ, so S=A⊕BS=A\oplus B. The carry is 11 only when both inputs are 11, so C=A∧BC=A\land B. 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.