Data Encoding COSC 1301. Computers and Data Computers store information as sequences of bits Computers store many types of data: numbers text audio images.

Slides:



Advertisements
Similar presentations
The Binary Numbering Systems
Advertisements

Digital Fundamentals Floyd Chapter 2 Tenth Edition
Lecture 10: System Fundamentals Intro to IT COSC1078 Introduction to Information Technology Lecture 10 System Fundamentals James Harland
Representing Information as Bit Patterns
Data Representation in Computers
Data Representation 3 This week – Recap on Floating point number – ASCII – unicode.
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
COMPUTER FUNDAMENTALS David Samuel Bhatti
Computer Systems Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text.
1.6 Signed Binary Numbers.
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Chapter 5 Data representation.
LING 408/508: Programming for Linguists Lecture 2 August 28 th.
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
Agenda Data Representation – Characters Encoding Schemes ASCII
Lecture 11: Machine Processing Intro to IT COSC1078 Introduction to Information Technology Lecture 11 Machine Processing James Harland
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
IT253: Computer Organization
Computer Structure & Architecture 7c - Data Representation.
Data Representation.
COMPSCI 210 Semester Tutorial 1
Number Systems Spring Semester 2013Programming and Data Structure1.
Binary, Decimal and Hexadecimal Numbers Svetlin Nakov Telerik Corporation
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
9.4 FLOATING-POINT REPRESENTATION
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
1 Lecture 2  Complement  Floating Point Number  Character Encoding.
The Teacher CP4 Binary and all that… CP4 Revision.
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.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
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
Chapter 7 C supports two fundamentally different kinds of numeric types: (a) integer types - whole numbers (1) signed (2) unsigned (b) floating types –
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,
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia.
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Software Design and Development Storing Data Computing Science.
1.4 Representation of data in computer systems Character.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Data Encoding COSC 1301.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Binary Representation in Text
Binary Representation in Text
Unit 2.6 Data Representation Lesson 2 ‒ Characters
Programming and Data Structure
Number Representation
CSCI 198: Lecture 4: Data Representation
Chapter 3 Data Storage.
CSCI 161: Lecture 4: Data Representation
Data Encoding Characters.
LING 388: Computers and Language
Information Representation
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
Digital Encodings.
How Computers Store Data
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
LING 388: Computers and Language
Chapter 3 - Binary Numbering System
Presentation transcript:

Data Encoding COSC 1301

Computers and Data Computers store information as sequences of bits Computers store many types of data: numbers text audio images video

Standards Look around – how many items do you see that are based on a standard? Standards: make our lives simpler, more efficient Sometimes there aren't any.

Not Much of a Standard

A Small Number of Standards

Bitten by Lack of a Single Standard

Wishing for Standards

A General Trend Toward Standards Word Sizes of Early Computers EDVAC44 bits1947 MARK 140 bits1948 EDSAC17 bits1949 CSIRAC20 bits1949 UNIVAC I12 digits1951 IBM bits1952 CDC bits1959 CDC bits1964 IBM bits1965 x-8616 bits1978 x-3232 bits1986 x-6464 bits2004

Standard: Integer Representation Representing integers in base 2:

Integers Representing integers in base 2: But what about: -93 sign bit

Integers But what about: -93 sign bit Problem: Two representations of zero – positive zero and negative zero Unnecessary complexity Better representations make it easier for the computer.

Two's Complement: Negative Integers Flip the bits: Then add 1: A good explanation of why it works:

A Problem What should we do about: If we always want two places after. : Then we could write: And then always treat it as though the decimal point were there.

Floating Point Numbers Floating point representation: exponential/scientific notation Example: 123l.45 can be represented as a decimal floating-point number with the integer as the significand and -2 as the exponent (and 10 as the base). It’s value is given by the following: = X See the following slide to see how a computer stores this

IEEE Standard - Floating Point Single Format: 32 bits (4 bytes) to store a floating point number: 1 bit for the sign 8 bits for the exponent 23 bits for the mantissa or significand Double Format: 64 bits (8 bytes) to store a floating point number: 1 bit for the sign 11 bits for the exponent 52 bits for the mantissa or significand

Text To represent text digitally, need to be able to represent every possible character that may appear: Computers have revolutionized our world. コンピュータは私たちの世界に革命をもたらしました。 Les ordinateurs ont révolutionné notre monde.

Text Decide how many characters we need to represent. Then: determine the required number of bits. English: 26 letters, 52 for upper and lower case. Plus punctuation... And other languages? character set: a list of characters and the codes used to represent each Several character sets have been used over the years - a standard makes processing text easier

ASCII ASCII: American Standard Code for Information Interchange 1963: 7 bits per character = 128 different symbols Thought to be enough at the time 8th bit in each character byte – used as a check bit or parity bit check for errors in transmission of data Later: Latin-1 Extended ASCII character set All 8 bits used to represent character Represent 256 characters – includes accented characters, other special characters

ASCII

Representing Text Fourscore and seven … F o u r

Representing Text T h e n u m b e r i s E 75 6D E

Computing with Text Computers have revolutionized our world. They have changed the course of our daily lives, the way we do science, the way we entertain ourselves, the way that business is conducted, and the way we protect our security. Suppose we want to capitalize this entire paragraph: Let’s go back and look at the ASCII table to see how to do that.

When We Need More Characters 简体字 What about things like:

When We Need More Characters 简体字 What about things like: Answer: Unicode A conversion applet:

Unicode Previously, a letter maps to some bits: A encoded as In Unicode, a letter maps to a code point – a number like U+0639 U+ means Unicode numbers are hexadecimal Every character has a Unicode code point This doesn't indicate how the code point is encoded as a sequence of bits, though U+0041: English letter A U+0639: Arabic letter Ain

Unicode Example: Hello 5 code points, one code point (i.e., number) per letter U+0048 U+0065 U+006C U+006F How is this stored in memory? Different standards for this. One standard: UTF-8 Standard system for storing strings of Unicode code points in binary (i.e., U+DDDD stored in some number of bytes)

UTF-8 Code points stored in one byte So English text looks same in UTF-8 as ASCII (backwards compatible) Code points 128 and higher: 2, 3, up to 6 bytes Hello: U+0048 U+0065 U+006C U+006C U+006F Stored as: C 6C 6F (same as ASCII) For Hebrew characters, accented letters, etc.: you may need more bytes