Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 Number Systems and Codes 1. Outline 1. NUMBER SYSTEMS AND CODES 2. DIGITAL ELECTRONIC SIGNALS AND SWITCHES 3. BASIC LOGIC GATES 4. PROGRAMMABLE.

Similar presentations


Presentation on theme: "Chapter 1 Number Systems and Codes 1. Outline 1. NUMBER SYSTEMS AND CODES 2. DIGITAL ELECTRONIC SIGNALS AND SWITCHES 3. BASIC LOGIC GATES 4. PROGRAMMABLE."— Presentation transcript:

1 Chapter 1 Number Systems and Codes 1

2 Outline 1. NUMBER SYSTEMS AND CODES 2. DIGITAL ELECTRONIC SIGNALS AND SWITCHES 3. BASIC LOGIC GATES 4. PROGRAMMABLE LOGIC DEVICES: CPLDS AND FPGAS WITH VHDL DESIGN 5. BOOLEAN ALGEBRA AND REDUCTION TECHNIQUES 6. EXCLUSIVE-OR AND EXCLUSIVE-NOR GATES 7. ARITHMETIC OPERATIONS AND CIRCUITS 8. CODE CONVERTERS, MULTIPLEXERS, AND DEMULTIPLEXERS 9. LOGIC FAMILIES AND THEIR CHARACTERISTICS 10. FLIP-FLOPS AND REGISTERS 11. PRACTICAL CONSIDERATIONS FOR DIGITAL DESIGN

3 Chapter Objectives Determine the weighting factor of each digit position in the decimal, binary, octal, and hexadecimal numbering systems. Convert any number among the four number systems, and its equivalent value in any of the remaining three numbering systems. Describe binary coded decimal (BCD) numbers. Translate alphanumeric data to and from ASCII using the ASCII code translation table. 2

4 Digital versus Analog Digital –OFF and ON states that can be represented using 0s and 1s (respectively). Analog –Continuously varying –Examples: temperature, pressure, velocity 4

5 Digital vs. Analog 5

6 Analog Signal Voltages and Their Digital Equivalents

7 Digital-to-Analog and Back Again 8

8 Binary numbers An electronic signal in logic circuits carries one digit of information. –Each digit is allowed to take on only two possible values, usually denoted as 0 and 1. –-> Information in logic circuits is represented as combinations of 0 and 1 digits. Q: How to represent numbers (E.g., positive integers) using only binary digits 0 and 1? 8

9 Decimal Numbering System (Base 10) 10 possible digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 Least-significant position is on the right end Most-significant position is on the left end Weighting factor of 10 10

10 Cont’ A decimal integer is expressed by an n-tuple comprising n decimal digits D = d n-1 d n-2 ∙ ∙ ∙ d 1 d 0 which represents the value V(D) = d n-1 ×10 n-1 + d n-2 ×10 n-2 + ∙ ∙ ∙ + d 1 ×10 1 + d 0 ×10 0 This is referred to as the positional number representation. 10

11 Binary Numbering System (Base 2) Only two possible digits: 0 and 1 Weighting factor of 2 Conversion techniques –Digit times weighting factor –Successive division 11

12 Binary (base-2) number system Logic circuits use the binary system whose positional number representation is B = b n-1 b n-2 ∙ ∙ ∙ b 1 b 0 V(B) = b n-1 ×2 n-1 + b n-2 ×2 n-2 + ∙ ∙ ∙ + b 1 ×2 1 + b 0 ×2 0 E.g., (1101) 2 = 1×2 3 + 1×2 2 + 0×2 1 +1×2 0 =(13) 10 b n-1 is the most significant bit (MSB), b 0 is the least significant bit (LSB), 12

13 Numbers in decimal and binary Decimal representation Binary representation 000000 010001 020010 030011 040100 050101 060110 070111 081000 Decimal representation Binary representation 091001 101010 111011 121100 131101 141110 151111 13

14 Decimal-to-Binary Conversion - Successive subtraction 12 Power 857 - 512(2 9 ) = 3451MSB - 9 th 345 - 256(2 8 ) = 891 89 - 128(2 7 ) < 00 89 - 64(2 6 ) = 251 25 - 32(2 5 ) < 00 25 - 16(2 4 ) = 91 9 - 8(2 3 ) = 11 1 - 4(2 2 ) < 00 1 - 2(2 1 ) < 00 1 - 1(2 0 ) = 01LSB

15 Method 2 – successive division Remainder 857 / 2 = 4281LSB 428 / 2 = 2140 214 / 2 = 1070 107 / 2 = 531 53 / 2 = 261 26 / 2 = 130 13 / 2 = 61 6 / 2 = 30 3 / 2 = 11 1 / 2 = 01MSB 15

16 Octal Numbering System (Base 8) Eight allowable digits: 0, 1, 2, 3, 4, 5, 6, 7 Weighting factor of 8 13

17 Octal Conversions Binary to octal –Group binary positions in groups of three –Write the octal equivalent Octal to binary –Reverse the process Octal to decimal –Multiply by weighting factors Decimal to octal –Successive division 14

18 Hexadecimal Numbering System (Base 16) 16 allowable digits. –0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F Each hex digit represents a 4-bit group –See Table 1-3 Two hex digits are used to represent 8 bits –8 bits are called a byte –4 bits are called a nibble 15

19 Hexadecimal Numbering System

20 Hexadecimal Conversions Binary-to-hexadecimal conversion –Group the binary in groups of four –Write the equivalent hex digit Hexadecimal-to-binary conversion –Reverse the process 16

21 Hexadecimal Conversions Hexadecimal-to-decimal conversion –Multiply by weighting factors Decimal-to-hexadecimal conversion –Successive division 17

22 Binary-Coded-Decimal System (BCD) Each of the 10 decimal digits is represented by its 4-bit binary equivalent. Decimal-to-BCD conversion –Convert each decimal digit to its 4-bit binary code BCD-to-Decimal conversion –Reverse the process 18

23

24 The ASCII Code American Standard Code for Information Interchange (ASCII) –Represents alphanumeric data –Uses 7 bits 128 different code combinations (see Table 1-5) –3-bit group is most significant –4-bit group is least significant 20

25 21

26 Numbering System Applications Because digital systems must work with 1s and 0s, learning the different numbering systems is important. Which system is used is determined by how the data were developed and how they are to be used. Several numbering system applications follow. 22

27 Application 1-1 22 The four chemical storage tanks shown are monitored for temperature (T) and pressure (P).

28 Application 1-1 (continued) Using the table shown below, interpret the following: –If the computer reads a binary string of 0010 1000 what problems exist? –This indicates that the pressure in tanks C and B are too high. 22 0 0 1 0 1 0 0 0

29 Application 1-1 (continued) Using the table shown below, interpret the following: –If the computer reads a hex value of 55H what problems exist? –Since 55H =0101 0101 This indicates that all tank temperatures are too high. 22 0 1 0 1

30 Application 1-1 (continued) Using the table shown below, interpret the following: –If the temperature and pressure in tanks B and D are too high, what hex value is read by the computer? –This condition would produce a digital output of 1100 1100 = CCH. 22

31 Application 1-1 (continued) Using the table shown below, interpret the following: –Assume that tanks A and B are shut down and all sensors are tied high (1s). What is the lowest decimal value that indicates a problem in the other two tanks? –With the four low-order bits tied high, the lowest value that indicates a problem is 0001 111 or 31 10. 22

32 Application 1-1 (continued) Using the table shown below, interpret the following: –If only tanks A, B, and C are monitored, what octal value indicates tank B has both temperature and pressure problems? –The binary output would be 001 100 2 = 14 8. 22

33 Summary Any number system can be converted to decimal by multiplying each digit by its weighting factor. The weighting factor for the least significant digit in any number system is always 1. Binary numbers can be converted to octal by forming groups of 3 bits and to hexadecimal by forming groups of 4 bits. 29

34 Summary The successive division procedure can be used to convert from decimal to binary, octal, or hexadecimal The binary-coded-decimal system uses groups of 4 bits to drive decimal displays such as those in a calculator. ASCII is used by computers to represent all letters, numbers and symbols in digital form. 30


Download ppt "Chapter 1 Number Systems and Codes 1. Outline 1. NUMBER SYSTEMS AND CODES 2. DIGITAL ELECTRONIC SIGNALS AND SWITCHES 3. BASIC LOGIC GATES 4. PROGRAMMABLE."

Similar presentations


Ads by Google