Coding Schemes and Number Systems

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

1 Chapter 2 The Digital World. 2 Digital Data Representation.
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
How Computers Represent Numbers Friday, Week 5. Binary Code A series of 1’s and 0’s Place value is in powers of 2.
Data Representation in Computers
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
Computer Arithmetic: Binary, Octal and Hexadecimal Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
Binary and Decimal Numbers
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Bits and Bytes.
CIS 234: Character Codes Dr. Ralph D. Westfall April, 2011.
COMPUTER FUNDAMENTALS David Samuel Bhatti
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
Agenda Data Representation – Characters Encoding Schemes ASCII
Bits & Bytes: How Computers Represent Data
Computer System Basics 1 Number Systems & Text Representation Computer Forensics BACS 371.
10-Sep Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept Representing Information in Computers:  numbers: counting numbers,
CIS 234: Numbering Systems Dr. Ralph D. Westfall April, 2010.
The Hexadecimal Number System and Memory Addressing ISAT 121.
Computer System Basics 1 Number Systems & Text Representation Computer Forensics BACS 371.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Data Representation, Number Systems and Base Conversions
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Springfield Technical Community College Center for Business and Technology.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Agenda Character representation Numerical Conversions ASCII EBCDIC
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
THE CODING SYSTEM FOR REPRESENTING DATA IN COMPUTER.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
DATA REPRESENTATION - TEXT
Day 6 - Encoding and Sending Formatted Text
Some basic concepts underlying computer archi­tecture
Lecturer: Santokh Singh
Unit 2.6 Data Representation Lesson 2 ‒ Characters
Number Systems and Codes
Binary Numbers and ASCII and EDCDIC
Unit 18: Computational Thinking
Day 6 - Encoding and Sending Formatted Text
3.1 Denary, Binary and Hexadecimal Number Systems
Lesson Objectives Aims
CSCI 198: Lecture 4: Data Representation
Introduction to Chapter 2
CSCI 161: Lecture 4: Data Representation
Bits & Bytes How Computers Represent Data
Information Support and Services
Denary to Binary Numbers & Binary to Denary
Why use Binary? There are only four rules for addition in binary compared to 100 in decimal [0+0=0 ; 0+1=1 ; 1+0=1; 1+1=10]
Data Encoding Characters.
TOPICS Information Representation Characters and Images
University of Gujrat Department of Computer Science
Number Systems and Codes
COMS 161 Introduction to Computing
ECB2212-Digital Electronics Codes
MAC Address Your Computers Drivers License By Christy Kushner
C1 Number systems.
COMS 161 Introduction to Computing
Digital Encodings.
Day 6 - Encoding and Sending Formatted Text
Abstraction – Number Systems and Data Representation
Chapter 3 - Binary Numbering System
Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2
Section 6 Primitive Data Types
Presentation transcript:

Coding Schemes and Number Systems 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

Quote "There are only 10 types of people in the world - those who understand binary, and those who don't." -unknown Worksheet with questions similar to those on the quiz Feel free to work together When doing quiz: Do not simply use a conversion app on the web. Do the conversions on your own first! Then if you want to check your answer, you can check it.

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 A bit is the smallest element of computer storage The way a bit of information is actually stored depends on the storage medium We will learn more about that in Chapter 7: Storage

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 ASCII = American Standard Code for Information Interchange

Coding Schemes ASCII, EBCDIC Store each character in one byte (8 bits) 256 characters represented Characters for English and western European languages represented ASCII Symbol EBCDIC 00110111 7 11110111 00111000 8 11111000 00111001 9 11111001 01000001 A 11000001 01000010 B 11000010 01000011 C 11000011 01000100 D 11000100 01000101 E 11000101 Complete ASCII table: http://www.rapidtables.com/prog/ascii_table.htm My favorite: http://www.asciitable.com/

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 Anyone know what languages these are from?

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 Show ASCII Code chart on course web site: decimal and binary codes Tree = 01010100 01110010 01100101 01100101 Go Team! = 71 111 32 84 101 97 109 33 67 73 83 64 80 67 67 = CIS@PCC 01010011 01110100 01000001 01110010 = StAr

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

Number Systems Decimal Base 10 Binary Base 2 Hexadecimal Base 16 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

1 2 3 Number Systems Decimal Number System “deci” prefix = 10 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Base 10 number system Show cycling through digits as one counts up: 0, 1, 2, … 9, 10 (move over one place value and start again) 123 in the decimal number system represents the quantity one hundred and twenty three The number we use are just symbols – distinction between the symbol used and the quantity represented Other examples (on board): 4018 = 4*103 + 0*102 + 1*101 + 8*100 312,000 = … Now that we understand the decimal number system, we can see that other number systems act the same way, just using a different base value. 1 2 3 102 101 100 = 1*102 + 2*101 + 3*100 = 100 + 20 + 3

Discovering Computers 2011: Living in a Digital World Chapter 2 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

1 0 1 Number Systems Binary Number System “bi” prefix = 2 2 digits: 0, 1 Base 2 number system Everywhere we had a 10 on the previous slide, we can replace with a 2 Write table on board: 22 = 4, 23 = 8, … Do other examples on board: 1011 = 1*23 + 0*22 + 1*21 + 1*20 1010000000 = 29 + 27 = 512 + 128 = 640 1 0 1 22 21 20 101 = 1*22 + 0*21 + 1*20 = 4 + 0 + 1 = 5

1 2 3 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. We have to add symbols to get 16 digits The symbols 123 in hex represent the quantity 291 Write table on board: 161 = 16, 162 = 256, 163 = 4096 Do other examples on board: AB = 10*161 + 11*160 = 160 + 11 = 171 300F = 3*163 + 0 + 0 + 15*160 = 3*4096 + 15 = 12288+ 15 = 12303 1 2 3 162 161 160 123 = 1*162 + 2*161 + 3*160 = 256 + 32 + 3 = 291

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 Anything to decimal: use place values just like we have shown -> Show place value pages on our web site (Assign 2 assistance) 200 to binary: check chart: 128 is largest less than 200, … Other examples: 512 = 29 = 1000000000 513 = 1000000001

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) Binary – Hex Chart on web site Why does 4 binary digits = 1 hex digit? 16 is a power of 2: 16 = 24 1011 0101 0010 1111 B 5 2 F

Number Systems Why hex? Network mask 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

Exercises Convert the following binary numbers to hexadecimal: 01001111 01100011 01110100 00100000 00110011 00110001 01111010 00111101 00100110 01000100 01100101 01101011 01101100 00110010 10110111 Worksheet with questions similar to those on the quiz Feel free to work together When doing quiz: Do not simply use a conversion app on the web. Do the conversions on your own first! Then if you want to check your answer, you can check it.

Discovering Computers 2011: Living in a Digital World Chapter 2 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

Exercises Worksheet with questions similar to those on the quiz 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. Decimal Binary Hex ASCII char 81 48 @ 01100111 61 70 m 0110110 Worksheet with questions similar to those on the quiz Feel free to work together When doing quiz: Do not simply use a conversion app on the web. Do the conversions on your own first! Then if you want to check your answer, you can check it.

Exercises Check your answers: Decimal Binary Hex ASCII char 81 01010001 51 Q 72 01001000 48 H 64 01000000 40 @ 103 01100111 67 g 61 00111101 3D = 112 01110000 70 p 109 01101101 6D m 54 00110110 36 6 Worksheet with questions similar to those on the quiz Feel free to work together When doing quiz: Do not simply use a conversion app on the web. Do the conversions on your own first! Then if you want to check your answer, you can check it.

Quote "There are only 10 types of people in the world - those who understand binary, and those who don't." -unknown Worksheet with questions similar to those on the quiz Feel free to work together When doing quiz: Do not simply use a conversion app on the web. Do the conversions on your own first! Then if you want to check your answer, you can check it.

Coding Schemes and Number Systems 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