22
1 CSE370, Lecture 5 Lecture 5 Logistics HW1 due today HW2 available today, due Wed 1/21 Office Hours this week: Me: Friday 10:00-11:00 CSE 668 TA (Josh): Friday 3:30 CSE 002/3 Last lecture Logic gates and truth tables Implementing logic functions Canonical forms Today’s lecture Converting to use NAND and NOR Minimizing functions using Boolean cubes

Lecture 5

  • Upload
    hedya

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

Lecture 5. Logistics HW1 due today HW2 available today, due Wed 1/21 Office Hours this week: Me: Friday 10:00-11:00 CSE 668 TA (Josh): Friday 3:30 CSE 002/3 Last lecture Logic gates and truth tables Implementing logic functions Canonical forms Today’s lecture - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture 5

1CSE370, Lecture 5

Lecture 5

Logistics HW1 due today HW2 available today, due Wed 1/21 Office Hours this week:

Me: Friday 10:00-11:00 CSE 668 TA (Josh): Friday 3:30 CSE 002/3

Last lecture Logic gates and truth tables Implementing logic functions Canonical forms

Today’s lecture Converting to use NAND and NOR Minimizing functions using Boolean cubes

Page 2: Lecture 5

2CSE370, Lecture 5

The “WHY” slide

Converting to use NAND and NOR NAND and NOR are more efficient gates than AND or OR (and

therefore more common). Your computer is built almost exclusively on NAND and NOR gates. It is good to knowhow to convert any logic circuits to a NAND/NOR circuit.

Pushing bubbles It is always good to remember logical/theoretical

concepts visually. This is one way to remember the NAND/NOR conversion and De Morgan’s laws easily.

Logic Simplification If you are building a computer or a cool gadget, you want to

optimize on size and efficiency. Having extra unnecessary operations/gates is not great. We teach nice techniques to allow logic simplifications.

Page 3: Lecture 5

3CSE370, Lecture 5

NAND/NOR more common/efficient

CMOS logic gates are more common and efficient in the inverted forms NAND, NOR, NOT Even though Canonical forms discussed so far used AND/OR, NAND/NOR preferred

for real hardware implementation

X Y Z0 0 10 1 11 0 11 1 0

XY Z

XY Z

Page 4: Lecture 5

4CSE370, Lecture 5

CMOS NAND and NOR Gates

NAND

NOR

Page 5: Lecture 5

5CSE370, Lecture 5

(X + Y)' = X' • Y'NOR is equivalent to AND with inputs complemented

(X • Y)' = X' + Y'NAND is equivalent to OR with inputs complemented

X Y X' Y' (X + Y)' X' • Y'0 0 1 1 1 10 1 1 0 0 01 0 0 1 0 01 1 0 0 0 0

X Y X' Y' (X • Y)' X' + Y'0 0 1 1 1 10 1 1 0 1 11 0 0 1 1 11 1 0 0 0 0

NAND and NOR (truth table)

Page 6: Lecture 5

6CSE370, Lecture 5

NAND and NOR (logic gates)

de Morgan's Standard form: A'B' = (A + B)' A' + B' = (AB)' Inverted: A + B = (A'B')' (AB) = (A' + B')'

AND with complemented inputs NOR OR with complemented inputs NAND OR NAND with complemented inputs AND NOR with complemented inputs

NAND

OR AND

NOR

pushing

the bubble

NAND

OR AND

NOR

Page 7: Lecture 5

7CSE370, Lecture 5

Converting to use NAND/NOR

Introduce inversions ("bubbles") Introduce bubbles in pairs

Conserve inversions Do not alter logic function

Example AND/OR to NAND/NAND

A

B

C

D

Z

A

B

C

D

Z

NAND

NAND

NAND

Z = AB + CD

= (A'+B')'+(C'+D')'

= [(A'+B')(C'+D')]'

= [(AB)'(CD)']'

Page 8: Lecture 5

8CSE370, Lecture 5

Converting to use NAND/NOR (con’t)

Example: AND/OR network to NOR/NOR

Z = AB+CD

= (A'+B')'+(C'+D')’

= [(A'+B')'+(C'+D')’]’’

= {[(A'+B')'+(C'+D')']'}'

A

B

C

D

Z

A’

B’

C’

D’

ZNOR

NOR

NOR

Page 9: Lecture 5

9CSE370, Lecture 5

Converting to use NAND/NOR (con’t)

Example: AND/OR network to NOR/NOR

Z = AB+CD

= (A'+B')'+(C'+D')’

= [(A'+B')'+(C'+D')’]’’

= {[(A'+B')'+(C'+D')']'}'

A

B

C

D

Z

A

B

C

D

ZNOR

NOR

NOR

Page 10: Lecture 5

10CSE370, Lecture 5

Converting to use NAND/NOR (con’t)

Example: OR/AND to NAND/NAND

A

B

C

D

Z Z

A’

B’

C’

D’

NAND

NAND

NAND

Page 11: Lecture 5

11CSE370, Lecture 5

Converting to use NAND/NOR (con’t)

Example: OR/AND to NAND/NAND

A

B

C

D

Z Z

A

B

C

D

NAND

NAND

NAND

Page 12: Lecture 5

12CSE370, Lecture 5

Converting to use NAND/NOR(con’t)

Example: OR/AND to NOR/NOR

A

B

C

D

Z Z

A

B

C

D

NOR

NOR

NOR

Page 13: Lecture 5

13CSE370, Lecture 5

Example of bubble pushing: before pushing

Page 14: Lecture 5

14CSE370, Lecture 5

Example of bubble pushing: NAND/NAND

Page 15: Lecture 5

15CSE370, Lecture 5

Example of bubble pushing: NOR/NOR

Page 16: Lecture 5

16CSE370, Lecture 5

Goal: Minimize two-level logic expression Algebraic simplification

not an systematic procedure hard to know when we reached the minimum

Just program it!! Computer-aided design tools require very long computation times (NP hard) heuristic methods employed – "educated

guesses”

Visualization methods are useful our brain is good at figuring simple things out many real-world problems are solvable by hand

Page 17: Lecture 5

17CSE370, Lecture 5

Key tool: The Uniting Theorem

The uniting theorem A(B’+B) = A

The approach: Find some variables don’t change (the A’s above) and

others do (the B’s above) Eliminate the changing variables (the B’s)

A B F0 0 10 1 11 0 01 1 0

A has the same value in both “on-set” rows keep A

B has a different value in the two rows  eliminate B

F = A'B'+A'B = A'(B+B') = A'

Page 18: Lecture 5

18CSE370, Lecture 5

Boolean cubes

Visualization tool for the uniting theorem n input variables = n-dimensional "cube"

1-cube 2-cube

3-cube4-cube

X

X

Y

X

Y Z W

X

Y Z

0 111

00

01

10

000

111

0000

1111

1000

0111

101

100

011

0100

0010

0011

1100

1011

Page 19: Lecture 5

19CSE370, Lecture 5

Mapping truth tables onto Boolean cubes ON set = solid nodes

OFF set = empty nodes

A

B

00

01

F11

10

Look for on-set adjacent to each other

Sub-cube (a line) comprises two nodes

A varies within the sub-cube;B does not

This sub-cube represents B'

A B F0 0 10 1 01 0 11 1 0

Page 20: Lecture 5

20CSE370, Lecture 5

Example using Boolean cube

Binary full-adder carry-out logic

On-set is covered by the OR of three 1-subcubes

A B Cin Cout0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 01 0 1 11 1 0 11 1 1 1

111

A

BCin

000

101

Cout = BCin+AB+ACin

(A'+A)BCin

AB(Cin'+Cin)

A(B+B')Cin

Page 21: Lecture 5

21CSE370, Lecture 5

Another example using Boolean cube

Changed one bit from the previous function

On-set is covered by the OR of one 2-D subcubes and one 3-D subcubes

A B Cin D0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 01 0 1 11 1 0 11 1 1 1

111

A

BCin

000

101

D = BCin+A

(A'+A)BCin

A(B+B')(Cin+Cin‘)

1

Page 22: Lecture 5

22CSE370, Lecture 5

M-dimensional cubes in n-dimensional space In a 3-cube (three variables):

A 0-cube (a single node) yields a term in 3 literals A 1-cube (a line of two nodes) yields a term in 2 literals A 2-cube (a plane of four nodes) yields a term in 1 literal A 3-cube (a cube of eight nodes) yields a constant term "1"

F(A,B,C) = m(4,5,6,7)

On-set forms a square (a 2-D cube)

A is asserted (true) and unchangingB and C vary

This sub-cube represents the literal A

A

B C

000

111

101

100

011

010110