Logic Gates A logic gate is an elementary building block of a digital circuit Most logic gates have...

Preview:

Citation preview

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).

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.

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' .

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.

Relay logic equivalent

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.

Relay logic equivalent

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.

Relay logic equivalent

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.

Relay logic equivalent

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.

Relay logic equivalent

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.

• 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

Exercise 1

What is the truth table for this circuit?

What is the truth table for this circuit?

COFFEE MACHINE

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.

Resetting the NAND Latch

Nor Flip Flop

Recommended