1 / 44

NUMBER SYSTEMS AND CODES

NUMBER SYSTEMS AND CODES. Outline. Number systems Number notations Arithmetic Base conversions Signed number representation Codes Decimal codes Gray code Error detection code ASCII code. Number Systems.

Download Presentation

NUMBER SYSTEMS AND CODES

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. NUMBER SYSTEMS AND CODES

  2. Outline • Number systems • Number notations • Arithmetic • Base conversions • Signed number representation • Codes • Decimal codes • Gray code • Error detection code • ASCII code Number Systems and Codes

  3. Number Systems The decimal (real), binary, octal, hexadecimal number systems are used to represent information in digital systems. Any number system consists of a set of digits and a set of operators (+, , , ). Number Systems and Codes

  4. Radix or Base Theradix or base of the number system denotes the number of digits used in the system. Number Systems and Codes

  5. Number Systems and Codes

  6. Positional Notation It is convenient to represent a number using positional notation. A positional notation is written as a sequence of digits with a radix point separating the integer and fractional part. where r is the radix, n is the number of digits of the integer part, and m is the number digits of the fractional part. Number Systems and Codes

  7. Polynomial Notation A number can be explicitly represented in polynomial notation. where rpis a weighted position and p is the position of a digit. Number Systems and Codes

  8. Examples In binary number system In octal number system In hexadecimal number system Number Systems and Codes

  9. Arithmetic Addition: In binary number system, Number Systems and Codes

  10. Addition In octal number system, In hexadecimal number system, Number Systems and Codes

  11. Subtraction In binary number system, Number Systems and Codes

  12. Subtraction In octal number system, In hexadecimal number system, Number Systems and Codes

  13. Multiplication In binary number system, Number Systems and Codes

  14. Division In binary number system, Number Systems and Codes

  15. Base Conversions Convert (100111010)2 to base 8 Number Systems and Codes

  16. Base Conversion Convert (100111010)2 to base 10 Number Systems and Codes

  17. Base Conversion Convert (100111010)2 to base 16 Number Systems and Codes

  18. Base Conversion from base 8 • Convert (372)8 to base 2 • Convert (372)8 to base 10 • Convert (372)8 to base 16 Number Systems and Codes

  19. Base Conversion from base 16 • Convert (9F2)16 to base 2 • Convert (9F2)16 to base 8 • Convert (9F2)16 to base 10 Number Systems and Codes

  20. Binomial expansion (series substitution) To convert a number in base r to base p. • Represent the number in base p in binomial series. • Change the radix or base of each term to base p. • Simplify. Number Systems and Codes

  21. Convert Base 10 to Base r Convert (174)10 to base 8 Therefore (174)10 = (256)8 Number Systems and Codes

  22. Convert Base 10 to Base r Convert (0.275)10 to base 8 Therefore (0.275)10 = (0.21463)8 Number Systems and Codes

  23. Convert Base 10 to Base r Convert (0.68475)10 to base 2 Therefore (0.68475)10 = (0.10101)2 Number Systems and Codes

  24. Signed Number Representation There are 3 systems to represent signed numbers in binary number system: •  Signed-magnitude • 1's complement • 2's complement Number Systems and Codes

  25. Signed-magnitude system In signed-magnitude systems, the most significant bit represents the number's sign, while the remaining bits represent its absolute value as an unsigned binary magnitude. • If the sign bit is a 0, the number is positive. • If the sign bit is a 1, the number is negative. Number Systems and Codes

  26. Signed-magnitude system Number Systems and Codes

  27. 1's Complement system • A 1's complement system represents the positive numbers the same way as in the signed-magnitude system. The only difference is negative number representations. • Let be N any positive integer number and be a negative 1's complement integer of N. If the number length is n bits, then Number Systems and Codes

  28. Example of 1's Complement For example in a 4-bit system, 0101 represents +5 and 1010 represents 5 Number Systems and Codes

  29. 1's Complement system Number Systems and Codes

  30. 2's Complement system • A 2's complement system is similar to 1's complement system, except that there is only one representation for zero. • Let be N any positive integer number and be a negative 2's complement integer of N. If the number length is n bits, then Number Systems and Codes

  31. Example of 2's Complement For example in a 4-bit system, 0101 represents +5 and 1011 represents 5 Number Systems and Codes

  32. 2's Complement system Number Systems and Codes

  33. Addition and Subtraction in Signed and Magnitude Number Systems and Codes

  34. Addition and Subtraction in 1’s Complement Number Systems and Codes

  35. Addition and Subtraction in2’s Complement Number Systems and Codes

  36. Overflow Conditions Carry-incarry-out 0111 1000 5 0101 -5 1011 +3 +0011 -4 +1100 -8 10007 10111 Carry-in = carry-out 0000 1110 +5 0101 -2 1110 +2 +0010 -6 +1010 7 0111-8 11000 Number Systems and Codes

  37. Addition and Subtraction inHexadecimal System Addition Subtraction Number Systems and Codes

  38. Codes • Decimal codes • Gray code • Error detection code • ASCII code Number Systems and Codes

  39. Decimal codes Number Systems and Codes

  40. Gray Code Number Systems and Codes

  41. Error detection code Number Systems and Codes

  42. Error detection code Number Systems and Codes

  43. ASCII Code • ASCII: American Standard Code for Information Interchange. • Used to represent characters and textual information • Each character is represented with 1 byte • upper and lower case letters: a..z and A..Z • decimal digits -- 0,1,…,9 • punctuation characters -- ; , . : • special characters --$ & @ / { • control characters -- carriage return (CR) , line feed (LF), beep Number Systems and Codes

  44. Assignment 1 Page 74 • 1.1: Only A+B and AB (a), (c), (f), and (g) • 1.2: Only A+B and AB (a), (c) • 1.3: Only A+B and AB (a), (c) • 1.4: (a), (c), (e) • 1.5: (a), (c), (e) • 1.6: (a), (e) • 1.7: (a), (b) • 1.8: (a), (b) • 1.10: (a), (c) • 1.11: (a), (c) • 1.12: (a), (c) • 1.13: (a), (b) Number Systems and Codes

More Related