logic design cs221 1 st term 2009-2010 logic-circuit implementation cairo university faculty of...

39
Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

Upload: richard-carson

Post on 04-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

Logic DesignCS221

1st Term 2009-2010

Logic-Circuit ImplementationLogic-Circuit Implementation

Cairo University

Faculty of Computers and Information

Page 2: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 2

Administrivia lab 2 is divided into two parts email subject must include the word CS221 homework 1 due today project ideas due next Saturday by email

Page 3: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 3

important concepts clock timing diagram counter datasheet

Page 4: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 4

K-map simplification a Boolean function is represented by a truth

table function value (0 or 1) at each combination of inputs

truth table => K-map K-map simplification

combining adjacent squares

Page 5: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 5

don't-care conditions in some Boolean functions, we do not care

whether the output is 0 or 1 for some input combinations

these don't-care conditions allow for simpler expressions

Example: conversion from BCD-code to excess-3 code how many inputs? how many outputs? truth table (next slide)

Page 6: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 6

don't-care conditions (contd.)

1 0 1 0 ? ? ? ?

1 0 1 1 ? ? ? ?

1 1 0 0 ? ? ? ?

1 0 1 0 X X X X

1 0 1 1 X X X X

1 1 0 0 X X X X

Page 7: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 7

don't-care conditions (contd.) K-map for z don't-care conditions can be treated as 1 or 0,

whichever gives a simpler expression

m12

, m14

, m10

: 1's

m13

, m15

, m11

: 0's

z = ?

Page 8: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 8

don't-care conditions (contd.) Example 2: F = ∑(1,3,7,11,15) with don't-care

minterms d = ∑(0,2,5)

F = w'x' + yz F = w'z' + yz=?

Page 9: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 9

Boolean function implementation convert Boolean function expression into logic

circuit Example: F = B'D' + B'C' + A'C'D

Page 10: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 10

AND-OR implementation any Boolean function can be represented using

only AND, OR, and NOT gates why?

sum-of-minterms and sum-of-product forms can be directly converted into two-level AND-OR implementation

Page 11: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 11

NAND implementation NAND gates are easy to fabricate

any Boolean function can be represented using only NAND gates

why? answer in the next 2 slides

Page 12: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 12

NAND implementation (contd.) AND, OR, and NOT gates can represented

using NAND gates

Page 13: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 13

NAND implementation (contd.) any Boolean function can be represented using

only AND, OR, and NOT gates AND, OR, and NOT gates can represented

using NAND gates Then? NAND is a universal gate.

Page 14: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 14

how to get a NAND implementation first, note that NAND gate can be:

start with AND-OR implementation insert pairs of bubbles (NOT gates) works with alternating levels of AND and OR

gates: AND-OR, AND-OR-AND-OR, etc.

Page 15: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 15

how to get a NAND implementation (contd.)

Page 16: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 16

how to get a NAND implementation (contd.)

Page 17: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 17

how to get a NAND implementation (contd.)

Page 18: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 18

how to get a NAND implementation (contd.)

combining 1's in a K-map gives: sum-of-products? product-of-sums?

?

?

Page 19: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 19

how to get a NAND implementation (contd.)

Boolean function in truth table, minterms, or algebraic form

represent the function in a K-map

simplify the K-map

convert the resulting SoP into AND-OR logic circuit

convert the AND-OR circuit into NAND circuit as described earlier (by inserting pairs of bubbles)

Page 20: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 20

NOR implementation NOR gates are easy to fabricate

any Boolean function can be represented using only NOR gates

why? answer in the next 2 slides

Page 21: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 21

NOR implementation (contd.) AND, OR, and NOT gates can represented

using NOR gates

Page 22: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 22

NOR implementation (contd.) any Boolean function can be represented using

only AND, OR, and NOT gates AND, OR, and NOT gates can represented

using NOR gates Then? NOR is a universal gate.

Page 23: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 23

how to get a NOR implementation first, note that NOR gate can be:

start with OR-AND implementation insert pairs of bubbles (NOT gates) works with alternating levels of AND and OR

gates: AND-OR, AND-OR-AND-OR, etc.

Page 24: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 24

how to get a NOR implementation (contd.)

Page 25: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 25

how to get a NAND implementation (contd.)

combining 1's in a K-map gives: sum-of-products? product-of-sums?

NAND

NOR

??

Page 26: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 26

product-of-sums from K-map simplify the function's complement (F') where are the squares of F'?

combine adjacent 0's get an algebraic form for F' get complement of F': (F')' = F how?

Page 27: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 27

product-of-sums from K-mapExample: simplify the following K-map in product-

of-sums form

F' = AB + CD + BD'

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

Page 28: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 28

NOR implementation

NOR

NOR??

Page 29: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 29

NOR implementation

Page 30: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 30

wired-and wiring of two NAND gates => AND no physical AND gate -> one-level => less

delay F = (AB)'.(CD)' = (AB + CD)' AND-OR-INVERT

Page 31: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 31

wired-or wiring of two NOR gates => OR no physical OR gate -> one-level => less delay F = (A+B)' + (C+D) = ((A+B) (C+D))' OR-AND-INVERT

Page 32: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 32

other two-level implementations how many two-level implementations from the

four gates: AND, OR, NAND, NOR?

AND-AND AND-OR AND-NAND AND-NOR

OR-AND OR-OR OR-NAND OR-NOR

NAND-AND NAND-OR NAND-NAND NAND-NOR

NOR-AND NOR-OR NOR-NAND NOR-NOR

Page 33: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 33

other two-level implementations 8 degenerate (AND-AND) : one operation 8 nondegenerate

AND-AND AND-OR AND-NAND AND-NOR

OR-AND OR-OR OR-NAND OR-NOR NAND-AND NAND-OR NAND-NAND NAND-NOR NOR-AND NOR-OR NOR-NAND NOR-NOR

which ones are duals? which ones are equivalent?

Page 34: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 34

AND-NOR, NAND-AND

how to get AND-NOR of a function? F' in sum-of-products (AND-OR) F in AND-NOR

Page 35: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 35

OR-NAND, NOR-OR

how to get OR-NAND of a function? F' in product-of-sums (OR-AND) F in OR-NAND

Page 36: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 36

xor implementationcan we simplify

this K-map?

note that the 1's are in the odd rows => XOR

Page 37: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 37

xor implementationcan we simplify

this K-map?

note that the 1's are in the odd rows => XOR

Page 38: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 38

parity xor gates are often used in parity generation

and checking truth table for even parity generation

Page 39: Logic Design CS221 1 st Term 2009-2010 Logic-Circuit Implementation Cairo University Faculty of Computers and Information

24/10/2009 cs221 – sherif khattab 39

parity xor gates are often used in parity generation

and checking truth table for even parity checking