### Lecture 2: Combinational Logic Design, cont'd

#### Canonical forms and PLAs  (Text, Appendix B.3)

How can we systematically design a circuit given a truth table?
• sum-of-products representation
• universality of this representation (as shown by conversion from truth table)
• reflected in PLAs (programmable logic arrays) as universal logic elements
How many types of gates do we need?
• sum of products form means AND, OR, and NOT gates together are sufficient
• can build AND from OR and NOT, or OR from AND and NOT (DeMorgan's theorems), so two gate types (AND + NOT, or OR + NOT) are sufficient
• can we build everything from just one (universal) gate type? (your challenge in Assignment 1)

#### Propagation delay (note: not covered in text)

• delay of individual transistor -- how fast it can switch -- determined by physical factors (e.g., size); now below 100 ps
• speed of transistor determines speed of gate
• the propagation delay (speed) of a combinatorial circuit is the length of time from the moment when all input signals are stable until the moment when all outputs have stabilized
• propagation delay of a combinatorial circuit can be determined as longest path (in number of gates) from any input to any output

#### Fan-in (note: not covered in text)

• sum-of-products form suggests any combinatorial function can be computed in 3 gate delays (one delay for inverters, one for ANDs, one for OR
• but gates are limited in their fan-in (number of inputs a gate has)
• so, for example, if fan-in is f, it takes log (base f) n gate delays to OR or AND together n inputs

#### Ripple carry adder (text, section 4.5, p. 232-235)

• simplest n-bit binary adder connects together n full adders, feeding Cout of bit k into Cin of bit k+1 (where low order bit is bit 0)
• delay is approximately n * delay(Cin,Cout) of full adder

#### Representing signed numbers (text, section 4.2)

• negative numbers generally represented in two's complement
• computing the two's complement:  flipping each bit and adding 1
• doing subtraction by adding the two's complement

#### Circuit simulation

• importance of simulating designs before they are built
• tooling up to build a new VLSI circuit is very expensive

• (low cost is obtained by making a large number of a single design)
• hard to debug a circuit once it is built
• distributing a chip (processor) with a bug can cause huge problems
• special purpose simulators ... operate from logic diagrams or special languages (VHDL)
• alternative: write programs (in Java, C, C++, ...) which mimic the operation of circuits
• we provide the core of a Java simulator

#### Combinational vs. sequential circuits

• in a combinational circuit, output (after some delay) is a function of inputs
• in contrast, a sequential circuit holds state information: the output is a function of the state of the device, as well as its inputs;
• in other words, sequential circuits have memory