Anda di halaman 1dari 60

Advanced Digital Electronics (ET103M)

Recommended Text
1. Digital Systems - Principles and Applications, Ronald J. Tocci., Neal S. Widmer & Gregory L. Moss. Prentice Hall International, 9th Edition 2. Digital Fundamentals, Thomas L. Floyd, Pearson, 10th Edition 3. Digital Design, M. Mano & Michael Cilettiee, Prentice Hall, 2007, 4th Edition 4. Digital Design: Principles and Practices, John F. Wakerly, Prentice Hall, 2007, 4th Edition 5. Digital Logic Circuit Analysis and Design, V.Nelson, H. Nagle, B. Carrol, D.Irwin, Prentice Hall, 1995

Chapter 1 Number Systems and Codes

Numerical Representations
Physical systems use quantities which must be manipulated arithmetically. Quantities may be represented numerically in either analog or digital form. Analog Representationa continuously variable, proportional indicator.
Sound through a microphone causes voltage changes. Automobile speedometer changes with speed. Mercury thermometer varies over a range of values with temperature.
4

Numerical Representations
In 1875, Alexander Graham Bell figured out how to change his voice into a continuously variable electrical signal, send it through a wire, and change it back to sound energy at the other end.

Today, the device that converts sound energy to an analog voltage signal is known as a microphone.
5

Numerical Representations

Digital Representationvaries in discrete (separate) steps.


Passing time is shown as a change in the display on a digital clock at one minute intervals. A change in temperature is shown on a digital display only when the temperature changes at least one degree.

Digital and Analog Systems

Digital system:
A combination of devices that manipulate values represented in digital form.

Analog system:
A combination of devices that manipulate values represented in analog form.

Digital and Analog Systems


Advantages of digital:
Ease of design Well suited for storing information. Accuracy and precision are easier to maintain. Programmable operation. Less affected by noise. Ease of fabrication on IC chips.

Digital and Analog Systems

There are limits to digital techniques:


The analog nature of the world requires a time consuming conversion process:
1. 2. 3. 4. Convert the physical variable to an electrical signal (analog). Convert the analog signal to digital form. Process (operate on) the digital information. Convert the digital output back to real-world analog form.

Digital and Analog Systems


A digital system is a combination of devices designed to manipulate logical information or physical quantities represented in digital form.
Quantities can take on only discrete values.

An analog system manipulates physical quantities represented in analog form.


Quantities can vary over a continuous range of values.

10

Digital and Analog Systems


Temperature-regulation system using an analog-to-digital converter.

11

Digital and Analog Systems


Chief reasons for the shift to digital technology:
Digital systems are generally easier to design. Information storage is easy. Accuracy and precision are easier to maintain throughout the system. Operations can be programmed. Digital circuits are less affected by noise. More digital circuitry can be fabricated on IC chips.
12

Digital Number Systems


Understanding digital systems requires an understanding of the decimal, binary, octal, and hexadecimal numbering systems.
Decimal 10 symbols (base 10) Hexadecimal 16 symbols (base 16) Octal 8 symbols (base 8) Binary 2 symbols (base 2)

13

Digital Number Systems


The Decimal (base 10) System
10 symbols: 0, 1, 2, 3, 4, 5, 6 , 7, 8, 9.
Each number is a digit (from Latin for finger).

Most significant digit (MSD) & least significant digit (LSD). Positional value may be stated as a digit multiplied by a power of 10.
14

Digital Number Systems

Decimal Counting

15

Digital Number Systems


The Binary (base 2) System
2 symbols: 0,1
Lends itself to electronic circuit design since only two different voltage levels are required.

Positional value may be stated as a digit multiplied by a power of 2.

16

Digital Number Systems

Binary Counting

17

Representing Binary Quantities

Analog signals can be converted to digital by taking measurements or samples of the continuously varying signal at regular intervals.
Appropriate time between samples depends on the maximum rate of change of the analog signal.

18

Representing Binary Quantities


Air temperature is an analog quantity.
Recorded samples are discrete integer data.

19

Representing Binary Quantities


Typical representation of the two states of a digital signal.

A higher range of voltages represent a valid 1 and a lower range of voltages represent a valid 0. HIGH and LOW are often used to describe the states of a digital systeminstead of 1 and 0

20

Representing Binary Quantities


Two state devices:
Light bulb (off or on) Diode (conducting or not conducting) Relay (energized or not energized) Transistor (cutoff or saturation) Photocell (illuminated or dark)

21

Representing Binary Quantities


The oscilloscope and logic analyzer are used to produce timing diagrams.
Timing diagrams show voltage versus time.
Used to show how digital signals change with time, or to compare two or more digital signals.

Horizontal scale represents regular intervals, starting at time zero.

22

Digital Circuits/Logic Circuits

Digital circuits - produce & respond to predefined voltage ranges.


The term logic circuits is used interchangeably.

23

Digital Circuits/Logic Circuits


A digital circuit responds to an inputs binary level of 0 or 1not to its actual voltage.

24

Binary to Decimal Conversion


Convert binary to decimal by summing the positions that contain a 1:

An example with a greater number of bits:

25

Decimal to Binary Conversion


Reverse process described in 2-1.
Note that all positions must be accounted for.

Another example:

26

Decimal to Binary Conversion


Repeated Division
Divide the decimal number by 2. Write the remainder after each division until a quotient of zero is obtained. The first remainder is the LSB. The last is the MSB.

27

Decimal to Binary Conversion


Repeated Division
This flowchart describes the process and can be used to convert from decimal to any other number system.

28

Decimal to Binary Conversion


Convert 3710 to binary:

29

Hexadecimal Number System


Hexadecimal allows convenient handling of long binary strings, using groups of 4 bitsBase 16
16 possible symbols: 0-9 and A-F

30

Hexadecimal Number System

Relationships between hexadecimal, decimal, and binary numbers.

31

Hexadecimal to Decimal
Convert from hex to decimal by multiplying each hex digit by its positional weight.

In a 2nd example, the value 10 was substituted for A and 15 substituted for F.

For practice, verify that 1BC216 is equal to 710610

32

Decimal to Hexadecimal
Convert from decimal to hex by using the repeated division method used for decimal to binary conversion. Divide the decimal number by 16
The first remainder is the LSBthe last is the MSB.

33

Decimal to Hexadecimal
Convert 42310 to hex:

34

Decimal to Hexadecimal
Convert 21410 to hex:

35

Hexadecimal to Binary

For practice, verify that BA616 = 1011101001102

36

Binary to Hexadecimal
Convert from binary to hex by grouping bits in four starting with the LSB.
Each group is then converted to the hex equivalent The binary number is grouped into groups of four bits & each is converted to its equivalent hex digit.

For practice, verify that 101011111 2 = 15F16


37

Decimal to Hex to Binary


Convert decimal 378 to a 16-bit binary number by first converting to hexadecimal.

38

Decimal to Hex to Binary

To perform conversions between hex & binary, it is necessary to know the four-bit binary numbers (0000 - 1111), and their equivalent hex digits.

39

Counting in Hex
When counting in hex, each digit position can be incremented (increased by 1) from 0 to F.
On reaching value F, it is reset to 0, and the next digit position is incremented.
Example: 38,39,3A,3B,3C,3D,3E,3F,40,41,42
When there is a 9 in a digit position, it becomes an A when it is incremented.

With three hex digits, we can count from 00016 to FFF16 which is 010 to 409510 a total of 4096 = 163 values.

40

Octal Number System


Octal numbers are base 8 Octal has 8 digits: 0, 1, 2, 3, 4, 5, 6, 7

41

Octal to Decimal
Convert from octal to decimal by multiplying each octal digit by its positional weight.
3728 = 3 82 + 7 81 + 2 80 = 3 64 + 7 8 + 2 1 = 25010 24.68 = 2 81 + 4 80 + 6 8-1 = 20.7510

For practice, verify that 2638 is equal to 17910

42

Decimal to Octal
Convert 26610 to octal:
Steps: 1. Divide the decimal by 8 until the quotient is 0 2. The remainders are the coefficients 3. The octal number is the reverse order of the remainders

43

Conversion between Octal & Binary


Each Octal digit equals to 3 bits

44

Conversion among number systems

45

1s Complement Number System


Positive numbers and the corresponding negative numbers complement each other Complement is inversion (Logic NOT)

e.g. 01101 = +13 10010 = -13 e.g. 00000 = +0 11111 = -0


Disadvantage (a): 2 patterns represent 0 (b): Handle sign bit separately
46

2s Complement Number System


Positive numbers and Negative numbers are their corresponding 1s complement number + 1 e.g. 01101 = +13 10010 + 1 = 10011 = -13 e.g. 00000 = +0 11111 + 1 = 00000 = +0 Advantage (a): only 1 pattern represents 0 (b): handle sign bit as other bits
47

2s Complement Number Conversion


To obtain the negative value of a number in 2s complement system, we invert ALL the bits and add 1 to it e.g. 5 = 00101 -5 = 11010 + 1 = 11011 e.g. -5 = 11011 5 = 00100 + 1 = 00101 This process is called: take the 2s complement
48

2s Complement Number Conversion


In 2s complement number system, the MSB also indicates the sign. 0 for positive and 1 for negative

49

2s Complement Number Conversion


To find the 2s complement number for a negative decimal, we can find the binary of the positive decimal and then take its 2s complement

50

Value Range
For 4-bit binary, the range is:

51

BCD Code
Binary Coded Decimal (BCD) is a widely used way to present decimal numbers in binary form.
Combines features of both decimal and binary systems.
Each digit is converted to a binary equivalent.

BCD is not a number system.


It is a decimal number with each digit encoded to its binary equivalent.

A BCD number is not the same as a straight binary number.


The primary advantage of BCD is the relative ease of converting to and from decimal.
52

BCD Code
Convert the number 87410 to BCD:
Each decimal digit is represented using 4 bits.
Each 4-bit group can never be greater than 9.

Reverse the process to convert BCD to decimal.

53

BCD Code
Convert 0110100000111001 (BCD) to its decimal equivalent.

Divide the BCD number into four-bit groups and convert each to decimal.

54

BCD Code
Convert BCD 011111000001 to its decimal equivalent.

The forbidden group represents an error in the BCD number.

55

Decimal to BCD Conversion

56

Gray Code

57

Gray Code
The Gray code is used in applications where numbers change rapidly.
Only one bit changes from each value to the next.

Three bit binary and Gray code equivalents.

58

4 bit Gray Code

59

Summary
Ch1 1.1 1.2 Understand Number Systems and Codes Distinguish between analogue and digital quantities. Explain how to convert from binary to decimal and vice Summary versa, and to express an integer value in any of the four numbering systems (binary, octal, decimal and hexadecimal) Explain how integers are expressed using 1's complement, 2's complement. Describe the BCD and Gray Code formats
60

1.3 1.4

Anda mungkin juga menyukai