logic gates a logic gate is an elementary building block of a digital circuit most logic gates have...

36

Upload: brian-meller

Post on 31-Mar-2015

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 2: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Logic Gates

• A logic gate is an elementary building block of a digital circuit

• Most logic gates have two inputs and one output• At any given moment, every terminal is in one of the

two binary conditions low (0) or high (1) represented by different voltage levels

• The logic state of a terminal can, and generally does, change often, as the circuit processes data

• In most logic gates, the low state is approximately zero volts (0 V)

• while the high state is approximately five volts positive (+5 V).

Page 3: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Truth Tables • A truth table shows how a logic circuit's output

responds to various combinations of the inputs• using logic 1 for true and logic 0 for false. • All permutations of the inputs are listed on the left• output of the circuit is listed on the right• The desired output can be achieved by a

combination of logic gates• A truth table for two inputs is shown, but it can be

extended to any number of inputs. • The input columns are usually constructed in the

order of binary counting with a number of bits equal to the number of inputs.

Page 4: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

NOT Gate or Inverter

• The output of a not gate is always opposite to it's input• An X with a vertical bar over it means 'NOT X' .

Page 5: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

AND gate

• An AND gate always has one output, but it can have many inputs (at least 2).

• The output is high only when both inputs A and B are high.

Page 6: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Relay logic equivalent

Page 7: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

OR gate• As with the AND gate, the OR gate has one output and

several inputs. X+Y is equivilent to X OR Y. The output is high when either or both of inputs A or B is high.

• Below we have pictured a 2-input OR gate.

Page 8: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Relay logic equivalent

Page 9: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

NAND gates• A NAND gate is equivalent to an AND gate followed by

a NOT gate. Notice that the bar stretches over all of the expression, to say that the whole thing is negated

• The output is high when either of inputs A or B is high, or if neither is high. In other words, it is normally high, going low only if both A and B are high.

Page 10: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Relay logic equivalent

Page 11: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

NOR gates • A NOR gate is an OR gate followed by a not gate. Notice

that the bar stretches over all of the expression, to say that the whole thing is negated

• The output is high only when neither A nor B is high. That is, it is normally high but any kind of non-zero input will take it low.

Page 12: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Relay logic equivalent

Page 13: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

EXOR gates• EXOR (or EXclusive OR) gives TRUE if either but not

both inputs are TRUE• Notice that the symbol for EXOR is + (as in OR) in a

circle• The output is high when either of inputs A or B is high,

but not if both A and B are high.

Page 14: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Relay logic equivalent

Page 15: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Negative Logic Gates

Each of the basic gates has a negative logicequivalent as shown. The equivalence is shownby the application of DeMorgan's theorem. Itamounts to changing AND's to OR's or viceversa and inverting all inputs.

Page 16: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

• A practical operational way to look at DeMorgan's Theorem is that the inversion bar of an expression may be broken at any point and the operation at that point replaced by its opposite (i.e., AND replaced by OR or vice versa

Page 17: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 18: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 19: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 20: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Exercise 1

What is the truth table for this circuit?

Page 21: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

What is the truth table for this circuit?

Page 22: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 23: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 24: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

COFFEE MACHINE

Page 25: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 26: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 27: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 28: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Setting the NAND Latch After being set to Q=1 by the low pulse at S (NAND

gate function), the restored normal value S=1 is consistent with the Q=1 state, so it is stable. Another negative pulse on S gives which does not switch the flip-flop, so it ignores further input.

Page 29: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Resetting the NAND Latch

Page 30: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every

Nor Flip Flop

Page 31: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 32: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 33: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 34: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 35: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every
Page 36: Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have two inputs and one output At any given moment, every