Docsity

Boolean Logic and Logic Gates: From Boolean Algebra to Digital Circuits, Slides of Computer Science

Partial preview of the text

Download Boolean Logic and Logic Gates: From Boolean Algebra to Digital Circuits and more Slides Computer Science in PDF only on Docsity!

Digital Logic

Boolean Algebra to Logic Gates

  • Logic circuits are built from components called

logic gates.

  • The logic gates correspond to Boolean operations
  • Binary operations have two inputs, unary has one
OR
AND
NOT
A
B
A+B

Logic Gate:

Parallel Circuit:

A
B
A B A+B

A+B Truth Table:

OR

NOT

A

A’ or A

Logic Gate: (also called an inverter)

Single-throw Double-pole Switch:

A

a A 0 1 1 0

Truth Table:

A’ or A

n -bit Inputs

  • For convenience, it is sometimes useful to think

of the logic gates processing n -bits at a time. This

really refers to n instances of the logic gate, not a

single logic date with n -inputs.

Logic Circuits ≡ Boolean Expressions

  • All logic circuits are equivalent to Boolean expressions and any boolean expression can be rendered as a logic circuit.
  • AND-OR logic circuits are equivalent to sum-of-products form.
  • Consider the following circuits:

A

C

B abc

aBc

Ab y=abc+aBc+Ab

y

A
B
C
Y

y=aB+Bc

XOR and XNOR Gates

• XOR is used to choose between two mutually

exclusive inputs. Unlike OR, XOR is true only

when one input or the other is true, not both.

XOR
XNOR

A B AB 0 0 0 0 1 1 1 0 1 1 1 0 A B A B 0 0 1 0 1 0 1 0 0 1 1 1

Properties of NAND AND NOR

• NAND and NOR have special properties, but

neither satisfies the distributive or associative

laws.

NAND NOR

x1=X x0=X x  0=1 x  1= x  x=X x  x=X x  y=X+Y x  y=XY X  Y=x+y X  Y=xy not (x  y)=xy not (x  y)=x+y

It should be clear by looking at these properties that NAND and NOR are duals.

NAND and NOR as Universal Logic Gates (cont)

  • Here are the NOR

equivalents:

  • NAND and NOR

can be used to reduce the number of required gates in a circuit.

Example Problem

• A hall light is controlled by two light switches, one

at each end. Find (a) a truth function, (b) a

Boolean expression, and (c) a logic network that

allows the light to be switched on or off by either

switch.

x y f(x,y) 0 0 0 0 1 1 1 0 1 1 1 0

(What kind of gate has this truth table?

Let x and y be the switches: