19
Chapter 1 The Logic of Compound Statements

Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Embed Size (px)

Citation preview

Page 1: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Chapter 1

The Logic of Compound Statements

Page 2: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Section 1.4

Digital Logic Circuits

Page 3: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Digital Circuits

• Electrical circuits can be fashioned to mimic logic tables.

• Types of switches:– open– closed

• Types of circuits:– series – parallel

Page 4: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Switching Table

• Switches in series

– closed/on => T– open/off => F

P Q State

closed closed on

closed open off

open closed off

open open off

P Q State

T T T

T F F

F T F

F F F

Page 5: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Switching Table

• Switches in parallel

– closed/on => T– open/off => F

P Q State

T T T

T F T

F T T

F F F

P Q State

closed closed on

closed open on

open closed on

open open off

Page 6: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Basic Digital Logic Gates

Page 7: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Combinational Circuits

• Combinational circuits are composed of one or more basic gates where the output of the circuit is based on the input at that instant in time.

• Rules of Combinational Circuits– Never combine two input wires.– A single input wire can be split and used as input for two separate

gates.– An output wire can be used as input.– No output of a gate can feedback into that gate.

• Sequential circuits are circuits that include feedback. Their output depends on previous input. These circuits are used to build circuits that can remember (memory circuits).

Page 8: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Example

Page 9: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Input-Output Table

• Input-output table is a truth table for a combinational circuit. It shows the output of the circuit given a set of inputs.

Input Output

P Q R

0 0 X

0 1 X

1 0 X

1 1 X

Page 10: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Example

Input Output

P Q R

0 0 0

0 1 1

1 0 1

1 1 0

P v Q

P ^ Q~(P ^ Q)

(P v Q) ^ ~(P ^ Q)

Page 11: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Boolean

• A combinational circuit can be expressed as a Boolean expression.

• George Boolean was an English mathematician who founded symbolic logic.

• Boolean variable is a variable that has only two possible values (T/F, on/off, 1/0).

• Boolean expression is composed of Boolean variables and connectives (~, v, ^ )

Page 12: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Boolean Expression Circuits

• A Boolean expression can be converted to a combinational digital logic circuit by using the Boolean variables as inputs and matching the connectives (~, v, ^) with their gate equivalent (NOT, OR, AND).

• Example– (~P ^ Q) v ~Q

Page 13: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Circuit from I/O Table

• A circuit can be constructed from any I/O table.

• A circuit constructed in this form will be composed of a set of AND gates connected by OR gates. R^S v ~R^S v R^~S

Page 14: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Example

1^1^1 v 1^0^1 v 1^0^0

P^Q^R v P^~Q^R v P^~Q^~R

Page 15: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Equivalent Circuits

• Two circuits are equivalent if there I/O tables are equivalent.

• As with logic expressions, digital circuits may be simplified through logic theorem 1.1.1, aka Boolean Algebra.

Page 16: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

Example

• ((P ^ ~Q) V (P ^ Q)) ^ Q– (P ^ (~Q V Q)) ^ Q (distributive)– (P ^ (Q v ~Q)) ^ Q (commutative)– (P ^ t) ^ Q (negation)– P ^ Q (identity)

• Inspection of the I/O table reveals the simplified circuit.

Page 17: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

NAND and NOR Gates

• NAND or NOR gates can be used to simplify a circuit as they are primitive gates, i.e. all gates can be built from them. (NOT, AND, OR, XOR, etc.)

Page 18: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

NAND and NOR

• NAND – logic symbol is (Sheffer Stroke) |– P|Q ~(P ^ Q)

• NOR– logic symbol is (Peirce Arrow) – PQ ~(P v Q)

Page 19: Chapter 1 The Logic of Compound Statements. Section 1.4 Digital Logic Circuits

NAND (Sheffer Stroke) Example

• Show that the Sheffer Stroke (NAND) can be used to implement ~ (NOT)– ~P P | P– ~P ~(P ^ P) (idempotent)– P | P (definition of |)