Too much information running through my brain.

Slides:



Advertisements
Similar presentations
Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte.
Advertisements

Information Representation
The Binary Numbering Systems
Representing Data, Pictures, Time, and Size in Computer
Connecting with Computer Science, 2e
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 12 Data.
Introduction to Information Technology
Representing Information in Binary (Continued)
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,
Computers and Scientific Thinking David Reed, Creighton University Data Representation 1.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Adding some light to computing ….
Too much information running through my brain.. We live in the information age. Knowledge comes from careful investigation of information. Information.
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Data Representation Int 2 Computing Unit 1 – Computer Systems St Kentigern’s Academy.
Chapter 2 Computer Hardware
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
Data Representation CS280 – 09/13/05. Binary (from a Hacker’s dictionary) A base-2 numbering system with only two digits, 0 and 1, which is perfectly.
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.
What do computers know?  All they really know is on or off.  Kind of like a light switch  Computers aren’t nearly as smart as you are!
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Quiz # 1 Chapters 1,2, & 3.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
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. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
Chapter 1 Background 1. In this lecture, you will find answers to these questions Computers store and transmit information using digital data. What exactly.
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,
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Chapter 3: Data Representation Chapter 3 Data Representation Page 17 Computers use bits to represent all types of data, including text, numerical values,
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
Binary, Decimal and Hexadecimal Numbers 1. Numbering Systems Radix - In mathematical numeral systems, the radix or base is the number of unique digits,
1 A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 12 Data Representation.
Fundamentals of Data Representation Yusung Kim
Unit 1 Digital Data Section D. Chapter 1, Slide 2Starting Out with Visual Basic 3 rd EditionIntroduction to ComputersUnit 1D – Digital DataSlide 2 Wikipedia.
© OCR 2016 Unit 2.6 Data Representation Lesson 1 ‒ Numbers.
Chapter 1: Data Storage.
DATA REPRESENTATION - TEXT
Binary and Hard Disk PEOPLE Program
Binary and Decimal Numbers
Computer Science: An Overview Eleventh Edition
File Compression 3.3.
Too much information running through my brain.
Binary, Decimal and Hexadecimal Numbers
Data Representation.
3.1 Denary, Binary and Hexadecimal Number Systems
Binary Representation in Audio and Images
Computer Science Higher
Introduction to Computers
Information Support and Services
BITS & BYTES.
CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS
Binary Values COSC 1323.
Data Representation Numbers
To do … Web Exercise: Quiz-3, HW#2 Score: update
Representing Images 2.6 – Data Representation.
Ch2: Data Representation
Computer Systems – Unit 1
BITS & BYTES.
Information Representation
Chapter 2 Data Representation.
(return of the…) Data blast
COMS 161 Introduction to Computing
Chapter Four Data Representation in Computers By Bezawit E.
Binary CSCE 101.
LO1 – Understand Computer Hardware
Chapter 3 - Binary Numbering System
Presentation transcript:

Too much information running through my brain. I Need More Data Too much information running through my brain.

What is 'data'? We live in the information age. Knowledge comes from careful investigation of information. Information is represented/encoded as data. What information is represented by an abacus? How? What information is represented on a DVD? How? What information is encoded on a credit card? How? If you don’t believe in the importance of INFORMATION - consider the issue of espionage both gov’t and corporate. The bead positions on an abacus represent numbers. Combinations of holes on a punched card represent data. Data could represent your credit card information, a movie to be played on a DVD, Doppler radar images being posted on the Internet ... DATA: The quantities, characters, or symbols on which operations are performed by a computer.

How can real-world information become data? How can a picture or a sound or a temperature reading become data? Data comes in two types: Continuous: infinitely variable points Discrete: finite number of points/choices

Continuous or Discrete? How long might it take a light bulb to burn out? What was your ACT score? How tall are you? How many books did you read this year? How much water did you drink this week? How many gen-ed courses have you taken at UW-L?

Continuous/Discrete In electronics, signals are known as either analog (meaning a continuous signal) digital (meaning a discrete signal)

Analog or Digital?

Why are computers digital? Information needs to be encoded in such a way as to be processed. Electrical signals can be processed. Even analog signals can be processed, but digital is simpler. In computers, there are two discrete (digital) signals: on and off. It's easy to tell if an electrical signal is on or off: Electric fence Electric socket Light bulb

On or Off http://www.flickr.com/photos/tudor/31803307/sizes/o/in/photostream/ http://www.flickr.com/photos/my-other-eye/5300224495/sizes/z/in/photostream/

What is a bit? Bit: short for "binary digit". A bit is the representation used for the smallest (atomic) amount of computer data. A bit is either ON or OFF. You can think of a bit as an extremely small battery that can be quickly charged and discharged. When charged, the bit is ON. When discharged, the bit is OFF. This is essentially what a single transistor is. Mathematically speaking, a bit is usually understood as the value 0 when OFF and the value 1 when ON. Since there are only two values, a bit is known as a 'binary' digit. 1

Bit Patterns What if you had two bits in a sequence. How many different patterns (sequences) could there be? 1 1 1

Bit Patterns What if you had three bits in a sequence. How many different patterns (sequences) could there be? 1 1 1

Bit Patterns What if you had four bits in a sequence. How many patterns could there be? What if you had N bits in a sequence. How many patterns could there be? With more bits you can store more information. One more bit doubles the amount. # Bits # of Patterns 1 2 4 3 8 16 5 32 N 2N

How is data capacity measured? One bit is too small to use as a measurement. Nobody says: "I've got a 10 GigaBit IPod" Measures of data capacity are based on a byte. 1 byte = 8 bits 1 bytes can have 256 different patterns 1 byte is big enough to represent many kinds of things Prefix Symbol Base 2 Decimal Kilobyte K 210 1,024 Megabyte M 220 1,048,576 Gigabyte G 230 ≈1,000,000,000 Terabyte T 240 ≈1,000,000,000,000 Petabyte P 250 ≈1,000,000,000,000,000 One byte can represent small numbers [0-255] for example, or a single camera pixel, or a single text character. Flash drives are measured in Mega and/or Gigabytes Hard drives are measured in Gigabytes Nobody will use a web site if it contains lots of 2Megabyte pictures/graphics.

What we have learned A string of bits can represent various things The length of a bit string controls the number of things that can be represented What is the shortest bit string for representing 100 different special symbols? Information is represented as data Data is stored in computer by string of bits 2^6 = 64 2^7 = 128

How much data to encode… How much data capacity do you need to encode: The complete works of William Shakespeare? One 4 minute pop song (MP3)? One digital picture (JPEG)? One feature length movie (DVD)? All of Wikipedia (As of Jan 2010)? The entire U.S. Library of Congress (As of Apr 2011)? Shakespeare: about 5M MP3: at 128Kbits/second about 4Meg One digital picture: About 4Meg depending on compression DVD: One sided/double-layered: 8.5Gig CD: About 800M Wikipedia: 5.9Tera Library: 235 Terabytes and adds about 5 Terabytes each month

Digital NUMBERS All digital data is a sequence of bits. How can we represent an integer number as a sequence of bits? Consider the decimal number 515. A sequence of digits Digits are one of: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Meaning of a digit depends on position: power of 10 515 = 5×102 + 5×101 + 5×100 Consider the binary number 101. Binary uses a base-2 (or radix 10) system rather than base 10 Digits are one of: 0, 1 Meaning of a digit depends on position: power of 2 101 = 1×22 + 0×21 + 1×20

Convert binary to decimal 101110 = 1×25 + 0×24 + 1×23 + 1×22 + 1×21 + 0×20 1×32 + 0×16 + 1×8 + 1×4 + 1×2 + 0×1 32 + 0 + 8 + 4 + 2 + 0 46 110001 = 1×25 + 1×24 + 0×23 + 0×22 + 0×21 + 1×20 1×32 + 1×16 + 0×8 + 0×4 + 0×2 + 1×1 32 + 16 + 0 + 0 + 0 + 1 49

What's the base? It's easy to get confused and not be sure of what base a number is written in. For example, is 111: One hundred eleven? Five? A subscript can be used to specify the base whenever it is unclear. 1112 is equal to five 11110 is equal to one hundred eleven.

Biggest Binary Number What is the biggest number you can have with Two bits? Three bits? Four bits? Five bits? N bits? 3, 7, 15, 31, 2^n-1

What about real numbers? While we can represent an integer as a sequence of bits, is it possible to represent a real number such as 2.31 or 2.125? In base 10, the value 2.125 means: 2×100 + 1×10-1 + 2×10-2 + 5×10-3 In base 2, the value 1.101 means: 1×20 + 1×2-1 + 0×2-2 + 1×2-3 1×1 + 1×(1/2) + 0×(1/4) + 1×(1/8) 1 + .5 + 0 + .125 1.625

What about real numbers? Consider the value 1/3. How many decimal digits does it take to accurately represent as a real number? 1/3 = 0.33333333333333333333333... Consider the value 1/5. How many decimal digits does it take to accurately represent as a real number? How many binary digits? 1/5 = 0.210 1/5 = 0.102 Since it requires a potentially infinite amount of bits to store a real number, computers can be imprecise.

What about text? Can text be represented as a sequence of binary digits (bits)? Text is a made of pictures (also known as symbols or characters). Each character can be associated with an integer number Character Decimal Binary A 00000000 B 1 00000001 C 2 00000010 D 3 00000011 E 4 00000100 F 5 00000101 … Z 25 00011001

What about text? The numbers associated with a character can obviously be stored About how many unique numbers are required for English text? (asked another way, how many unique characters did William Shakespeare ever use?) One byte has enough capacity to store an English character. About how many unique numbers are required for Chinese text? Two bytes is enough for most languages: 电脑

ASCII Table Most computers that are configured for English writers, use the ASCII table. This table associates numbers with English text.

What about colors? How might a computer store a 'color'? What are the primary colors of pigment? Cyan, magenta, yellow What are the primary colors of light? Red, green, blue

RGB Color Model RGB color model Uses red, green, and blue as the primary colors. Any color can be represented by combining different amounts of these three primaries. Consider a flashlight that has a slider that chooses the strength of light emitted. Setting the slider to zero, the flashlight is turned completely off Setting the slider to 255, the flashlight generates as much light as it is capable of generating. Consider three such flashlights Each light emits purely red; green; or blue light. If all three flashlights are aimed at the same spot on a white wall any color can be projected onto the wall by adjusting the slider values on the three lights in different ways. http://www.rapidtables.com/web/color/RGB_Color.htm

What about pictures? Could you encode an image as a sequence of bits? Starting from the upper-left pixel, scan the image left-to-right, top-to-bottom Record each pixel that you encounter. How many bits would be required for a 100x100 image? 1024x768 image? Most JPG files of 1024x768 are about 3-4 Meg. How? 100*100*3*8 = 240,000, three primary color RGB, each one uses a byte to store how much red [0,255] 1024*768*3*8=18,874,368 Most JPG files of 1024x768 are about 3-4 Meg. How? compression

What about pictures? There are many different ways to encode the same information. Some ways use more bits than others. Consider a black & white 8x8 image. Use 0 for white and 1 for black This is known as 'raw' or 'bitmap' format 1

What about pictures? Run length encoding is another way to encode images A 'run' is the length of successive like-colored pixels Store the lengths of these runs for each row, starting with white 1 2,4,2 1,1,4,1,1 1,1,1,2,1,1,1 1,6,1 1,2,2,2,1 Raw Run Length Can you think of numbers in the Run Length code above that are not needed?

Data Compression Consider another way to store images. Raw pixels 01111100 01000010 01001000 01000100 00000000 Raw pixels Run Length Encoding 1, 5, 2 1, 1, 4, 1, 1 1, 1, 4, 1, 1 1, 5, 2 1, 1, 2, 1, 3 1, 1, 3, 1, 2 1, 4, 1, 1 8 a total of _____ numbers a total of ____ numbers Of course, RLE doesn’t always work - consider a checkerboard. 64, 31 compression - a way to represent data in more compact form

Compression When data is compressed, information is encoded using fewer bits. This speeds transmission Reduces storage cost (smaller drives) May increase processing (must un-compress to view/process) For pictures, there are two types: Lossless: No information is lost Lossy: Information may be lost

Lossy (jpg) and Lossless (png)

Hexadecimal

Hexadecimal Base is 16: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. It takes four digits of binary to represent one digit of hexadecimal. Convert a hexadecimal number into binary 3A16 = 0011 10102 E716 = 1110 01112 Convert a binary number into hexadecimal 10100102 = 0101 0010 grouped with padding = 5216 110111012 = 1101 1101 grouped = DD16

Hexadecimal Convert a hexadecimal number into its decimal equivalent Multiplying the decimal equivalent of each hexadecimal digit by the corresponding power of 16 and add the resulting values. C0E716 = (12 × 163) + (0 × 162) + (14 × 161) + (7 × 160) = (12 × 4096) + (0 × 256) + (14 × 16) + (7 × 1) = 49,38310

Octal Base is 8 0,1,2,3,4,5,6,7 It takes three binary digits to represent an octal digit

Octal Converting from octal to binary 658 = 110 1012 178 = 001 1112 Converting from binary to octal: 1011002 = 101 1002 grouped = 548 100112 = 010 0112 grouped with padding = 238 Converting from octal to decimal: 658 = (6 × 81) + (5 × 80) = (6 × 8) + (5 × 1) = 5310 1278 = (1 × 82) + (2 × 81) + (7 × 80) = (1 × 64) + (2 × 8) + (7 × 1) = 8710