1 / 41

Lecture No. 4

Lecture No. 4. Number Systems. 32-bit f.p. number (recap). 32-bit Floating point format Sign bit 1 Exponent bits 8 Mantissa bits 23 Exponent represented as Biased 127. Range of f.p. numbers (recap). Largest positive/negative number 2 127 Smallest positive/negative number 2 -126

Download Presentation

Lecture No. 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture No. 4 Number Systems

  2. 32-bit f.p. number (recap) • 32-bit Floating point format • Sign bit 1 • Exponent bits 8 • Mantissa bits 23 • Exponent represented as Biased 127

  3. Range of f.p. numbers (recap) • Largest positive/negative number • 2127 • Smallest positive/negative number • 2-126 • The number Zero • Exponent = 00000000 Mantissa = 000 0000 0000 0000 0000 0000 • The number infinite • Exponent = 11111111 Mantissa = 000 0000 0000 0000 0000 0000

  4. Arithmetic operations on floating point numbers • Addition • Adding mantissas after adjusting exponents • Subtraction • Subtracting mantissas after adjusting exponents • Multiplication • Multiplying mantissas and adding exponents • Division • Dividing mantissas and subtracting exponents

  5. 64-bit f.p. number (recap) • 64-bit Double-Precision floating Point format • Sign bit 1 • Exponent bits 11 • Mantissa bits 52 • Exponent represented as Biased 1023

  6. f.p. numbers (recap) • How do systems differentiate between number representations? • Defining and Declaring Data Types.

  7. Hexadecimal Numbers (recap) • Hexadecimal Number System • Base 16 number system • 0 to F • Used to represent large binary numbers

  8. Counting in Hexadecimal (recap)

  9. Binary-Hexadecimal conversion (recap) • Binary to Hexadecimal Conversion • 11010110101110010110 • 1101 0110 1011 1001 0110 • D 6 B 9 6 • Hexadecimal to Binary Conversion • FD13 • 1111 1101 0001 0011

  10. Hexadecimal-decimal conversion (recap) • Hexadecimal to Decimal Conversion • Indirect Method • Hexadecimal →Binary → Decimal • Sum-of-Weights

  11. Decimal-Hexadecimal Conversion (recap) • Decimal to Hexadecimal Conversion • Indirect Method • Decimal →Binary → Hexadecimal • Repeated Division by 16

  12. Hexadecimal Arithmetic (recap) • Hexadecimal Addition • Carry generated • Hexadecimal Subtraction • Borrow weight 16

  13. Octal Number System • Base 8 • 0, 1, 2, 3, 4, 5, 6, 7 • Representing Binary in compact form • 11011000001102 = 154068 • Not commonly used in the presence of Hexadecimal Number System

  14. Counting in Octal • Octal digit represented by a 3-bit binary • Decimal 8 represented by 2-digit Octal

  15. Counting in Octal

  16. Counting in Octal

  17. Binary-Octal Conversion • Binary to Octal Conversion • Octal to Binary Conversion

  18. Octal-Decimal Conversion • Octal to Decimal Conversion • Indirect Method • Octal →Binary → Decimal • Sum-of-Weights

  19. Decimal-Octal Conversion • Decimal to Octal Conversion • Indirect Method • Decimal →Binary → Octal • Repeated Division by 8

  20. Octal Addition & Subtraction • Octal Addition • Carry generated • Octal Subtraction • Borrow weight 8

  21. Binary to Octal Conversion • 011010110101110010110 • 011 010 110 101 110 010 110 • 3 2 6 5 6 2 6 • 1011011101001 • 1 011 011 101 001 • 001 011 011 101 001 • 1 3 3 5 1

  22. Octal to Binary Conversion • 1726 • 001 111 010 110

  23. Sum-of-Weights 4037 (4 x 83) + (0 x 82) + (3 x 81) + (7 x 80) (4 x 512) + (0 x 64) + (3 x 8) + (7 x 1) 2048 + 0 + 24 + 7 2079

  24. Repeated Division by 8

  25. Octal Addition Carry 1 7602 + 4771 14573

  26. Octal Subtraction Borrow 11 7602 - 4771 2611

  27. Alternate Representations • Excess Code • BCD Code • Gray Code

  28. Excess Code • A bias is added to Binary Code • Used by floating point numbers

  29. Excess-8 Code

  30. BCD (Binary Coded Decimal) Code • Binary Code to represent decimal digits 0-9 • Used by Decimal Number Displays

  31. BCD (Binary Coded Decimal) Code

  32. BCD Addition 23 0010 0011 45 0100 0101 68 0110 1000 23 0010 0011 49 0100 1001 72 0110 1100 • 1100 is illegal BCD number

  33. BCD Addition • Add a 0110 (6) to an invalid BCD number • Carry added to the most significant BCD digit 23 0010 0011 49 0100 1001 72 0110 1100 0110 0111 0010

  34. Gray Code • Binary Code more than 1 bit change • Electromechanical applications of digital systems restrict bit change to 1 • Shaft encoders • Braking Systems • Un-Weighted Code

  35. Gray Code

  36. Gray Code Application

  37. Alphanumeric Code • Numbers, Characters, Symbols • ASCII 7-bit Code • American Standard Code for Information Interchange • 10 Numbers (0-9) • 26 Lower Case Characters (a-z) • 26 Upper Case Characters (A-Z) • 32 Control Characters • Punctuation and Symbols

  38. Alphanumeric Code • Extended ASCII 8-bit Code • Additional 128 Graphic characters • Unicode 16-bit Code

  39. ASCII Code • Numbers 0 to 9 • ASCII 0110000 (30h) to 0111001 (39h) • Alphabets a to z • ASCII 1100001 (61h) to 1111010 (7Ah) • Alphabets A to Z • ASCII 1000001 (41h) to 1011010 (5Ah) • Control Characters • ASCII 0000000 (0h) to 0011111 (1Fh)

  40. Error Detection • Digital Systems are very Reliable • Errors during storage or transmission • Parity Bit • Even Parity • Odd Parity

  41. Odd Parity Error Detection • Original data 10011010 • With Odd Parity 110011010 • 1-bit error 110111010 • Number of 1s even indicates 1-bit error • 2-bit error 110110010 • Number of 1s odd no error indicated • 3-bit error 100110010 • Number of 1s even indicates error

More Related