1 / 22

Coding Schemes and Number Systems

Download Presentation

Coding Schemes and Number Systems

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. 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 Coding Schemes and Number Systems

  2. Quote "There are only 10 types of people in the world - those who understand binary, and those who don't." -unknown

  3. Coding Schemes • At the lowest level, everything in a computer is represented by 1s and 0s, called bits • Numbers • Characters • Complex data • Bit – binary digit • A coding scheme is used by a computer to represent characters • Images • Audio • Networking

  4. Coding Schemes • ASCII – most widely used coding scheme • EBCDIC – used on some mainframes and high-end servers • Unicode – used by several operating systems and programming languages • Contains ASCII as a subset

  5. Coding Schemes • ASCII, EBCDIC • Store each character in one byte (8 bits) • 256 characters represented • Characters for English and western European languages represented Complete ASCII table:http://www.rapidtables.com/prog/ascii_table.htm My favorite: http://www.asciitable.com/

  6. Coding Schemes • Unicode • Store each character in two(+) bytes (16 bits) • 65,536+ characters represented • First 256 codes are same as ASCII codes • Includes codes for ideograms – symbols used in Asian and other languages – allows more languages/characters than only ASCII

  7. Coding Schemes: Conversion Exercise • Try these exercises using http://www.asciitable.com/ • Convert to ASCII binary codes: • Tree • Convert to ASCII decimal codes: • Go Team! • Decipher ASCII codes from binary: • 01010011 01110100 01000001 01110010 • Decipher ASCII codes from decimal: • 67 73 83 64 80 67 67

  8. Coding Schemes: Conversion Exercise • Check your answers: • Convert to ASCII binary codes: • Tree 01010100 01110010 01100101 01100101 • Convert to ASCII decimal codes: • Go Team! 71 111 32* 84 101 97 109 33 * What does 32 stand for? • Decipher ASCII codes from binary: • 01010011 01110100 01100001 01110010 S t a r • Decipher ASCII codes from decimal: • 67 73 83 64 80 67 67 C I S @ P C C Discovering Computers 2011: Living in a Digital World Chapter 2

  9. Number Systems • Three number systems are commonly used with computers Decimal Base 10 Binary Base 2 Hexadecimal Base 16 1, 2, 3, … 10, 11, 12 1, 10, 11, … 1010, 1011, 1100 1, 2, 3, … A, B, C

  10. Number Systems • Decimal Number System • “deci” prefix = 10 • 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 • Base 10 number system 1 2 3 102 101 100 • = 1*102 + 2*101 + 3*100 • = 100 + 20 + 3

  11. Number Systems • Each number system has a set of place values. • Any number (except zero) raised to the zero power = 1 • Any number raised to the 1st power is itself • Any number raised to the 2nd power is that number times itself • You should know the place values for the decimal system we use every day. See Binary Place_Values and Hexadecimal Place Values • Number Systems • See Number Conversion Discovering Computers 2011: Living in a Digital World Chapter 2

  12. Number Systems • Binary Number System • “bi” prefix = 2 • 2 digits: 0, 1 • Base 2 number system 1 0 1 22 21 20 101 = 1*22 + 0*21 + 1*20 = 4 + 0 + 1 = 5

  13. Number Systems • Hexadecimal Number System aka Hex • “hexadeci” prefix = 16 • 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F • In the Hexadecimal (Base 16) number system we use the letters A-F to represent the additional 6 digits. 1 2 3 162 161 160 123 = 1*162 + 2*161 + 3*160 = 256 + 32 + 3 = 291

  14. Number Systems • Converting between number systems • Binary or hex to decimal: Use place values • Decimal to binary : Write number as a sum of powers of 2 • 200 to binary • 200 = 128 + 72 200 – 128 = 72 • 200 = 128 + 64 + 8 72 – 64 = 8 • 200 = 27 + 26 + 23 • 200 = 11001000

  15. Number Systems • Converting between number systems • Decimal to hex: Convert decimal to binary, then to hex • Binary to hex and hex to binary: 4 binary digits = 1 hex digit (see Binary to Hex Conversion) 1011 0101 0010 1111 B 5 2 F

  16. Number Systems • Why hex? • More compact representation of binary numbers • Network mask • Host: 01010101.01010101.01010101.01010101 • 85 . 85 . 85 . 85 • Mask: 11111111.11111111.11111111.11110000 • 255 . 255 . 255 . 240

  17. Exercises Convert the following binary numbers to hexadecimal: 01001111 01100011 01110100 00100000 00110011 00110001 01111010 00111101 00100110 01000100 01100101 01101011 01101100 00110010 10110111

  18. Check your answers. 01001111 01100011 01110100 4F 63 74 00100000 00110011 00110001 20 33 31 01111010 00111101 00100110 7A 3D 26 01000100 01100101 01101011 44 65 6B 01101100 00110010 10110111 6C 32 B7 Discovering Computers 2011: Living in a Digital World Chapter 2

  19. Exercises Complete the following table using ASCII code (You may use an online calculator or PC calculator for the numbers). Write binary numbers using 8 bits.

  20. Exercises Check your answers:

  21. Quote "There are only 10 types of people in the world - those who understand binary, and those who don't." -unknown

  22. 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00100001 00100000 01000100 01101111 01101110 00100111 01110100 00100000 01110010 01100101 01100001 01100100 00100000 Coding Schemes and Number Systems

More Related