elct 201: digital logic design...g. langholz, a. kandel, & j. l mott, “foundations of digital...

Post on 14-Apr-2021

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

ELCT201: DIGITAL LOGIC DESIGN Dr. Eng. Haitham Omran, haitham.omran@guc.edu.eg

Dr. Eng. Wassim Alexan, wassim.joseph@guc.edu.eg

Lecture 1

هــ 1438ذو الحجة

Winter 2017

Following the slides of Dr. Ahmed H. Madian

2

3

4

WHAT IS THE IMPORTANCE OF DIGITAL LOGIC?

5

Most of electronic devices consist of two integrated systems

Software Hardware

Programs that control hardware to execute user wishes

To learn how to design this you need to study Computer

Science

Circuits that execute the program commands

To learn more about how to design this you need to study

Digital Logic Design

THE IMPORTANCE OF DIGITAL LOGIC

Floyd 11th edition

6

COURSE OBJECTIVES

Why Digital Logic Design?

Understand the theory of operation for most of digital electronic devices,

Analyze how a digital computer performs complex operations, based on simply manipulating bits (zeros and ones),

Design digital logic systems!

7

TEXT AND REFERENCE BOOKS

Textbook:

M. Morris Mano, “Digital Design”, 3rd Edition, Prentice-Hall, 2002, ISBN 0-13-062121-8.

References:

S. Brown , Z. Vranesic, “Fundamentals Of Digital Logic With Vhdl Design”, ISBN 0-07-012591-0.

G. Langholz, A. Kandel, & J. L Mott, “Foundations of digital logic design”, ISBN 981-02-3110-5.

D. J. Comer, “Digital Logic and State Machine Design”, ISBN 978-0195107234.

Thomas L. Floyd, “Digital Fundamentals”, ISBN 978-0131946095

8

ELCT 201: DIGITAL LOGIC

Instructors Dr. Eng. Haitham Omran

Dr. Eng. Wassim Alexan

Teaching assistants Eng. Fadwa Foda

Eng. Sarah Azzam

Eng. Engy Maher

Eng. Youstina Megalli

Eng. Ali Ahmed

Eng. Abanoub Mamdouh

Eng. Mostafa El-Swefy

Eng. Yasmine Hossam

9

Grading

Assignments 10%

Quizzes 20%

Midterm Exam 25%

Final Exam 45%

COURSE OUTLINE

1. Introduction

2. Gate-Level Minimization

3. Combinational Logic

4. Synchronous Sequential Logic

5. Registers and Counters

6. Memories and Programmable Logic

10

FLASHBACK ON DIGITAL LOGIC DESIGN HISTORY

11

HOW DID IT ALL START?

1850: George Boole invents Boolean algebra

12

HOW DID IT ALL START?

13

1946: ENIAC, the first electronic computer is developed

18,000 vacuum tubes

5,000 operations per second

1,000 square feet

It really cost a lot of power to

turn on the switch!

Dr. Haitham Omran, Dr. Wassim Alexan 14

AND IT WENT ON…

1947: Shockley, Brattain, and Bardeen invent the transistor

Replaces vacuum tubes

Enables integration of multiple devices into one package

1956: They received the Nobel

Prize in Physics

15

AND IT WENT ON…

1955: TRADIC: AT&T Bell Labs announced the first fully transistorized computer

1958: The1st (2D) Integrated Circuit (Kilby received the Nobel prize in 2000)

•Transistor, resistors and capacitors on the same piece of semiconductor

•Interconnects between components is not integrated

•Low connectivity between components

16

AND IT WENT ON…

1971: Intel’s 4004 1st microprocessor

17

• Maximum clock rate is 740 kHz

• 46300 to 92600 instructions

per second

Now: Intel® Core™ i7-6700K Processor

(8M Cache, up to 4.20 GHz)

APPLICATIONS OF DIGITAL LOGIC DESIGN

Conventional computer design

CPUs, busses, peripherals

Networking and communications

Phones, modems, routers

Embedded products

Cars

Toys

Appliances

Entertainment devices: MP3 players, gaming consoles (PlayStation, Xbox, etc…)

18

19

BUT WHAT IS THE MEANING OF DIGITAL LOGIC DESIGN?

WHAT IS DIGITAL?

Digital describes any system based on discontinuous data or events. Computers

are digital machines because at their most basic level they can distinguish

between just two values, 0 and 1, or off and on. There is no simple way to

represent all the values in between, such as 0.25. All data that a computer

processes must be encoded digitally, as a series of zeroes and ones.

20

ANALOG VS. DIGITAL

An analog signal is any variable signal continuous in both time and amplitude. e.g. Sound

21

Example: A typical analog device is a clock in which the hands move continuously around the face. Such a clock is capable of indicating every possible time of day. In contrast, a digital clock is capable of representing only a finite number of times (every tenth of a second, for example).

WHY DIGITAL?

Digital systems are easier to design and implement than analog systems.

22

WHAT IS LOGIC DESIGN?

Given a specification of a problem, come up with a way of solving it choosing appropriately from a collection of available components, while meeting some criteria for size, cost, power, etc…

23

24

Digital Logic Gates!

Digital Logic Gates are the basic unit to build any digital circuit

WHAT ARE THE BASIC UNITS USED TO BUILD THESE DIGITAL CIRCUITS?

25

DIGITAL LOGIC GATES

•Digital logic circuits are hardware components that manipulate binary information (we call them gates)

•A digital system is basically a black box with a minimum of one input and one output

•Inside this box, are millions of switches called transistors

•Transistors perform different functions according to inputs

•In binary logic circuits there are only two levels: 0 and 1

Digital System

A

B

26

Digital Logic levels

What is the physical meaning of logic 0 and logic 1? How can we recognize them?

DIGITAL LOGIC LEVELS (CONT.)

Electrical Signals [ voltages or currents ] that exist throughout a digital system are in either of two recognizable values [ logic 1 or logic 0 ]

27

Voltage

time

Logic – 1 range

Logic – 0 range

Transition , occurs

between the two limits

Intermediate

region,

crossed only

during state

transition

5

0.8

0

2

Boolean Algebra

What is the difference between the Boolean algebra and arithmetic algebra?

The First obvious difference is that in Boolean algebra we have only (+) and () operators we do not have subtraction (-) or division (/) like in math

28

BINARY LOGIC

You should distinguish between binary logic and binary arithmetic. Arithmetic variables are numbers that consist of many digits.

A binary logic variable is always either 1 or 0.

Binary 1 + 1 = 1

29

Arithmetic 1 + 1 = 10

Two digits Carry

DIGITAL LOGIC GATES

There are three fundamental logical operations, from which all other functions, no matter how complex, can be derived. These Basic functions are named:

AND,

OR,

NOT (INVERTER).

Each of these has a specific symbol

and a clearly-defined behavior

30

BASIC DIGITAL LOGIC GATES (CONT.)

AND Gate

Represented by any of the following notations:

X AND Y

X . Y

X Y

Function definition:

Z=1 only if X=Y=1

0 otherwise

X

YZ

31

Symbol diagram

AND

AND X Y

Switch representation

BASIC DIGITAL LOGIC GATES (CONT.)

OR Gate Represented by any of the following notations:

X OR Y

X + Y

X v Y

Function definition:

Z = 1 if X=1 or Y =1 or both X=Y=1

0 if X=Y=0

X

YZ

32

Symbol diagram

OR

OR

X

Y

Switch representation

BASIC DIGITAL LOGIC GATES (CONT.)

NOT (Inverter) Gate Represented by a bar over the variable

Function definition:

Z is what X is not

It is also called complement operation, as it changes 1’s to 0’s and 0’s to 1’s.

X Z

X

33

Symbol diagram

NOT

NOT

X

z

Switch representation

LOGIC GATES TIMING DIAGRAM

34

•Timing diagrams illustrate the response of any gate to all possible input signal combinations. •The horizontal axis of the timing diagram represents time and the vertical axis represents the signal as it changes between the two possible voltage levels 1 or 0

DIGITAL LOGIC GATES (CONT.)

Gates can have more than 2 inputs

Other Types of logic gates

35

HOW TO DESCRIBE A LOGIC SYSTEM?

36

By using one of the following two methods:

• A Truth Table

• A Boolean Expression

TRUTH TABLE

Z Y X

0

0

0

1

0

1

0

1

0

0

1

1

X

YZ

37

A Truth Table is a table of combinations of the binary variables showing the relationship between the different values that the input variables take and the result of the operation (output). The number of rows in the Truth Table is , where n = number of input variables in the function. The binary combinations are obtained from the binary number by counting from 0 to

n2

12n

Truth table of an AND gate

Example: AND gate with 2 inputs

n=2

The truth table has 22 rows = 4

The binary combinations is from 0 to (22-1=(3)) [00,01,10,11]

All input

combinations output

BOOLEAN EXPRESSIONS

We can use these basic operations to form more complex expressions:

f(x,y,z) = (x + y’)z + x’

Some terminology and notation: f is the name of the function.

(x,y,z) are the input variables, each representing 1 or 0. Listing the inputs is optional, but sometimes helpful.

A literal is any occurrence of an input variable or its complement. The function above has four literals: x, y’, z, and x’.

Precedences are important, but not too difficult. NOT has the highest precedence, followed by AND, and then OR.

Fully parenthesized, the function above would be kind of messy:

f(x,y,z) = (((x +(y’))z) + x’)

38

38

How to get the Boolean Expression from the truth table?

39

BOOLEAN EXPRESSIONS FROM TRUTH TABLES

40

Each 1 in the output of a truth table specifies one term in the corresponding boolean expression. The expression can be read off by inspection…

A B C F

0 0 0 0

0 0 1 0

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 1

F is true when: A is false AND B is true AND C is false OR A is true AND B is true AND C is true

F = A’BC’ + ABC

Sum-of-Products-Algorithm

ANOTHER EXAMPLE

41

F = A’B’C +

A’BC’ +

AB’C’ +

ABC

F = ?

A B C F

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 1

BASIC LOGIC GATES

• We have defined three basic logic gates and operators

• Also, we could build any digital circuit from those basic logic gates. • In digital Logic, we are not using normal mathematics we are using Boolean algebra

So, we need to know the laws & rules of Boolean Algebra

42

LAWS & RULES OF BOOLEAN ALGEBRA

The basic laws of Boolean algebra The commutative law

The associative law The distributive law

43

COMMUTATIVE LAW

The commutative law of addition for two variables is written as: A+B = B+A

The commutative law of multiplication for two variables is written as: AB = BA

A

B A+B

B

A B+A

A

B AB

B

A BA

44

ASSOCIATIVE LAW

A

B

A+(B+C)

C

A

B (A+B)+C

C

A

B

A(BC)

C

A

B (AB)C

C

B+C

A+B

BC

AB

The associative law of addition for 3 variables is written as: A+(B+C) = (A+B)+C

The associative law of multiplication for 3 variables is written as: A(BC) = (AB)C

45

The distributive law for multiplication as follows:

A(B+C) = AB + AC

The distributive law for addition is as follows

A+(B.C) = (A+B)(A+C)

DISTRIBUTIVE LAW

B

C

A

B+C A

B

C

A

X X

AB

AC

X=A(B+C) X=AB+AC

X=A+(B.C)

B

C

A X

A

B

C

A

X

X=(A+B)(A+C)

BC A+B

A+C

46

BASIC THEOREMS OF BOOLEAN ALGEBRA

1.6

.5

1.4

00.3

11.2

0.1

AA

AAA

AA

A

A

AA

BCACABA

BABAA

AABA

AA

AA

AAA

))(.(12

.11

.10

.9

0.8

.7

___________________________________________________________

A, B, and C can represent a single variable or a combination of variables.

47

DUALITY PRINCIPLE

XY)(XX X YXX

A Boolean equation remains valid if we take the dual of the expressions on both sides of the equals sign

Dual of expression it means,

Interchange 1’s with 0’s (and Vice-versa)

Interchange AND () with OR (+) (and Vice-versa)

X1X X0X XY)(XX X YXX

Duality Duality

Duality XXX XXX Duality

48

DEMORGAN’S LAW

BABA

BABA

49

EXAMPLE Get the logic function from the following truth table and implement it using basic logic gates (AND, OR, NOT)

A B P

0 0 1

0 1 1

1 0 1

1 1 0

P = A’ B’ + A’B + A B’

• It needs two inverters + three AND + two OR gates = 7 gates to implement the function

Can we make this circuit “better”? • Cheaper: fewer gates • Faster: fewer delays from inputs to outputs

The answer in the simplification of the logic function

50

SIMPLIFICATION OF THE LOGIC FUNCTION

A’B’ + A’B + AB’

= A’ * (B’ + B) + A * B’ (Distributivity)

= A’ * (B + B’) + A * B’ (Commutativity)

= A’ * 1 + A * B’ (x + x’ = 1)

= A’ + (A * B’) (x +x’y)=(x+x’)(x+y)(Distributivity)

= (A’ + B’) (De Morgan’s)

= (A B)’ 1 GATE (NAND) ONLY

From 7 gates using simplification rules could be optimized to one gate

51

52

Z Y X

1

0

0

1

0

1

0

1

0

0

1

1

Z Y X

0

1

1

0

0

1

0

1

0

0

1

1

Z Y X

1

1

1

0

0

1

0

1

0

0

1

1

Z Y X

1

0

0

0

0

1

0

1

0

0

1

1

DERIVED GATES

NAND

AND-Invert

NOR

OR-Invert

XOR

Odd

XNOR

Even

FINAL NOTE

Check the website http://eee.guc.edu.eg for the course materials as well as any announcements

53

top related