Digital Logic Design: Number Systems Overview

digital logic design l.w
1 / 47
Embed
Share

Explore the fundamentals of number systems in digital logic design, covering decimal and binary numbers, their representations, operations, and conversions. Learn about the roles of digits, weights, and bases in numerical systems. Dive into examples and methods for converting decimal numbers to binary notation.

  • Digital Logic Design
  • Number Systems
  • Decimal
  • Binary
  • Conversions

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Digital Logic Design CHAPTER II Number System Addis Ababa Science and Technology University College of Electrical and Mechanical Engineering Department of Electronics Engineering Lecturer: Yonas Haregot 3/19/2025 Digital Logic Design 1

  2. Introduction to Numbering System 3/19/2025 Digital Logic Design 2

  3. Decimal Numbers In the decimal number system each of the ten digits 0 through 9 represents a certain quantity. The base(radix) of decimal numbers is 10. The position of each digit in a weight number system is assigned a weight based on the base of the system. The column weights of decimal numbers are powers of ten that increase from right to beginning with 100, 101, 102,103... left 3/19/2025 Digital Logic Design 3

  4. Decimal Numbers For fractional decimal numbers, the column weights are negative powers of ten that decrease from left to right. 102101100. 10-110-210-3 Decimal numbers can be expressed as the sum of the products of each digit times the column values for that digit. Example: 123 1*102+ 2*101+ 3*100 45.367 4*101+ 5*100+ 3*10-1+ 6*10-2+ 7*10-3 3/19/2025 Digital Logic Design 4

  5. Binary Numbers The binary number system is another way to represent quantities. It have two digits: 0 and 1. so it is base 2 system. The position of a 1 and 0 in a binary number indicates weight. The weight of a binary number is based on powers of two. 2423222120 For fractional binary number the weight are negative power of two that decrease from left two right. 2-12-22-32-42-5 3/19/2025 Digital Logic Design 5

  6. Binary Numbers Examples: 1010 1*23+ 0*22+ 1*21+ 1*20 10.01 1*21+ 0*20+ 0*2-1+ 1*2-2 Binary Number Operation: Add & Sub: 1 + 1 = 10 1 1 = 0 0 + 0 = 0 0 0 = 0 1 + 0 = 1 1 0 = 1 - Mul & Div 1 * 1 = 1 1 / 1 = 1 0 * X = 0 3/19/2025 Digital Logic Design 6

  7. Decimal to Binary Numbers For Non Fractional Number Repeated Division by two methods. (160)10 = (10100000)2 3/19/2025 Digital Logic Design 7

  8. Decimal to Binary Numbers For Fractional Number Repeated multiplication by 2. (0.188)10= (0.00110)2 for five significant digits 3/19/2025 Digital Logic Design 8

  9. Binary to Decimal Conversion Any numbering system can be summarized by the following relationship: 3/19/2025 Digital Logic Design 9

  10. Binary to Decimal Conversion Example: (10011011)2= (155)10 (0.1011)2= (0.6875)10 3/19/2025 Digital Logic Design 10

  11. Individual Assignment: Convert the following decimal to binary format: 65 25.4 Convert the following binary to decimal format: 101011 1010.01 3/19/2025 Digital Logic Design 11

  12. 1s compliment representation and 2 s compliment representation 3/19/2025 Digital Logic Design 12

  13. Signed numbers: Methods to represent signed numbers: 1- sign-Magnitude form 2- 1 s compliment representation 3- 2 s compliment representation 3/19/2025 Digital Logic Design 13

  14. Signed Number in Binary Digital handle both positive and negative numbers. A signed binary number consists of both sign and magnitude information. How do you represent a negative number in computers? Use 2 s compliment representation! systems, such as computer, must 3/19/2025 Digital Logic Design 14

  15. Signed Number in Binary 1 s compliment representation: Is just the inverse of a binary number. To form 1 s compliment invert very bit of the number. 1 s compliment of 1001 is 0110. 2 s compliment representation: Found by adding 1 to LSB of the 1 s compliment. 2 s compliment of 1001 is 0110 + 1, which is 0111. Sign-Significant representation: The left most bit is the sign bit and the remaining bit are the magnitude. LSB 1 if negative, 0 if positive 3/19/2025 Digital Logic Design 15

  16. 2s Compliment form There are several ways to represent signed binary numbers. In all cases, the MSB in a signed number is the sign bit, that tells you if the number is positive or negative. Computers use a modified 2 s compliment for signed numbers. Positive numbers are stored in true form and negative are stored in complement form Positive number 0 for sign bit Negative number 1 for sign bit 3/19/2025 Digital Logic Design 16

  17. 2s Compliment form Example: Positive 58 0011010 The MSB (red) is the Sign bit. The rest (green) are the Magnitude bit. Negative 58 (-58) 11000110 The MSB (red) is the Sign bit. The rest (green) are the Magnitude bit. An easy way to read a signed number that uses this notation is to assign the sign bit a column weight of -128 (for an 8-bit number). Then add the column weight for the 1 s. 3/19/2025 Digital Logic Design 17

  18. 2s Compliment form Example: Assuming that the sign bit = -128, show that 11000110 = -58 as a 2 s complement signed number. Column weights: -128+64+0+0 +0+4+2 = -58 3/19/2025 Digital Logic Design 18

  19. Sign-Magnitude Form When a signed binary number is represented in sign-magnitude, the left-most bit is the sign bit and the remaining bits are the magnitude bits. The magnitude complemented) binary for both positive and negative numbers. Example: Represent the decimal number +25 and -25 in 8-bit signed binary number. +25 00011001 bits are the true (un- -25 10011001 In the sign-magnitude form, a negative number has the same magnitude bits as the corresponding positive number but the sign bit is a 1 rather than a zero. 3/19/2025 Digital Logic Design 19

  20. 1s Complement Form Positive numbers in 1 s complement form are represented the same way as positive sign-magnitude numbers. Negative number, however, are the 1 s complements of the corresponding positive numbers. Example: using 8-bit represent +25 and -25 in the 1 s complement form. +25 00011001 -25 11100110 In the 1 s complement form, a negative number is the 1 s complement of the corresponding positive number. 3/19/2025 Digital Logic Design 20

  21. Individual Assignment 1- number in binary 2- with the help of the above listed methods represent (-58) using 8-bit list types of methods to represent signed 3/19/2025 Digital Logic Design 21

  22. Arithmetic Operations with 2s Compliment Signed Numbers 3/19/2025 Digital Logic Design 22

  23. Additions The two numbers in an addition are Augend. The result is Sum. the Addend and the Using the signed number notation with negative numbers in 2 s complement form simplifies addition and substantiation of signed numbers. Rules for addition: Add the two signed numbers. Discard any final carries. The result is in signed form. 3/19/2025 Digital Logic Design 23

  24. Additions Exercise: 0000 1000 + 0000 0011 = ? 0000 1111 + 1111 1010 = ? 0001 0000 + 1110 1000 = ? 1111 1011 + 1111 0111 = ? 3/19/2025 Digital Logic Design 24

  25. Subtractions Subtraction is a special case of addition. For example, subtracting 6 from 9 is equivalent to adding -6 to 9. Basically, the subtraction operation changes the sign of the subtrahend and adds it to the minuend. The result is called the difference. Rules for subtraction: 2 s complement the subtrahend and add the numbers. Discard any final carries. The result is in signed form. 3/19/2025 Digital Logic Design 25

  26. Subtractions Exercise: 0001 1110 0000 1111 = ? 0000 1110 1110 1111 = ? 1111 1111 1111 1000 = ? 3/19/2025 Digital Logic Design 26

  27. Multiplication The multiplicand, the multiplier and the product. The multiplication operation in most computers is accomplished using addition. Multiplication is equivalent to adding a number to itself a number of times equal to the multiplier. When two binary numbers are multiplied, both numbers must be in true (un-complemented) form. numbers in a multiplication are the 3/19/2025 Digital Logic Design 27

  28. Multiplication 3/19/2025 Digital Logic Design 28

  29. Division The numbers in a division are the dividend, the divisor, and the quotient. division accomplished using subtraction is done with adder, division can also accomplished with an adder. The result of a division is called the quotient. The operation in computers is subtraction. Since 3/19/2025 Digital Logic Design 29

  30. Division 3/19/2025 Digital Logic Design 30

  31. Division 3/19/2025 Digital Logic Design 31

  32. Hexadecimal Numbers 3/19/2025 Digital Logic Design 32

  33. Hexadecimal Numbers The hexadecimal number system has sixteen characters; It is used primarily as a compact way of displaying or writing binary numbers. Is widely used in computer and microprocessor applications. Has a base of sixteen. Consists of digits 0-9 and letters A-F. 3/19/2025 Digital Logic Design 33

  34. Hexadecimal Numbers Large binary number can easily be converted to hexadecimal grouping bits 4 at a time and writing the equivalent hexadecimal character. by 3/19/2025 Digital Logic Design 34

  35. Decimal to Hexadecimal Conversion Repeated division of a decimal number by 16 will produce the equivalent hexadecimal number. Example: Converter (2545)10 number. Answer: (9F1)16 to a hexadecimal 16 16 16 2545 159 9 1 15 9 1 F 9 16 0 0 0 The LSB of the result is the first reminder. 3/19/2025 Digital Logic Design 35

  36. Hexadecimal to Decimal Conversion Hexadecimal is a weighted number system. The column weights are powers of 16, which increase from right to left. Example: Express (1A2F)16 in decimal. Start by writing the column weights. A 2 F 162 161 160 1 1(4096) + 10(256) + 2(16) + 15(1) = 1 163 4096 256 16 3/19/2025 Digital Logic Design 36

  37. Binary to Hexadecimal Conversion Larger binary number can be easily converted to hexadecimal by grouping bits 4-bit at a time and writing the equivalent hexadecimal character. Express (1001011000001110)2 hexadecimal. 1001 0110 0000 1110 9 6 0 E So (1001011000001110)2 = (960E)16 Example: in 3/19/2025 Digital Logic Design 37

  38. Hexadecimal to Binary Conversion Example: Convert (95D7)16to binary. 9 5 D 7 1001 0101 1101 0111 So (95D7)16= (1001 0101 1101 0111)2 3/19/2025 Digital Logic Design 38

  39. Octal Number Like the hexadecimal number system, the octal number system provides a convenient way to express binary numbers and codes. it is used hexadecimal in conjunction with computers and microprocessors to express binary quantities for input and output purposes. However less frequently than The octal number system is composed of eight digits, which are; 0 1 2 3 4 5 6 7 3/19/2025 Digital Logic Design 39

  40. Octal Number To distinguish octal numbers from decimal hexadecimal numbers. numbers or We will use the subscript 8 to indicate an octal number. in octal is in decimal For instance, 158 equivalent to 1310 and D16in hexadecimal. 3/19/2025 Digital Logic Design 40

  41. Octal to Decimal Conversion Octal is also a weight number system. The column weights are increase from right to left. powers of 8, which Example: Express 37028in decimal. 3 7 0 2 83 82 81 80 512 64 8 1 3(512) + 7(64) + 0(8) + 2(1) = 3/19/2025 Digital Logic Design 41

  42. Decimal to Octal Conversion A method of converting a decimal number to an octal number is the repeated division-by-8 methods. Example: Convert 35910 to octal number. 35910 = 5478 8 8 8 359 44 5 7 4 5 The first reminder generated is the Least Significant Digit (LSD). 3/19/2025 Digital Logic Design 42

  43. Octal to Binary Conversion Binary number can easily be converted to octal by grouping bits 3 at a time and writing the equivalent octal character for each group. Example: Express (1 001 011 000 001 110)2 in octal. 001 001 011 000 001 110 1 1 3 0 1 6 (1 001 011 000 001 110)2 = (113016)8 3/19/2025 Digital Logic Design 43

  44. Binary Coded Decimal - BCD Binary coded decimal is a way to express each of the decimal digits with a binary code. There are 10 groups in the BCD system. BCD is a weighted code that is commonly used in digital systems when it is necessary to show decimal numbers such as in clock displays. BCD represents each decimal digit with a 4-bit code. Notice that the codes 1010 through 1111 are not use in BCD. 3/19/2025 Digital Logic Design 44

  45. Binary Coded Decimal - BCD 3/19/2025 Digital Logic Design 45

  46. Binary Coded Decimal - BCD For 8-bit BCD number, the column weights are: 80 40 20 10 8 4 2 1 Question: What are the the column weights for the BCD number 1000 0011 0101 1001? Answer: 8000 4000 2000 1000 800 400 200 100 80 40 20 10 8 4 2 1 Note that you could add the column weights where there is a 1 to obtain the decimal number. For this case: 8000+200+100+40+10+8+1 = 835910 3/19/2025 Digital Logic Design 46

  47. Binary Coded Decimal - BCD simply replace each To express any decimal number in BCD, decimal digit with the appropriate 4-bit code. Example: Convert (170)16 to BCD. 1 7 0 0001 0111 0000 So 17010 = 0001011100002 To determine a decimal number from a BCD number. Start at the right most bit and break the code into groups of four bits. Then write the decimal digit represented by each 4-bit group. Example: Convert the BCD number 001101010001 to decimal. 0011 0101 0001 3 5 1 001101010001 35110 3/19/2025 Digital Logic Design 47

Related


More Related Content