Chapter One: Digital Systems and Number Systems PDF

Summary

This document introduces digital systems and various number systems, including decimal, binary, octal, and hexadecimal. It explains the concepts and provides examples for conversions between these systems. The document is aimed at students studying digital techniques.

Full Transcript

Fundamentals of Digital Techniques (CoE132) 1 Chapter One: Digital Systems and Number systems Introduction: A digital system is a combination of devices {mechanical, electrical, photo electronic, …, etc.} arranged to perform certa...

Fundamentals of Digital Techniques (CoE132) 1 Chapter One: Digital Systems and Number systems Introduction: A digital system is a combination of devices {mechanical, electrical, photo electronic, …, etc.} arranged to perform certain functions in which quantities are represented digitally. Digital systems are used in communication, business transactions, traffic control, spacecraft guidance, medical treatment, weather monitoring, the Internet, and many other commercial, industrial, and scientific enterprises. Number Systems: In number system modern method of representing numbers symbolically is based on positional notations. In this method, each number is represented by a string of symbols where each symbol is associated with a specific weight depending upon its positions. The number is formed with the combination of the symbols, each symbol is then called a digit (bit) and the position of each symbol is referred to as the digit position (base). The number system is called depending on the base of system. 1. Decimal Number Systems It is said to be of base (10) since it uses 10 digits {0, 1, 2, 3, ……, 9}. A decimal number has two parts, integer and fractional part. The integer part is converted by successive division method and the fractional part is converted by successive multiplication method. Ex. 1: (3528)10 = 3 × 103 + 5 × 102 + 2 × 101 + 8 × 100 Ex. 2: (0.421)10 = 0  10 0 + 4  10 −1 + 2  10 −2 + 1  10 −3 = 0.421. Ex. 3: (26.57)10 = 2 × 101 + 6 × 100 + 5 × 10-1 + 7 × 10-2. In General In order to convert any (N) number system to the decimal number system, use the following: a n a n −1....a1 a 0.a −1 a − 2.....a m = a 0  N 0 + a1  N 1 + a n −1  N n −1 + a n  N n + a −1  N −1 + a − 2  N −2 + a m  N m Where; N is the base of the system. Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 2 2. Binary Number Systems Binary number system uses two symbols 0 and 1 and its radix is 2. The symbols 0 and 1 are generally called BITS. The bit at the extreme left of a binary number has the highest positional value and is usually called the Most Significant Bit or MSB. Similarly, the bit occupying the extreme right position of a given binary number has the least positional value and is referred to as the Least Significant Bit or LSB. Binary to Decimal Conversion Ex.: Convert the following binary number systems to decimal system: 1. (101101)2 = 1 × 25 + 0 × 24 + 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 32 + 0 + 8 + 4 + 0 + 1 = (45)10. 2. (111.1011)2 = 1 × 22 + 1 × 21 + 1 × 20 + 1 × 2-1 + 0 × 2-2 + 1 × 2-3 + 1 × 2-4 = 4 + 2 + 1 + 0.5 + 0 + 0.125 + 0.0625 = (7.6875)10. Ex.: Convert the following number system to decimal system: (4021.2)5 = 1 5 0 + 2  51 + 0  5 2 + 4  53 + 2  5 −1 =(511.4)10. Decimal to Binary Conversion Ex. 1: Convert the decimal number to binary number The arithmetic process can be manipulated more conveniently as follows: Integer Remainder 139 ÷ 2 1 (LSB) 69 ÷ 2 1 34 ÷ 2 0 17 ÷ 2 1 8÷2 0 4÷2 0 2÷2 0 1 1 (MSB) So, (139)10 = (10001011)2 Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 3 Ex. 2: Convert the decimal number [27.15] to binary number The arithmetic process can be manipulated more conveniently as follows: Integer Remainder 27 ÷ 2 1 (LSB) 13 ÷ 2 1 6÷2 0 3÷2 1 1 1 (MSB) 10 = (11011)2 Now the fraction part of the above number is: (0.15)10 Fraction Coefficient 0.15 × 2= 0.3 0 (MSB) 0.3 × 2=0.6 0 0.6 × 2=1.2 1 1.2 × 2=0.4 0 0.4 × 2=0.8 0 0.8 × 2=1.6 1 1.6 × 2=1.2 1 (LSB) [0.15]10 = (0.0010011)2 So, [27.15]10 = (11011.0010011)2 Note: Conversion from decimal integers to any base‐r system is similar to this example, except that division is done by r instead of 2. Ex.: Convert the decimal number [22.5] to 4 base number system: The arithmetic process can be manipulated more conveniently as follows: Integer Remainder 22 ÷ 4 2 (LSB) 5÷4 1 1 1 (MSB) 10 = (112)4 Fraction Coefficient 0.5 × 4= 2.0 2 (MSB) 2.0 × 4=0.0 0 (LSB) Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 4 [0.5]10 = (0.2)4 So, [22.5]10 = (112.2)4 H.W: Convert the following numbers: 1. (945.304)10 ( )2 2. (753.24)10 ( )6 3. (11101.1101)2 ( )10 3. Octal Number Systems Octal number system has a base or radix 8. Eight different symbols, namely 0, 1, 2, 3, 4, 5, 6, 7 are used to represent octal numbers. Conversion of octal numbers to their decimal equivalents can be accomplished by using the same rule which was followed to convert binary numbers to decimal numbers, except that we now have a radix 8 instead of 2. Ex. 1: Convert the following octal number systems to decimal system: 1. (273)8 = 2 × 82 + 7 × 81 + 3 × 80 = 128 + 56 + 3 = (187)10. 2. (437.5)8 = 4 × 82 + 3 × 81 + 7 × 80 + 5 × 8-1 = (287.625)10. Ex. 2: Convert the decimal number [245.5] to octal number system The arithmetic process can be manipulated more conveniently as follows: Integer Remainder 245 ÷ 8 5 (LSB) 30 ÷ 8 6 3 3 (MSB) 10 = (365)8 Fraction Coefficient 0.5 × 8 = 4.0 4 (MSB) 4.0 × 8 = 0.0 0 (LSB) [0.5]10 = (0.4)4 So, [245.5]10 = (365.4)8 Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 5 4. Hexadecimal Number Systems The hexadecimal number system has a radix or base 16. It requires 16 symbols to represent a number in this system. The symbols are 0 to 9, A, B, C, D, E, F where the symbols A, B, C, D, E, F represent the decimal numbers 10, 11, 12, 13, 14, 15 respectively. Ex. 1: Convert the following Hexadecimal number systems to decimal system: 1. (B6A)16 = 11 × 162 + 6 × 161 + 10 × 160 = 2816 + 96 + 10 = (2922)10. 2. (2C.4A)16 = 2 × 161 + 12 × 160 + 4 × 16-1 + 10 × 16-2 = (44.2)10. Ex. 2: Convert the decimal number [165.25] to hexadecimal number system The arithmetic process can be manipulated more conveniently as follows: Integer Remainder 165 ÷ 16 5 (LSB) (10) A A (MSB) 10 = (A5)16 Fraction Coefficient 0.25 × 16 = 4.0 4 (MSB) 4.0 × 16 = 0.0 0 (LSB) [0.25]10 = (0.4)16 So, [165.25]10 = (A5.4)16 H.W: Convert the following numbers: 1. (313.22)4 ( )16 2. (BA.C)16 ( )3 3. (D.C3)14 ( )11 4. (1A.6)16 ( )7 5. (435.3)6 ( )2 Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 6 Conversion between Binary & Octal systems The conversion between Binary and Octal is accomplished by partitioning the binary number into groups of three digits. Octal Binary 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 Ex. 1: Convert the octal number [417.46] to binary number system (417.46)8 = (100001.100110)2 Ex. 2: Convert the binary number (1011011.11011) to octal system (001011011.110110)2 = (001011011.110110)2 = (133.66)8 Conversion between Binary & Hexadecimal systems The conversion between Binary and Hexadecimal is accomplished by partitioning the binary number into groups of four digits. Hexadecimal Binary 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 A 1010 B 1011 C 1100 D 1101 E 1110 F 1111 Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 7 Ex. 1: Convert the Hexadecimal number [F67.19] to binary number system: (A82.09)16 = (101010000010.00001001)2 Ex. 2: Convert the binary number (10100111011.0110101) to hexadecimal system (010100111011.01101010)2 = (010100111011.01101010)2 = (53B.6A)16 H.W: Convert the following numbers: 1. (1101011.01001)2 ( )8 2. (DF3.C5)16 ( )2 3. (110101.001)2 ( )16 Counting in different number systems There are two types of counting: 1. Increasing Counting 2. Decreasing Counting Ex. 1: Count the numbers [4 – 40] in fifth number system Sol.: 04, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 30, 31, 32, 33, 34, 40. Increasing Counting Ex. 2: Count the numbers from (10)13 to (30)13: Sol.: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 2A, 2B, 2C, 30. Increasing Counting Ex. 3: Count the numbers from (40)11 to (5)11: Sol.: 40, 3A, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 2A, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 0A, 9, 8, 7, 6, 5. Decreasing Counting Ex. 4: Count the numbers from (70)8 to (20)8: Sol.: 70, 67, 66, 65, 64, 63, 62, 61, 60, 57, 56, 55, 54, 53, 52, 51, 50, 47, 46, 45, 44, 43, 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, 30, 27, 26, 25, 24, 23, 22, 21, 20. Decreasing Counting H.W: In base , list the numbers between (3 and 50). Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 8 Arithmetic operations on Binary numbers Binary arithmetic is used in digital systems mainly because the numbers (decimal and floatingpoint numbers) are stored in binary format in most computer systems. All arithmetic operations such as addition, subtraction, multiplication, and division are done in binary representation of numbers. It is necessary to understand the binary number representation to figure out binary arithmetic in digital computers. 1) Addition operation The simplest arithmetic operation in binary is addition. In addition: A+B=B+A There are five rules of binary addition Ex.: Add; (1011.01 + 101.101)2 1011.010 + 0101.101 (10000.111)2 2) Subtraction operation 0–0 =0 0–1 = 1, and barrow 1 from the next column 1–0 =1 1–1 =0 Ex.: Subtract; (1000.01 – 11.001)2 1000.010 – 0011.001 (101.001)2 3) Multiplication operation There are four rules of binary multiplication. Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 9 Ex.: Multiply; (11.01 × 1.01)2 1101 × 101 1101 + 00000 110100 (100.0001)2 4) Devision operation 0÷0 = undefined 1÷0 = undefined 0÷1 =0 1÷1 =1 Ex.: Divide (1001110)2 by (100)2 The final result: (10011.1)2 R – Base Arithmetic operations Ex.: Evaluate the following: 1. (50.27 )9 + (15.28)9 50.27 + 15.28 (65.56)9 Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 10 2. (42.51)8 – (15.3)8 3 (2+8) 42.51 – 15.30 (25.21)8 3. (33.2)5 × (14.21)5 1421 332 × 3342 103130 + 1031300 (1143.322)5 H.W: Perform the following operations: 1. (B3)16 + (4D)16 2. (44.56)7 + (12.5)6 3. (B3)13 × (6.55)13 4. (1101.01)2 ÷ (10)2 Complements of Numbers In digital systems, the complements are used to simplify the subtraction operation. There are two types of complements for r – base system: r 's complement. (r – 1)'s complement. Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 11 In binary system, there are 2's complement and 1's complement which represent the negative form of binary number. 1. The first complement (1's) are changed zeros to ones and ones to zeros. 1's Ex.: (01001.1101)2 (10110.0010)2 2. The second complement (2's) can be either leaving least significant zeros and ones digit unchanged then replacing 1's to 0's and 0's to 1's; or by forming 1's complement and adding {1} for the least significant bit. 2's Ex.: (110101)2 ( )2's 1's (110101)2 (001010 )1's + 1= (001011)2's Subtraction using Complements In digital computer, if the subtraction implemented, we use the complements and addition as shown: 1) Convert the second number using 1's or 2's complement. 2) Replace the subtraction operation to addition operation. Ex. 1: Perform the following operation using 2's complement. (1010100)2 – (1000100)2 1's (1000100)2 (0111011)1's +1 = (0111100)2's 1010100 + 0111100 1 0010000 ….. (0010000)2 Ignored Ex. 2: Perform the following operation using 2's complement. (1010011.01)2 – (0101100.10)2 1's (0101100.10)2 (1010011.01)1's +1 =(1010011.10)2's Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 12 1010011.01 + 1010011.10 1 0100110.11 ….. (0100110.11)2 Ignored Ex. 3: Perform the following operation using 1's complement. (1010111)2 – (0110110)2 1's (0110110)2 (1001001)1's 1010111 + 1001001 1 0100000 1 + (100001)2 Ex. 4: Find the complement to the number [DB4.3C1]14. DDD.DDD – DB4.3C1=(29.A1C)13 + 1 = (2A.A1C)14 Ex. 5: Evaluate the following operation [C6B.33 - B65.5C]13, using 12's complement CCC.CC – B65.5C (167.70)12's + C6B.33 (1105.A3)13 H.W: Perform the following operations: 1. Subtract the binary number (1011011)2 from (1101100)2 using 1's complement. 2. (44.56)8 – (12.5)8 using 2's complement. 3. Find the complements of the decimal number (3421.95). Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 13 Binary Logic Gates 1. AND Gate: The number of inputs = n The number of combination states = 2𝑛 The number of output = 1 Example: For 2 number inputs AND Gate (A & B): The number of combination states = 2𝑛 = 22 = 4. The number of output = 1 A B Z 0 0 0 0 1 0 AND Gate Truth Table 1 0 0 1 1 1 Z = A.B = AB … Characteristic equation of AND Gate. 2. OR Gate: The number of inputs = n The number of combination states = 2𝑛 The number of output = 1 Example: For 2 number inputs OR Gate (A & B): The number of combination states = 2𝑛 = 22 = 4. The number of output = 1 Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 14 A B Z 0 0 0 0 1 1 OR Gate Truth Table 1 0 1 1 1 1 Z=A+B … Characteristic equation of OR Gate. 3. NOT Gate: It has only one input and one output. x y 0 1 NOT Gate Truth Table 1 0 𝑦 = 𝑥̅ … Characteristic equation of NOT Gate. 4. NAND Gate: The number of inputs = n The number of combination states = 2𝑛 The number of output = 1 Example: For 2 number inputs NAND Gate (A & B): The number of combination states = 2𝑛 = 22 = 4. The number of output = 1 Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 15 x y Z 0 0 1 0 1 1 NAND Gate Truth Table 1 0 1 1 1 0 𝑍 = 𝑥𝑦 ̅̅̅ … Characteristic equation of NAND Gate. 5. NOR Gate: The number of inputs = n The number of combination states = 2𝑛 The number of output = 1 Example: For 2 number inputs NAND Gate (A & B): The number of combination states = 2𝑛 = 22 = 4. The number of output = 1 x y Z 0 0 1 0 1 0 NOR Gate Truth Table 1 0 0 1 1 0 𝑍 = ̅̅̅̅̅̅̅ 𝑥+𝑦 … Characteristic equation of NOR Gate. Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 16 6. Exclusive OR (Ex – OR) Gate: The number of inputs = 2 The number of output = 1 x y Z 0 0 0 0 1 1 Ex - OR Gate Truth 1 0 1 Table 1 1 0 𝑍 =𝑥⊕𝑦 … Characteristic equation of XOR Gate. 7. Exclusive NOR (Ex – NOR) Gate: The number of inputs = 2 The number of output = 1 A B Y 0 0 1 0 1 0 Ex - NOR Gate Truth Table 1 0 0 1 1 1 ̅̅̅̅̅̅̅̅ 𝑌=𝐴 ⊕𝐵 … Characteristic equation of XNOR Gate. Created by: Dr. Atheel Kadiem Fundamentals of Digital Techniques (CoE132) 17 Created by: Dr. Atheel Kadiem

Use Quizgecko on...
Browser
Browser