Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2

Slides:



Advertisements
Similar presentations
Technology ICT Option: Data Representation. Data Representation In our everyday lives, we communicate with each other using analogue data. This data takes.
Advertisements

Calculating in Other Bases
A-Level Computing#BristolMet Session Objectives#8 express numbers in binary, octal and hexadecimal explain the use of code to represent a character set.
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
How Computers Represent Numbers Friday, Week 5. Binary Code A series of 1’s and 0’s Place value is in powers of 2.
Review Binary –Each digit place is a power of 2 –Any two state phenomenon can encode a binary number –The number of bits (digits) required directly relates.
Binary and Hexadecimal Numbers
Data Representation in Computers
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
Representing Information in Binary (Continued)
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
Data vs. Information OUTPUTOUTPUT Information Data PROCESSPROCESS INPUTINPUT There are 10 types of people in this world those who read binary and those.
Binary Arithmetic & Data representation
D ATA REPRESENTATION, BINARY SYSTEM, B IT, B YTE, ASCII C ODE Chapter 3 Mr.Mohammed Rahmath.
Information and Programs. Foundations of Computing Information –Binary numbers –Integers and Floating Point –Booleans (True, False) –Characters –Variables.
Binary, Decimal and Hexadecimal Numbers Svetlin Nakov Telerik Corporation
Computing Theory – F453 Number Systems. Data in a computer needs to be represented in a format the computer understands. This does not necessarily mean.
Lecture Binary and Hexadecimal Numbers. How Machines Think Computers handle two types of information: –Instructions –Data The "words" of a machine language.
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
CS 111 – Sept. 1 Intro to data representation Binary numbers –Convert binary  decimal –Convert decimal  binary Text –ASCII and Unicode Commitment: –For.
Representation of Characters
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Representing Characters in a Computer System Representation of Data in Computer Systems.
A+ Computer Repair Lesson 3: Number System. Objectives Define binary, decimal, octal, and hexadecimal numbering systems. Define binary, decimal, octal,
Lesson 6 Binary Understand what Binary Code means and apply this knowledge Understand how data is represented using bit systems and be able to change decimal.
Understanding Computers
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) abcdef or ABCDEF.
Data Representation. In our everyday lives, we communicate with each other using analogue data. This data takes the form of: Sound Images Letters Numbers.
Understanding Binary Understanding Computers. Understanding Computers L3 – Understanding Binary Learning Objectives All will Understand why all data is.
1.4 Representation of data in computer systems Character.
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
Topic: Binary Encoding – Part 2
Binary Representation in Text
Binary Representation in Text
Topic: Binary Encoding – Part 1
Number Systems.
Understanding binary Understanding Computers.
Unit 2.6 Data Representation Lesson 2 ‒ Characters
Lesson Objectives Aims You should be able to:
Unit 18: Computational Thinking
CSCI 198: Lecture 4: Data Representation
CSCI 161: Lecture 4: Data Representation
EPSII 59:006 Spring 2004.
Data Encoding Characters.
Representing Nonnumeric Data
Representing Data How does a computer represent data?
Binary and Hexadecimal Numbers
Binary Lesson 3 Hexadecimal
Fundamentals of Data Representation
COMS 161 Introduction to Computing
Binary Lesson 3 Hexadecimal
C1 Number systems.
COMS 161 Introduction to Computing
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
Binary Lesson 3 Hexadecimal
Binary Lesson 4 Hexadecimal and Binary Practice
Option: Data Representation
Option: Data Representation
Formatting Output.
Lecture 35 – Unit 6 – Under the Hood Binary Encoding – Part 1
Lecture 37 – Practice Exercises 9
Lecture 37 – Practice Exercises 9
Presentation transcript:

Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2 CMPT 120 Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2

Review – “Computers use 0 and 1 to represent everything“ Computer memory: 100100111010010001000100010001000100010001100010010101000111111010010010001000100110010001011011100100100100100100100000000110010100101010101000100100100100010001001100100010110111001001011101001010101010001001011000010100010011001000101101110010010101 010010010010010101001 integer floating point number colour character CPU instruction sound

Review - Decimal numeral system Binary numeral system Decimal -> 10 (Base 10) Ten symbols (digits): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary -> 2 (Base 2) Two symbols (bits): 0, 1 (bits -> binary digits)

Review - Decimal numeral system Binary numeral system Positional system When counting: Positional system When counting: 0 0 1 … 0 0 9 0 1 0 0 1 1 1 9 9 2 0 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 … 102 101 22 21 20 100

How computers represent integers Which integer is this: bit byte A bit either contains a 0 or 1 A byte is 8 bits

How computers represent integers Which integer is this :

You try it! Which integer is this?

Decimal numeral system So far … Decimal numeral system Binary numeral system

Decimal numeral system Let’s try … Decimal numeral system Binary numeral system

What is 106 as a binary number?

Can you convert these? 1 00000001 2 00000010 3 00000011 4 00000100 5 00000101 6 00000110 7 00000111 8 00001000 9 _ _ _ _ _ _ _ _ 10 _ _ _ _ _ _ _ _ 11 _ _ _ _ _ _ _ _ 12 _ _ _ _ _ _ _ _ 13 _ _ _ _ _ _ _ _ 14 _ _ _ _ _ _ _ _ 15 _ _ _ _ _ _ _ _ 64 _ _ _ _ _ _ _ _ 255 _ _ _ _ _ _ _ _ 256 _ _ _ _ _ _ _ _

How can we read/write long binary numbers easily?

Hexadecimal Numbers

ASCII and Unicode

How computers represent characters We have already seen how computers deal with letters and characters … remember ASCII? Source: http://1.bp.blogspot.com/_e8aZh22zXKM/TMeR_fFL8aI/AAAAAAAAAAo/pIR08vVLkz0/s320/Hello_World.jpg See ASCII Table: https://www.ascii-code.com/

Unicode UTF - 8 ASCII uses 8 bits (1 byte) to encode characters using 0’s and 1’s How many different characters can we represent in ASCII with 8 bits (1 byte)? To type in other languages than English, we may need a lot more than that Unicode uses up to 4 bytes to handle more characters Let’s have a look: http://www.unicode.org/charts/

Other Character Encodings

I have a great idea! Let’s write a binary-decimal converter in Python How would we go about solving this problem?

Next Lecture Practice speaking binary and hexadecimal and a lot more! Bring your laptop! 