Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

1 Chapter 2 The Digital World. 2 Digital Data Representation.
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
Binary Representation
Comp 1001 Introduction to Information Technology & Computer Architecture Wednesday 12-1Dr. Joe Carthy
Binary and Hexadecimal Numbers
Data Representation CS105. Data Representation Types of data: – Numbers – Text – Audio – Images & Graphics – Video.
Data Representation in Computers
Unit 3—Part A Computer Memory
Binary and Decimal Numbers
Introduction to Information Technology
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Computer Systems 1 Fundamentals of Computing
Number Systems & Logic Gates Day 1
Representing Information in Binary (Continued)
Digital Data Patrice Koehl Computer Science UC Davis.
Bits, Bytes, KiloBytes, MegaBytes, GigaBytes & TeraBytes.
Communications Technology 2104 Mercedes Lahey. Bit 1. bit=From a shortening of the words “binary digit” 2. the basic unit of information for computers.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
Numbering systems.
Abstraction – Number Systems and Data Representation.
Data and Program Representation
Numbering Systems CS208.
Computer Systems Chapter 1 Pages Hardware-physical pieces Key hardware components in a computer system: The physical parts. – Central processing.
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
Text and Graphics September 26, Unit 3.
Unit 2—Part A Computer Memory Computer Technology (S1 Obj 2-3)
CS 104 Introduction to Computer Science and Graphics Problems Data Representation(1) Number Systems 09/12 ~ 09/16 /2008 Yang Song (Prepared by Yang Song.
Computer Math CPS120: Lecture 3. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits have 0 or.
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
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Data Representation The storage of Text Numbers Graphics.
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
Data Representation.
2.1.4 Data Representation Units.
ASCII AND EBCDIC CODES By : madam aisha.
Binary Decimal Hexadecimal
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Understanding Computers
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Binary Numbers. Base 10 and Base 2  We normally work with numbers in base 10.  In base 10 we use the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.  Everything.
CC111 Lec#2 The System Unit The System Unit: Processing and Memory Lecture 2 Binary System.
Understanding Binary Understanding Computers. Understanding Computers L3 – Understanding Binary Learning Objectives All will Understand why all data is.
Binary & Hex Review.
Understanding binary Understanding Computers.
Computer basics.
INFS 211: Introduction to Information Technology
3.1 Denary, Binary and Hexadecimal Number Systems
Computer Memory Digital Literacy.
Memory Parts of a computer
Bits & Bytes How Computers Represent Data
Information Support and Services
What is Binary? Binary is a two-digit (Base-2) numerical system, which computers use to process and store data. The reason computers use the binary system.
Unit 2 Computer Memory Computer Technology (S1 Obj 2-3)
Lecture 3 ISE101: Computing Fundamentals
Unit 3—Part A Computer Memory
Unit 3—Part A Computer Memory
Information Representation
Chapter Four Data Representation in Computers By Bezawit E.
Abstraction – Number Systems and Data Representation
LO1 – Understand Computer Hardware
Binary & Hex Review.
WJEC GCSE Computer Science
UNIT – 3 & 4. Data Representation and Internal
Presentation transcript:

Binary Expression Numbers & Text CS 105

Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values, 0 and 1. We have to represent the information we want to store and manipulate in binary format.

Data Representation Number Text Images and graphics Audio Video

Positional Notation Base – Binary (2) 0, 1 – Octal (8) 0, 1, 2, 3, 4, 5, 6, 7 – Decimal (10) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 – Hexadecimal (16) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Positional Notation – 943 = 9 * * * 1 – = ?

Binary Expression (Binary to Decimal) Example1: To convert the binary number to decimal, we write: the binary string: over the powers of 2: = 23 Like bills, no matter how much money you want, I can always give the accurate amount by using 1, 2, 4, 8, 16, 32, … bills

Binary Expression (Decimal to Binary) Example2: To convert the decimal number 23 to binary, we do the following divisions, recording the quotients and the remainders divided by 2 has a quotient of 11 and a remainder of divided by 2 has a quotient of 5 and a remainder of divided by 2 has a quotient of 2 and a remainder of divided by 2 has a quotient of 1 and a remainder of divided by 2 has a quotient of 0 and a remainder of The sequence of remainders we obtained, when collected the reverse order is the binary representation of 23, namely

Binary Expression (Decimal to Binary) Combination of 1, 2, 4, 8, 16, 32, … bills – Decimal Number: 23 – – 1. You have 23. Pick 16, and you have 7 left. – 2. You have 7. Pick 4 (8 is too large), and you have 3 left. – 3. You have 3. Pick 2, and you have 1 left. – 4. You have 1. Pick 1 – So, … – We have (binary expression for 23)

Binary representation. Remember, everything on a computer is stored as 0s and 1s. Thus, we must interpret these numbers as different forms of data. One bit (binary digit) can be either a 0 or a 1. –Therefore, it can only represent two possibilities: hot or cold, black or white, on or off, etc…

Numerical data Operation Multiply the binary number 101*1001. – – x – – – – Add the binary number – – – _________________ –

Data Representation Number Text Images and graphics Audio Video

Binary representation. cont. If we want to represent for things, we must use more bits. Two bits can be either 00, 01, 10, or 11. –Therefore, they can represent four possibilities: cold, cool, warm, or hot; black, white, and two gray levels; etc … This continues until we have enough bits to represent our data. –In general, n bits can represent 2 n things (ie, every time we add a bit, we double the number of things we can represent by two).

Some terminology. Up to this point we have been talking about data in either bits or bytes. – 1 byte = 8 bits While this is the correct way to talk about data, sometimes it is a bit inefficient. Therefore, we use prefixes to given an order of magnitude. – Much the same way we do with the metric system. The following is a list of the common terms. – Kilobyte (KB) = 10 3 = 1000 bytes – Megabyte (MB) = 10 6 = 1 million bytes – Gigabyte (GB) = 10 9 = 1 billion bytes – Terabyte (TB) = = 1 trillion bytes – Petabyte (PB) = 1 quadrillion bytes

Representing text. Now we know how numbers are represented by computers, but what about text, such as term papers, text messages, etc…? Well, we can use a technique that we’ve referenced a couple of times. That is, we can use numbers to represent elements of a set. –How could we represent the letters ‘a’ to ‘z’? –One possibility would be to use 0 as ‘a’ and 25 as ‘z’. –Is there a problem with this? –What if we wanted to represent the ‘the ABCs and 123s’? We’re going to need a way to represent all letters, numbers, symbols, and hidden characters. Remember newline? In fact there are many different systems used to do this, one of the most popular is the ascii system, which is used by notepad on windows. –ASCII stands for American Standard Code for Information Interchange.

ASCII Character Set

Ascii codes. cont. An ascii character is an 8 bit (1 byte) number interpreted to represent something. – 48 represents ‘0’ – 82 represents ‘R’ – 32 represents ‘ ’ (Space) – Etc … – How many characters can be represented by Ascii? A program can therefore interpret a chain of 8 bit numbers to represent a text document. – Notepad in Windows does just this. – In notepad, we can verify this by creating a new document. Typing a single letter in it then saving. If we now check the size of the document, you’ll see that it is 1 byte. Type another character and save … now it’s 2 bytes.

Representing text. cont. How about other characters (Latin, Russian, Thai, math symbols, Chinese, Japanese, Korean, …)? There are actually many other standards for representing text on computers aside from ASCII. One very common one is Unicode. – Unicode is a standard used to represent around 100,000 different characters covering most languages. – In fact, in Microsoft Word, try clicking Insert  Symbol. You may notice in the right hand corner that the set of symbols is taken from Unicode. You will also be shown the Hexadecimal version of the code for that character. – Unicode uses a 16bit (2byte) or 32bit (4byte) code to represent characters depending on the version of Unicode. How many characters can Unicode represent?