Digital Logic Design 1 Digital Logic Design Digital

  • Slides: 35
Download presentation
Digital Logic Design 1

Digital Logic Design 1

Digital Logic Design ° Digital - Concerned with the interconnection among digital components and

Digital Logic Design ° Digital - Concerned with the interconnection among digital components and modules » Best Digital System example is General Purpose Computer ° Logic Design - Deals with the basic concepts and tools used to design digital hardware consisting of logic circuits » Circuits to perform arithmetic operations (+, -, x, ÷) 2

Digital Signals ° Decimal values are difficult to represent in electrical systems. It is

Digital Signals ° Decimal values are difficult to represent in electrical systems. It is easier to use two voltage values than ten. ° Digital Signals have two basic states: 1 (logic “high”, or H, or “on”) 0 (logic “low”, or L, or “off”) ° Digital values are in a binary format. Binary means 2 states. ° A good example of binary is a light (only on or off) on off Power switches have labels “ 1” for on and “ 0” for off. 3

Digital Logic Design ° Bits and Pieces of DLD History ° George Boole -

Digital Logic Design ° Bits and Pieces of DLD History ° George Boole - Mathematical Analysis of Logic (1847) An Investigation of Laws of Thoughts; Mathematical Theories of Logic and Probabilities (1854) ° Claude Shannon - Rediscovered the Boole “ A Symbolic Analysis of Relay and Switching Circuits “ Boolean Logic and Boolean Algebra were Applied to Digital Circuitry ----- Beginning of the Digital Age and/or Computer Age World War II Computers as Calculating Machines Arlington (State Machines) “ Control “ 4

Motivation ° Microprocessors/Microelectronics have revolutionized our world • Cell phones, internet, rapid advances in

Motivation ° Microprocessors/Microelectronics have revolutionized our world • Cell phones, internet, rapid advances in medicine, etc. ° The semiconductor industry has grown tremendously 5

Objectives ° Number System, Their Uses, Conversions ° Basic Building Blocks of Digital System

Objectives ° Number System, Their Uses, Conversions ° Basic Building Blocks of Digital System ° Minimization ° Combinational And Sequential Logic ° Digital System/Circuit Analysis and Design ° State Minimizations ° Integrated Circuits ° Simulations 6

Text Book ° Primary Text: “Digital Design” By M. Morris Mano and Michael D.

Text Book ° Primary Text: “Digital Design” By M. Morris Mano and Michael D. Ciletti ° Complementary Material “Logic and Computer Design Fundamentals” By M. Morris Mano & Charles R Kime. 7

Digital Logic Design Lecture 1 Number Systems 8

Digital Logic Design Lecture 1 Number Systems 8

Number Systems ° Decimal is the number system that we use ° Binary is

Number Systems ° Decimal is the number system that we use ° Binary is a number system that computers use ° Octal is a number system that represents groups of binary numbers (binary shorthand). It is used in digital displays, and in modern times in conjunction with file permissions under Unix systems. ° Hexadecimal (Hex) is a number system that represents groups of binary numbers (binary shorthand). Hex is primarily used in computing as the most common form of expressing a humanreadable string representation of a byte (group of 8 bits). 9

Overview ° The design of computers • It all starts with numbers • Building

Overview ° The design of computers • It all starts with numbers • Building circuits • Building computing machines ° Digital systems ° Understanding decimal numbers ° Binary and octal numbers • The basis of computers! ° Conversion between different number systems 10

Analog vs. Digital Consider a faucet Digital Water can be flowing or NOT flowing

Analog vs. Digital Consider a faucet Digital Water can be flowing or NOT flowing from the faucet Two States • On • Off Analog How much water is flowing from the faucet? Advantages of Digital Replication • Analog Try replicating the exact flow from a faucet • Digital Try replicating ON or OFF 11

Advantages of Digital o Error Correction/Detection • Small errors don’t propagate o Miniaturization of

Advantages of Digital o Error Correction/Detection • Small errors don’t propagate o Miniaturization of Circuits o Programmability • Digital computers are programmable ° Two discrete values are used in digital systems. ° How are discrete elements represented? • Signals are the physical quantities used to represent discrete elements of information in a digital system. ° Electric signals used: • Voltage • Current 12

Advantages of Digital/Representation of Binary Values ° Why are there voltage ranges instead of

Advantages of Digital/Representation of Binary Values ° Why are there voltage ranges instead of exact voltages? o Two possible values • Variations in circuit behavior & noise • • • 1, 0 On, Off True, False High, Low Heads, Tails Black, White 13

14

14

Digital Computer Systems ° Digital systems consider discrete amounts of data. ° Examples •

Digital Computer Systems ° Digital systems consider discrete amounts of data. ° Examples • 26 letters in the alphabet • 10 decimal digits ° Larger quantities can be built from discrete values: • Words made of letters • Numbers made of decimal digits (e. g. 239875. 32) ° Computers operate on binary values (0 and 1) ° Easy to represent binary values electrically • Voltages and currents. • Can be implemented using circuits • Create the building blocks of modern computers 15

Understanding Decimal Numbers ° Decimal numbers are made of decimal digits: (0, 1, 2,

Understanding Decimal Numbers ° Decimal numbers are made of decimal digits: (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) ° But how many items does a decimal number represent? • ° What about fractions? • • ° 8653 = 8 x 103 + 6 x 102 + 5 x 101 + 3 x 100 97654. 35 = 9 x 104 + 7 x 103 + 6 x 102 + 5 x 101 + 4 x 100 + 3 x 10 -1 + 5 x 10 -2 In formal notation -> (97654. 35)10 Why do we use 10 digits, anyway? 16

Understanding Octal Numbers ° Octal numbers are made of octal digits: (0, 1, 2,

Understanding Octal Numbers ° Octal numbers are made of octal digits: (0, 1, 2, 3, 4, 5, 6, 7) ° How many items does an octal number represent? • ° (4536)8 = 4 x 83 + 5 x 82 + 3 x 81 + 6 x 80 = (1362)10 What about fractions? • (465. 27)8 = 4 x 82 + 6 x 81 + 5 x 80 + 2 x 8 -1 + 7 x 8 -2 ° Octal numbers don’t use digits 8 or 9 ° Who would use octal number, anyway? 17

Understanding Binary Numbers ° Binary numbers are made of binary digits (bits): • °

Understanding Binary Numbers ° Binary numbers are made of binary digits (bits): • ° How many items does an binary number represent? • ° (110. 10)2 = 1 x 22 + 1 x 21 + 0 x 20 + 1 x 2 -1 + 0 x 2 -2 Groups of eight bits are called a byte • ° (1011)2 = 1 x 23 + 0 x 22 + 1 x 21 + 1 x 20 = (11)10 What about fractions? • ° 0 and 1 (11001001) 2 Groups of four bits are called a nibble. • (1101) 2 18

Why Use Binary Numbers? ° Easy to represent 0 and 1 using electrical values.

Why Use Binary Numbers? ° Easy to represent 0 and 1 using electrical values. ° Possible to tolerate noise. ° Easy to transmit data ° Easy to build binary circuits. AND Gate 1 0 0 19

Binary In Binary, there are only 0’s and 1’s. These numbers are called “Base-2”

Binary In Binary, there are only 0’s and 1’s. These numbers are called “Base-2” ( Example: 0102) Base 2 = Base 10 Binary to Decimal 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7 We count in “Base-10” (0 to 9) ° Binary number has base 2 ° Each digit is one of two numbers: 0 and 1 ° Each digit is called a bit ° Eight binary bits make a byte ° All 256 possible values of a byte can be represented using 2 digits in hexadecimal notation. 20

Binary as a Voltage ° Voltages are used to represent logic values: ° A

Binary as a Voltage ° Voltages are used to represent logic values: ° A voltage present (called Vcc or Vdd) = 1 ° Zero Volts or ground (called gnd or Vss) = 0 A simple switch can provide a logic high or a logic low. 21

A Simple Switch ° Here is a simple switch used to provide a logic

A Simple Switch ° Here is a simple switch used to provide a logic value: Vcc Vcc, or 1 Gnd, or 0 There are other ways to connect a switch. 22

Binary digits Bit: single binary digit Byte: 8 binary digits Bit 100101112 Radix Byte

Binary digits Bit: single binary digit Byte: 8 binary digits Bit 100101112 Radix Byte 23

Conversion Between Number Bases Octal(base 8) Decimal(base 10) Binary(base 2) Hexadecimal ° Learn to

Conversion Between Number Bases Octal(base 8) Decimal(base 10) Binary(base 2) Hexadecimal ° Learn to convert between bases. ° Already demonstrated how to convert from binary to decimal. ° Hexadecimal described in next lecture. (base 16) 24

Number Systems System Base Symbols Used by humans? Used in computers? Decimal 10 0,

Number Systems System Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, … 9 Yes No Binary 2 0, 1 No Yes Octal 8 0, 1, … 7 No No Hexadecimal 16 0, 1, … 9, A, B, … F No No 25

Conversion Among Bases The possibilities: Decimal Octal Binary Hexadecimal 26

Conversion Among Bases The possibilities: Decimal Octal Binary Hexadecimal 26

Convert an Integer from Decimal to Another Base For each digit position: 1. Divide

Convert an Integer from Decimal to Another Base For each digit position: 1. Divide decimal number by the base (e. g. 2) 2. The remainder is the lowest-order digit 3. Repeat first two steps until no divisor remains. Example for (13)10: Integer Remainder Quotient 13/2 = 6/2 = 3/2 = 1/2 = 6 3 1 0 + + ½ 0 ½ ½ Coefficient a 0 = 1 a 1 = 0 a 2 = 1 a 3 = 1 Answer (13)10 = (a 3 a 2 a 1 a 0)2 = (1101)2 27

Convert an Fraction from Decimal to Another Base For each digit position: 1. Multiply

Convert an Fraction from Decimal to Another Base For each digit position: 1. Multiply decimal number by the base (e. g. 2) 2. The integer is the highest-order digit 3. Repeat first two steps until fraction becomes zero. Example for (0. 625)10: Integer 0. 625 x 2 = 0. 250 x 2 = 0. 500 x 2 = 1 0 1 Fraction + + + 0. 25 0. 50 0 Coefficient a -1 = 1 a -2 = 0 a -3 = 1 Answer (0. 625)10 = (0. a-1 a-2 a-3 )2 = (0. 101)2 28

The Growth of Binary Numbers n 2 n 0 20=1 8 28=256 1 21=2

The Growth of Binary Numbers n 2 n 0 20=1 8 28=256 1 21=2 9 29=512 2 22=4 10 210=1024 3 23=8 11 211=2048 4 24=16 12 212=4096 5 25=32 20 220=1 M Mega 6 26=64 30 230=1 G Giga 7 27=128 40 240=1 T Tera 29

Binary Addition ° Binary addition is very simple. ° This is best shown in

Binary Addition ° Binary addition is very simple. ° This is best shown in an example of adding two binary numbers… 1 1 1 1 0 1 + 1 0 1 1 1 ----------1 0 1 0 0 1 1 1 carries 30

Binary Subtraction ° We can also perform subtraction (with borrows in place of carries).

Binary Subtraction ° We can also perform subtraction (with borrows in place of carries). ° Let’s subtract (10111)2 from (1001101)2… 1 0 10 10 1 10 0 0 10 borrows 0 0 1 1 1 ------------1 1 0 31

Binary Multiplication ° Binary multiplication is much the same as decimal multiplication, except that

Binary Multiplication ° Binary multiplication is much the same as decimal multiplication, except that the multiplication operations are much simpler… 1 0 1 1 1 X 1 0 1 -----------0 0 0 0 0 1 0 1 1 1 -----------1 1 1 0 0 32

Convert an Integer from Decimal to Octal For each digit position: 1. Divide decimal

Convert an Integer from Decimal to Octal For each digit position: 1. Divide decimal number by the base (8) 2. The remainder is the lowest-order digit 3. Repeat first two steps until no divisor remains. Example for (175)10: Integer Remainder Quotient 175/8 = 21/8 = 21 2 0 + + + 7/8 5/8 2/8 Coefficient a 0 = 7 a 1 = 5 a 2 = 2 Answer (175)10 = (a 2 a 1 a 0)2 = (257)8 33

Convert an Fraction from Decimal to Octal For each digit position: 1. Multiply decimal

Convert an Fraction from Decimal to Octal For each digit position: 1. Multiply decimal number by the base (e. g. 8) 2. The integer is the highest-order digit 3. Repeat first two steps until fraction becomes zero. Example for (0. 3125)10: Integer 0. 3125 x 8 = 0. 5000 x 8 = 2 4 Fraction + + 5 0 Coefficient a -1 = 2 a -2 = 4 Answer (0. 3125)10 = (0. 24)8 34

Summary ° Binary numbers are made of binary digits (bits) ° Binary and octal

Summary ° Binary numbers are made of binary digits (bits) ° Binary and octal number systems ° Conversion between number systems ° Addition, subtraction, and multiplication in binary 35