59
Chapter 1 Basic Principles of Digital Systems

Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

Embed Size (px)

Citation preview

Page 1: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

Chapter 1

Basic Principles of Digital Systems

Page 2: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

2

Analog vs. Digital

• Analog:– A way of representing a physical quantity

by a proportional continuous voltage or current.

• Digital:– A way of representing a physical quantity

in discrete voltage steps.

Page 3: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

3

Analog Electronics

• Values are continuously variable between defined values.

• Can have any value within a defined range.

Page 4: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

4

Analog Electronics

Page 5: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

5

Digital Electronics

• Values can vary only by distinct, or discrete, steps.

• Can only have two values.

Page 6: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

6

Digital Logic Levels

• Logic HIGH is the higher voltage and represented by binary digit ‘1’.

• Logic LOW is the lower voltage and represented by binary digit ‘0’.

Page 7: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

7

Digital Logic Levels

Page 8: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

8

Binary Number System

• Uses two digits, 0 and 1.• Represents any number using the

positional notation.

Page 9: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

9

Positional Notation

• The value of a digit depends on its placement within a number.

• In base 10, the positional values are (starting to the left of the decimal) –1 (100), 10 (101), 100 (102), 1000 (103), etc.

• In base 2, the positional values are1 (20), 2 (21), 4 (22), 8 (23), etc.

Page 10: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

10

Decimal Equivalence of Binary Numbers

13

1048

1)(12)04)(18)(1

)2(1)2(0)2(1)2(1 1101 0123

(

Page 11: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

11

Bit

• Shorthand for binary digit, a logic 0 or 1.• The most significant bit (MSB) is the

leftmost bit of a binary number.• The least significant bit (LSB) is the

rightmost bit of a binary number.

Page 12: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

12

Binary Inputs

• Digital circuits operate by accepting logic levels (0,1) at their input(s).

• The corresponding output(s) logic level will change (0,1).

Page 13: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

13

Binary Inputs

Page 14: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

14

Truth Table

• A list of output logic levels corresponding to all possible input combinations.

• The number of input combinations is 2n, where n is the number of inputs.

Page 15: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

15

Input Combinations

• A logic circuit with 3 inputs will have 23 or 8 possible input conditions.

• For this logic circuit there would also be 8 possible output conditions.

Page 16: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

16

Constructing a Binary SequenceFor a Truth Table – 1

• Two methods:– Learn to count in binary– Follow a simple repetitive pattern

• Memorize the binary numbers from 0000 to 1111 and their decimal equivalents (0 to 15).

• Use the weighted values of binary bits.

Page 17: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

17

Logic Level Binary Value Decimal Equivalent

A B C A B CL L L 0 0 0 0

L L H 0 0 1 1

L H L 0 1 0 2L H H 0 1 1 3

H L L 1 0 0 4H L H 1 0 1 5H H L 1 1 0 6H H H 1 1 1 7

Binary Sequence for a Truth Table – 1

Page 18: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

18

Follow a Simple Repetitive Pattern

• The LSB of any binary number alternates between 0 and 1 with every line.

• The next bit alternates every two lines.• The next bit alternates every four lines,

and so on.

Page 19: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

19

3 Input Truth Table

Decimal Value Binary Value

Base 10 22 21 20

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

Page 20: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

20

4-Input Digital Circuit

• 24 = 16 possible input conditions.

Page 21: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

21

4-Input Digital Circuit

Page 22: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

22

4-Input Digital Circuit

A B C D Decimal A B C D Decimal

(Cont)

0 0 0 0 0 1 0 0 0 8

0 0 0 1 1 1 0 0 1 9

0 0 1 0 2 1 0 1 0 10

0 0 1 1 3 1 0 1 1 11

1 0 0 0 4 1 1 0 0 12

0 1 0 1 5 1 1 0 1 13

0 1 1 0 6 1 1 1 0 14

0 1 1 1 7 1 1 1 1 15

Page 23: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

23

Binary Weights

27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1

Page 24: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

24

Decimal-to-Binary Conversion

• Two methods:– Sum powers of 2– Repeated division by 2

Page 25: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

25

Sum Powers of 2

• Step 1:– Determine the largest power of 2 less than

or equal to the number to be converted.– Place a 1 in that positional location.

Page 26: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

26

Sum Powers of 2

• Step 2:– Subtract the number found in Step 1 from

the number to be converted. – For the new number, determine if the next

lowest power of 2 is less than or equal to that number.

Page 27: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

27

Sum Powers of 2

• Step 3:– If the new power of two from Step 2 is

larger, place a 0 in that positional location. – If the new value is less than or equal, place

a 1 in that positional location.

Page 28: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

28

Sum Powers of 2

• Step 4:– Repeat Steps 2 and 3 until there is nothing

left to subtract. – All remaining bits are set to 0.

Page 29: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

29

Repeated Division by 2

• Step 1:– Take the number to be converted, and

divide it by 2. – The remainder (0 or 1) is the LSB of the

binary value.

Page 30: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

30

Repeated Division by 2

• Step 2:– Divide the quotient from Step 1 by 2. – The remainder (0 or 1) is the next most

significant bit.

Page 31: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

31

Repeated Division by 2

• Step 3:– Continue to execute Step 2 until the

quotient is 0. – The last remainder is the MSB.

Page 32: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

32

Fractional Binary Numbers

• Radix point:– The generalized decimal point. The

dividing line between positive and negative powers for positional multipliers.

• Binary point:– The radix point for binary numbers.

Page 33: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

33

Fractional Binary Values

• The value immediately to the right of the binary point is 2–1 = 0.5.

• The next value to the right is 2–2 = 0.25.• The next value to the right is 2–4 =

0.125, and so on.

Page 34: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

34

Fractional Binary Weights

2-1 2-2 2-3 2-4

½ ¼ 1/8 1/16

0.5 0.25 0.125 0.0625

Page 35: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

35

Binary Fraction

7031250

45/64

1/641/161/801/2

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

)2(1)2(0)2(1 10110106-5-4-

-3-2-1

.

.

Page 36: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

36

Fractional-Decimal-to-Fractional-Binary Conversion

• Step 1:– Multiply the decimal fraction by 2. – The integer part, 0 or 1, is the first bit to the

right of the binary point.

Page 37: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

37

Fractional-Decimal-to-Fractional-Binary Conversion

• Step 2:– Discard the integer part from Step 1 and

repeat Step 1 until the fraction repeats or terminates.

Page 38: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

38

Hexadecimal Numbers

• Base 16 number system.• Primarily used as a shorthand form of

binary numbers.

Page 39: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

39

Counting in Hexadecimal

• Values range from 0 to F with the letters A to F used to represent the values 10 to 15 respectively.

• Positional multipliers are powers of 16:160 = 1, 161 = 16, 162 = 256, etc.

Page 40: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

40

Hexadecimal vs. Decimal Numbers

Decimal

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Hexadecimal

0 1 2 3 4 5 6 7 8 9 A B C D E F

Page 41: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

41

Hex Decimal Binary Hex (Cont)

Decimal Binary

0 0 0000 8 8 1000

1 1 0001 9 9 1001

2 2 0010 A 10 1010

3 3 0011 B 11 1011

4 4 0100 C 12 1100

5 5 0101 D 13 1101

6 6 0110 E 14 1110

7 7 0111 F 15 1111

Page 42: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

42

Counting In Hexadecimal

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F

20,21,22,23,24,25,26,27,28,29,2A,2B,2C,2D,2E,2F

30,31,32,33,34,35,36,37,38,39,3A,3B,3C,3D,3E,3F

Page 43: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

43

Decimal-to-Hexadecimal Conversion

• Two methods:– Sum of weighted hexadecimal digits.– Repeated division by 16.

Page 44: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

44

Hexadecimal Conversion: Method One

• Convert 13510 to hexadecimal:– Since 25610 = 162, the number will have 2

digits.• (9 16) > 135 > (8 16) • 135 – (8 16) = 135 – 128 = 7• (13510 = 8716)

– Verifying:• 135 – ((8 16) + (7 1)) = 135 – 128 – 7 = 0

Page 45: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

45

Conversion Between Hexadecimal and Binary

• Each hexadecimal digit represents 4 binary bits.

Page 46: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

46

Converting FD69H to Binary

HEX F D 6 9

BIN 1111 1101 0110 1001

DEC 15 13 6 9

Page 47: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

47

Periodic Digital Waveforms

• A periodic digital waveform is a time-varying sequence of logic HIGHs and LOWs that repeat over some period of time.

• Period (T) is the time required for the pattern to repeat.

Page 48: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

48

Periodic Digital Waveforms

• Frequency (f) is the number of times per second a signal repeats and is the reciprocal of period.

• f = 1/T

Page 49: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

49

Periodic Digital Waveforms

Page 50: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

50

Aperiodic Digital Waveforms

• An aperiodic digital waveform is a time-varying sequence of logic HIGHs and LOWs that does not repeat.

Page 51: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

51

Aperiodic Digital Waveforms

Page 52: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

52

Waveform Definitions

• Time HIGH (th) is the time a logic signal is in its HIGH state.

• Time LOW (tl) is the time a logic signal is in its LOW state.

• Duty cycle is the ratio of the time a logic signal is HIGH (th) to the period (T).

Page 53: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

53

Duty Cycle

thtl

T

Duty Cycle = th/T

Page 54: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

54

Pulse Waveforms

• A pulse is a momentary variation of voltage from one logic level to the opposite level and back again.

• Amplitude is the voltage magnitude of a pulse.

• Edge is the part of a pulse representing the transition from one logic level to the other.

Page 55: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

55

Pulse Waveforms

Page 56: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

56

Pulse Waveform Characteristics

• Rising edge is the transition from LOW to HIGH.

• Falling edge is the transition from HIGH to LOW.

• Leading edge is the earliest transition.• Falling edge is the latest transition.

Page 57: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

57

Pulse Waveform Characteristics

Page 58: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

58

Pulse Waveform Timing

• Pulse width (tw) is the time from the 50% point of the leading edge to the 50% point of the trailing edge.

• Rise time is the time from 10% to 90% amplitude of the rising edge.

• Fall time is the time from 90% to 10% amplitude of the falling edge.

Page 59: Chapter 1 Basic Principles of Digital Systems. 2 Analog vs. Digital Analog: –A way of representing a physical quantity by a proportional continuous voltage

59

Pulse Waveform Timing