Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Dr. Mohamed Abdur Rahman Office hours Sunday: 10:00- 12:00 & Tuesday: 3:00 - 3:50 Course website: Has been created

Similar presentations


Presentation on theme: "1 Dr. Mohamed Abdur Rahman Office hours Sunday: 10:00- 12:00 & Tuesday: 3:00 - 3:50 Course website: Has been created"— Presentation transcript:

1

2 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

3 2 Marks / Attendance 2 Assignments (2*10%=20%) 3 Quizzes (3*5%=15%) Mid-Term Exam (25%) Final Exam (40%)

4 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

5 4 Textbook / Online Materials - Primary Textbook “Digital Design”, Morris Mano and Michael Cilleti, Prentice Hall, 4 th edition, 2007, ISBN-10: 0131989243 - Optional Textbook “Digital Fundamentals”, Thomas L. Floyd, Prentice Hall, 10 th edition, 2009, ISBN-10: 0132359235 - Course Lectures will be available online on the course website

6 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

7 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 circuits State diagram representation of sequential circuits. Analysis and design of clocked sequential circuit

8 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

9 8 Applications of Logic Design Conventional computer design CPUs, busses, peripherals Networking and communications Phones, modems, routers Embedded products Cars Toys Appliances Entertainment devices, e.g. MP3 players, PS3, and many others

10 9 Applications of Logic Design

11 10 What is the meaning of Digital Logic Design?

12 11 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.

13 12 Analog Vs. Digital An analog or analogue signal is any variable signal continuous in both time and amplitude. e.g. Sound

14 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

15 14 Why Digital? Digital systems are easier to design and implement than analog systems.

16 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

17 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

18 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 a digital system is in either of two recognizable values [ logic 1 or logic 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

19 18 Digital Logic Levels (Cont’d) Binary values are represented by values or ranges of values of physical quantities. 5v 2v 0.8v 0v Intermediate Region: Crossed only during state transition between two limits

20 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.

21 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

22 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 102-2 51274 1010.11000.01 5001020.70.04 d 2 *B 2 +d 1 *B 1 +d 0 *B 0 +d -1 *B -1 +d -2 *B -2 (512.74) 10

23 22 Octal Number System Base = 8 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 } Weights Weight = (Base) Position Magnitude Sum of “Digit x Weight” Formal Notation 102-2 811/8641/64 51274 5 *8 2 +1 *8 1 +2 *8 0 +7 *8 -1 +4 *8 -2 =(330.9375) 10 (512.74) 8

24 23 Binary Number System Base = 2 2 digits { 0, 1 }, called binary digits or “bits” Weights Weight = (Base) Position Magnitude Sum of “Bit x Weight” Formal Notation Groups of bits 4 bits = Nibble 8 bits = Byte 102-2 211/241/4 10101 1 *2 2 +0 *2 1 +1 *2 0 +0 *2 -1 +1 *2 -2 =(5.25) 10 (101.01) 2 1 0 1 1 1 1 0 0 0 1 0 1

25 24 Hexadecimal Number System Base = 16 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F } Weights Weight = (Base) Position Magnitude Sum of “Digit x Weight” Formal Notation 102-2 161 1/16 256 1/256 1E57A 1 *16 2 +14 *16 1 +5 *16 0 +7 *16 -1 +10 *16 -2 =(485.4765625) 10 (1E5.7A) 16

26 25 The Power of 2 n2n2n 02 0 =1 12 1 =2 22 2 =4 32 3 =8 42 4 =16 52 5 =32 62 6 =64 72 7 =128 n2n2n 82 8 =256 92 9 =512 102 10 =1024 112 11 =2048 122 12 =4096 202 20 =1M 302 30 =1G 402 40 =1T Mega Giga Tera Kilo

27 26 Addition Decimal Addition 55 55+ 011 = Ten ≥ Base  Subtract a Base 11Carry

28 27 Binary Addition Column Addition 101111 11110+ 0000111 ≥ (2) 10 111111 = 61 = 23 = 84

29 28 Binary Subtraction Borrow a “Base” when needed 001110 11110 − 0101110 = (10) 2 2 2 2 2 1 000 1 = 77 = 23 = 54

30 29 Binary Multiplication Bit by bit 01111 0110 00000 01111 01111 0 0000 01101110 x

31 30 Number Base Conversions Decimal (Base 10) Octal (Base 8) Binary (Base 2) Hexadecimal (Base 16) Evaluate Magnitude

32 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 QuotientRemainder Coefficient Answer: (13) 10 = (a 3 a 2 a 1 a 0 ) 2 = (1101) 2 MSB LSB 13 / 2 = 61 a 0 = 1 6 / 2 = 30 a 1 = 0 3 / 2 = 11 a 2 = 1 1 / 2 = 01 a 3 = 1

33 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 IntegerFraction Coefficient Answer: (0.625) 10 = (0.a -1 a -2 a -3 ) 2 = (0.101) 2 MSB LSB 0.625 * 2 = 1. 25 0.25 * 2 = 0. 5 a -2 = 0 0.5 * 2 = 1. 0 a -3 = 1 a -1 = 1

34 33 Decimal to Octal Conversion Example: (175) 10 QuotientRemainder Coefficient Answer: (175) 10 = (a 2 a 1 a 0 ) 8 = (257) 8 175 / 8 = 217 a 0 = 7 21 / 8 = 25 a 1 = 5 2 / 8 = 02 a 2 = 2 Example: (0.3125) 10 IntegerFraction Coefficient Answer: (0.3125) 10 = (0.a -1 a -2 a -3 ) 8 = (0.24) 8 0.3125 * 8 = 2. 5 0.5 * 8 = 4. 0 a -2 = 4 a -1 = 2

35 34 Binary − Octal Conversion 8 = 2 3 Each group of 3 bits represents an octal digit OctalBinary 00 0 0 10 0 1 20 1 0 30 1 1 41 0 0 51 0 1 61 1 0 71 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)

36 35 Binary − Hexadecimal Conversion 16 = 2 4 Each group of 4 bits represents a hexadecimal digit HexBinary 00 0 10 0 0 1 20 0 1 0 30 0 1 1 40 1 0 0 50 1 60 1 1 0 70 1 1 1 81 0 0 0 91 0 0 1 A1 0 B1 0 1 1 C1 1 0 0 D1 1 0 1 E1 1 1 0 F1 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)

37 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

38 37 Decimal, Binary, Octal and Hexadecimal DecimalBinaryOctalHex 000000000 010001011 020010022 030011033 040100044 050101055 060110066 070111077 081000108 091001119 10101012A 11101113B 12110014C 13110115D 14111016E 15111117F

39 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: (r n –1) – N Example for 6-digit decimal numbers: –9’s complement is (r n – 1)–N = (10 6 –1)–N = 999999–N –9’s complement of 546700 is 999999–546700 = 453299 Example for 7-digit binary numbers: –1’s complement is (r n – 1) – N = (2 7 –1)–N = 1111111–N –1’s complement of 1011000 is 1111111–1011000 = 0100111 Observation: –Subtraction from (r n – 1) will never require a borrow –Diminished radix complement can be computed digit-by-digit –For binary: 1 – 0 = 1 and 1 – 1 = 0

40 39 Complements 1’s Complement (Diminished Radix Complement) –A–All ‘0’s become ‘1’s –A–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

41 40 Complements

42 41 Complements 2’s Complement (Radix Complement) –T–Take 1’s complement then add 1 –T–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

43 42 Complements Subtraction with Complements –The subtraction of two n-digit unsigned numbers M – N in base r can be done as follows:

44 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.

45 44 Complements

46 45 Complements

47 46 Signed Binary Numbers

48 47 Signed Binary Numbers

49 48 Signed Binary Numbers

50 49 Signed Binary Numbers

51 50 Binary Codes

52 51 Binary Code

53 52 Binary Code

54 53 Binary Codes

55 54 Binary Codes

56 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…

57 56 Binary Codes

58 57 Binary Codes

59 58 ASCII Character Codes

60 59 ASCII Properties

61 60 Binary Codes

62 61 Binary Codes

63 62 Binary Storage and Registers

64 63 A Digital Computer Example

65 64 Transfer of information

66 65 Transfer of information

67 66 Digital Logic Gates

68 67 Binary Logic

69 68 Binary Logic

70 69 Switching Circuits

71 70 Binary Logic

72 71 Binary Logic

73 72 Binary Logic


Download ppt "1 Dr. Mohamed Abdur Rahman Office hours Sunday: 10:00- 12:00 & Tuesday: 3:00 - 3:50 Course website: Has been created"

Similar presentations


Ads by Google