1 dr. mohamed abdur rahman marahman@uqu.edu.sa office hours sunday: 10:00- 12:00 & tuesday: 3:00...

Post on 03-Jan-2016

229 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Dr. Mohamed Abdur Rahman

marahman@uqu.edu.sa

Office hours

Sunday: 10:00- 12:00

&

Tuesday: 3:00 - 3:50

Course website:

Has been created

http://teaching.mdabdurrahman.com/fall2013/cs213/

Logic Analysis & Design

2

Marks / Attendance

2 Assignments (2*10%=20%)

3 Quizzes (3*5%=15%)

Mid-Term Exam (25%)

Final Exam (40%)

3

Outline of Chapter 1

• Digital Systems

• Binary Numbers

• Number-base Conversions

• Octal and Hexadecimal Numbers

• Complements

• Signed Binary Numbers

• Binary Codes

• Binary Storage and Registers

• Binary Logic

4

Textbook / Online Materials

- Primary Textbook“Digital Design”, Morris Mano and Michael Cilleti, Prentice Hall, 4th edition, 2007, ISBN-10: 0131989243

- Optional Textbook“Digital Fundamentals”, Thomas L. Floyd, Prentice Hall, 10th edition, 2009, ISBN-10:  0132359235  

- Course Lectures will be available online on the course website

5

Course Objectives

Why Digital Logic Design?

Understand theory of operation for most of digital electronic devices

Analyze how can a digital computer perform the complex operations based on simply manipulating bits (zeros and ones)

Design of digital logic systems

6

Course Outline

Arithmetic operations in many number systems.Boolean algebraic structures.Simplification of Boolean expressions using Karnaugh Map.Implement the Boolean Functions using NAND and NOR gates.Analysis and design of combinational logic circuits.flip-flops.Sequential circuitsState diagram representation of sequential circuits.Analysis and design of clocked sequential circuit

7

Importance of Digital Logic

Most of the electronics devices consist of two integrated systems:

Software > Programs that control hardware to execute user wishes» To learn how to design this you need to study Computer Science

Hardware > Circuits that execute the program commands» To learn more about how to design this you need to study Digital Logic Design

8

Applications of Logic Design

Conventional computer designCPUs, busses, peripherals

Networking and communicationsPhones, modems, routers

Embedded productsCarsToysAppliancesEntertainment devices,

e.g. MP3 players, PS3, and many others

9

Applications of Logic Design

10

What is the meaning of Digital Logic Design?

11

What is Digital?

Digital: describes any system based on discontinuous data orevents. Computers are digital machines because at their mostbasic 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.

12

Analog Vs. Digital

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

13

Analog and Digital Signal

Analog system• The physical quantities or signals may vary

continuously over a specified range.

Digital system• The physical quantities or signals can assume only

discrete values.• Greater accuracy

14

Why Digital?

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

15

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.

I want to know the basic units used to build those Digital circuits?Answer is Digital Logic Gates!!

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

16

Digital Logic Gates

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

• Digital Systems are mainly a black box with minimum one input and minimum 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

17

Digital Logic Levels

• What’s the physical meaning of logic 0 and logic 1?

• How could we recognize them?

• Electrical Signals [voltages or currents] that exist throughout adigital system is in either of two recognizable values [ logic 1 orlogic 0 ]

• Binary values are represented abstractly by: Digits 0 and 1 Words (symbols) False (F) and True (T) Words (symbols) Low (L) and High (H) And words On and Off

18

Digital Logic Levels (Cont’d)

• Binary values are represented by values or ranges of values of physical quantities.

5v

2v

0.8v

0vIntermediate Region: Crossed only during statetransition between two limits

19

Boolean Algebra

What’s the difference between the Boolean Algebra and arithmetic algebra?

The First obvious difference that in Boolean algebra we have only (+) and (.) operators we don’t have subtraction(-) or division(/) like math.

20

Binary Logic

You should distinguish between binary logic and binary arithmetic.

Arithmetic variables are numbers that consist of many digits.• Arithmetic: 1+1=10

A binary logic variable is always either 1 or 0.• Binary 1 + 1 = 1

21

Decimal Number System

• Base (also called radix) = 10 – 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }

• Digit Position– Integer & fraction

• Digit Weight– Weight = (Base) Position

• Magnitude– Sum of “Digit x Weight”

• Formal Notation

1 0 -12 -2

5 1 2 7 4

10 1 0.1100 0.01

500 10 2 0.7 0.04

d2*B2+d1*B

1+d0*B0+d-1*B

-1+d-2*B-2

(512.74)10

22

Octal Number System

• Base = 88 digits { 0, 1, 2, 3, 4, 5, 6, 7 }

• WeightsWeight = (Base) Position

• MagnitudeSum of “Digit x Weight”

• Formal Notation

1 0 -12 -2

8 1 1/864 1/64

5 1 2 7 4

5 *82+1 *81+2 *80+7 *8-1+4 *8-2

=(330.9375)10

(512.74)8

23

Binary Number System

• Base = 22 digits { 0, 1 }, called binary digits or “bits”

• WeightsWeight = (Base) Position

• MagnitudeSum of “Bit x Weight”

• Formal Notation

• Groups of bits 4 bits = Nibble8 bits = Byte

1 0 -12 -2

2 1 1/24 1/4

1 0 1 0 1

1 *22+0 *21+1 *20+0 *2-1+1 *2-2

=(5.25)10

(101.01)2

1 0 1 1

1 1 0 0 0 1 0 1

24

Hexadecimal Number System

• Base = 1616 digits { 0, 1, 2, 3, 4, 5, 6, 7,

8, 9, A, B, C, D, E, F }

• WeightsWeight = (Base) Position

• MagnitudeSum of “Digit x Weight”

• Formal Notation

1 0 -12 -2

16 1 1/16256 1/256

1 E 5 7 A

1 *162+14 *161+5 *160+7 *16-1+10 *16-2

=(485.4765625)10

(1E5.7A)16

25

The Power of 2

n 2n

0 20=1

1 21=2

2 22=4

3 23=8

4 24=16

5 25=32

6 26=64

7 27=128

n 2n

8 28=256

9 29=512

10 210=1024

11 211=2048

12 212=4096

20 220=1M

30 230=1G

40 240=1T

Mega

Giga

Tera

Kilo

26

Addition

Decimal Addition

5 5

55+

011

= Ten ≥ Base

Subtract a Base

11 Carry

27

Binary Addition

Column Addition

1 0 1111

1111 0+

0000 1 11

≥ (2)10

111111

= 61

= 23

= 84

28

Binary Subtraction

Borrow a “Base” when needed

0 0 1110

1111 0−

0101 1 10

= (10)2

2

2

2 2

1

000

1

= 77

= 23

= 54

29

Binary Multiplication

Bit by bit

01 1 1 1

01 1 0

00 0 0 0

01 1 1 1

01 1 1 1

0 0 000

0110111 0

x

30

Number Base Conversions

Decimal(Base 10)

Octal(Base 8)

Binary(Base 2)

Hexadecimal(Base 16)

Evaluate Magnitude

Evaluate Magnitude

Evaluate Magnitude

31

Decimal (Integer) to Binary Conversion

• Divide the number by the ‘Base’ (=2)

• Take the remainder (either 0 or 1) as a coefficient

• Take the quotient and repeat the division

Example: (13)10

Quotient Remainder Coefficient

Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2

MSB LSBMSB LSB

13/ 2 = 6 1 a0 = 1 6 / 2 = 3 0 a1 = 0 3 / 2 = 1 1 a2 = 1 1 / 2 = 0 1 a3 = 1

32

Decimal (Fraction) to Binary Conversion

• Multiply the number by the ‘Base’ (=2)

• Take the integer (either 0 or 1) as a coefficient

• Take the resultant fraction and repeat the division

Example: (0.625)10

Integer Fraction Coefficient

Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2

MSB LSBMSB LSB

0.625 * 2 = 1 . 250.25 * 2 = 0 . 5 a-2 = 00.5 * 2 = 1 . 0 a-3 = 1

a-1 = 1

33

Decimal to Octal Conversion

Example: (175)10

Quotient Remainder Coefficient

Answer: (175)10 = (a2 a1 a0)8 = (257)8

175 / 8 = 21 7 a0 = 7 21 / 8 = 2 5 a1 = 5 2 / 8 = 0 2 a2 = 2

Example: (0.3125)10

Integer Fraction Coefficient

Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8

0.3125 * 8 = 2 . 50.5 * 8 = 4 . 0 a-2 = 4

a-1 = 2

34

Binary − Octal Conversion

• 8 = 23

• Each group of 3 bits represents an octal digit

Octal Binary

0 0 0 0

1 0 0 1

2 0 1 0

3 0 1 1

4 1 0 0

5 1 0 1

6 1 1 0

7 1 1 1

Example:

( 1 0 1 1 0 . 0 1 )2

( 2 6 . 2 )8

Assume Zeros

Works both ways (Binary to Octal & Octal to Binary)

35

Binary − Hexadecimal Conversion

• 16 = 24

• Each group of 4 bits represents a hexadecimal digit

Hex Binary0 0 0 0 01 0 0 0 12 0 0 1 03 0 0 1 14 0 1 0 05 0 1 0 16 0 1 1 07 0 1 1 18 1 0 0 09 1 0 0 1A 1 0 1 0B 1 0 1 1C 1 1 0 0D 1 1 0 1E 1 1 1 0F 1 1 1 1

Example:

( 1 0 1 1 0 . 0 1 )2

( 1 6 . 4 )16

Assume Zeros

Works both ways (Binary to Hex & Hex to Binary)

36

Octal − Hexadecimal Conversion

• Convert to Binary as an intermediate step

Example:

( 0 1 0 1 1 0 . 0 1 0 )2

( 1 6 . 4 )16

Assume Zeros

Works both ways (Octal to Hex & Hex to Octal)

( 2 6 . 2 )8

Assume Zeros

37

Decimal, Binary, Octal and Hexadecimal

Decimal Binary Octal Hex00 0000 00 001 0001 01 102 0010 02 203 0011 03 304 0100 04 405 0101 05 506 0110 06 607 0111 07 708 1000 10 809 1001 11 910 1010 12 A11 1011 13 B12 1100 14 C13 1101 15 D14 1110 16 E15 1111 17 F

38

Complements

• There are two types of complements for each base-r system: the radix complement and diminished radix complement.

• Diminished Radix Complement - (r-1)’s Complement

– Given a number N in base r having n digits, the (r–1)’s complement of N is defined as:

(rn –1) – N• Example for 6-digit decimal numbers:

– 9’s complement is (rn – 1)–N = (106–1)–N = 999999–N

– 9’s complement of 546700 is 999999–546700 = 453299

• Example for 7-digit binary numbers:

– 1’s complement is (rn – 1) – N = (27–1)–N = 1111111–N

– 1’s complement of 1011000 is 1111111–1011000 = 0100111

• Observation:

– Subtraction from (rn – 1) will never require a borrow

– Diminished radix complement can be computed digit-by-digit

– For binary: 1 – 0 = 1 and 1 – 1 = 0

39

Complements

• 1’s Complement (Diminished Radix Complement)– All ‘0’s become ‘1’s

– All ‘1’s become ‘0’s

Example (10110000)2

(01001111)2

If you add a number and its 1’s complement …

1 0 1 1 0 0 0 0

+ 0 1 0 0 1 1 1 1

1 1 1 1 1 1 1 1

40

Complements

41

Complements

• 2’s Complement (Radix Complement)– Take 1’s complement then add 1

– Toggle all bits to the left of the first ‘1’ from the right

Example:

Number:

1’s Comp.:

0 1 0 1 0 0 0 0

1 0 1 1 0 0 0 0

0 1 0 0 1 1 1 1

+ 1

OR

1 0 1 1 0 0 0 0

00001010

42

Complements

• Subtraction with Complements– The subtraction of two n-digit unsigned numbers M – N in base r can be

done as follows:

43

Complements

• Example 1.5– Using 10's complement, subtract 72532 – 3250.

• Example 1.6 – Using 10's complement, subtract 3250 – 72532.

There is no end carry.

Therefore, the answer is – (10's complement of 30718) = 69282.

44

Complements

45

Complements

46

Signed Binary Numbers

47

Signed Binary Numbers

48

Signed Binary Numbers

49

Signed Binary Numbers

50

Binary Codes

51

Binary Code

52

Binary Code

53

Binary Codes

54

Binary Codes

55

Binary Codes

The code is called reflected because it can be generated in the following manner. •Take the Gray code 0, 1. • Write it forwards, then backwards: 0, 1, 1, 0. •Then prepend 0s to the first half and 1s to the second half: 00, 01, 11, 10. •Continuing, write 00, 01, 11, 10, 10, 11, 01, 00 •To obtain: 000, 001, 011, 010, 110, 111, 101, 100•This process continues…

56

Binary Codes

57

Binary Codes

58

ASCII Character Codes

59

ASCII Properties

60

Binary Codes

61

Binary Codes

62

Binary Storage and Registers

63

A Digital Computer Example

64

Transfer of information

65

Transfer of information

66

Digital Logic Gates

67

Binary Logic

68

Binary Logic

69

Switching Circuits

70

Binary Logic

71

Binary Logic

72

Binary Logic

top related