Representing Concepts Part 2--

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

1 Chapter 2 The Digital World. 2 Digital Data Representation.
Comp 1001: IT & Architecture - Joe Carthy 1 Review Floating point numbers are represented in scientific notation In binary: ± m x 2 exp There are different.
Bits are Not just for Numbers or Characters Computers store characters as bits or binary digits. Characters from the English-language keyboard can be represented.
Bits are Not just for Numbers Computers store characters as bits or binary digits. Characters from the English-language keyboard are represented in ASCII.
Connecting with Computer Science, 2e
1 The Information School of the University of Washington Nov 6fit more-digital © 2006 University of Washington Digital Information INFO/CSE 100,
March 2006Taner Erig - EMU2-1 Metamorphosis of Information How is information represented and how do computers store information?
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 12 Data.
How Images are Represented Bitmap images (Dots used to draw the image) Monochrome images 8 bit grey scale images 24 bit colour Colour lookup tables Vector.
Management Information Systems Lection 06 Archiving information CLARK UNIVERSITY College of Professional and Continuing Education (COPACE)
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Digital Information Technology
©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,
1 Bitmap Graphics It is represented by a dot pattern in which each dot is called a pixel. Each pixel can be in any one of the colors available and the.
Data Handling Topic 1. Data Data is the raw material entered into a computer system. This raw material could be text, numbers, graphics, audio, animation.
Higher Computing Data Representation.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
Topics Introduction Hardware and Software How Computers Store Data
Chapter 1 Data Storage(2) Yonsei University 1 st Semester, 2014 Sanghyun Park.
CSCI-235 Micro-Computers in Science Hardware Part II.
Practical PC, 7th Edition Chapter 17: Looking Under the Hood
Computers and Scientific Thinking David Reed, Creighton University Data Representation 1.
Lab #5-6 Follow-Up: More Python; Images Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
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.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Chapter 3 Representation. Key Concepts Digital vs Analog How many bits? Some standard representations Compression Methods 3-2.
Data Representation The method of data representation in a computer system depends upon the type of data which is being used. Three types of data are considered.
© 1999 Rochester Institute of Technology Introduction to Digital Imaging.
Logical Circuit Design Week 2,3: Fundamental Concepts in Computer Science, Binary Logic, Number Systems Mentor Hamiti, MSc Office: ,
Agenda Last class: Memory, Digitizing Numbers Today: Digitizing: Text
Marr CollegeHigher ComputingSlide 1 Higher Computing: COMPUTER SYSTEMS Part 1: Data Representation – 6 hours.
Introduction to Digital Media. What is it? Digital media is what computers use to; Store, transmit, receive and manipulate data Raw data are numbers,
Quiz # 1 Chapters 1,2, & 3.
Graphics An image is made up of tiny dots called pixels (“picture elements”) The resolution determines the.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
Data Representation The storage of Text Numbers Graphics.
Digital Imaging Fundamentals Ms. Hema C.R. School of Mechatronic Engineering.
Marwan Al-Namari 1 Digital Representations. Bits and Bytes Devices can only be in one of two states 0 or 1, yes or no, on or off, … Bit: a unit of data.
CSCI-100 Introduction to Computing Hardware Part II.
 By Bob “The Bird” Fiske & Anita “The Snail” Cost.
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.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 2 Lecture 2 – Digital Representations.
HOW SCANNERS WORK A scanner is a device that uses a light source to electronically convert an image into binary data (0s and 1s). This binary data can.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
Data Representation. In our everyday lives, we communicate with each other using analogue data. This data takes the form of: Sound Images Letters Numbers.
DATA Unit 2 Topic 2. Different Types of Data ASCII code: ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that.
Data Representation.
Everything is a number Everything in a computer memory and on storages is a number. Number  Number Characters  Number by ASCII code Sounds  Number.
Binary Notation and Intro to Computer Graphics
Topics Introduction Hardware and Software How Computers Store Data
Binary Representation in Audio and Images
Computer Science Higher
CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS
CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS
Ch2: Data Representation
Computer Systems – Unit 1
Topics Introduction Hardware and Software How Computers Store Data
Chapter 2 Data Representation.
How Computers Store Data
WJEC GCSE Computer Science
Presentation transcript:

Representing Concepts Part 2-- What we’ll cover for Part 2 : Representing concepts in a computer 1st type: Numeric values --brief review Today: How are some of the other concepts represented in the box? 1234

Information theory: Study of the most efficient way to encode concepts: information that interests us. All information must be captured & stored, processed, and transmitted. Using numbers to represent information allows us to use a discrete symbol system: distinct, unambiguous, precise. Discrete numbers are much easier to engineer than continuous numbers. Quick review of Part 1: How do we represent numeric values such as 1378 or 17.2351 in a computer? Logical structure? Physical structure? Mathematical operations (add, subtract, multiply, divide) operate on numeric information.

1 0 1 1 base 2 1 1 1 1 base 2 Digression: Binary Addition 1 1 1 Rules 0 + 0 = 0 1 + 0 = 0 + 1 = 1 1 + 1 = 1 0 Carry: 1 1 1 1 0 1 1 base 2 1 1 1 1 base 2 1 1 Sum: 1

Representing characters A - Z a - z 0 - 9 ! @ # $ % ^ & * ( ) + = Must work with binary coding schemes (why?) Digression: the program determines if a stored bit pattern represents a numeric value, or an alphanumeric text, or part of a sound, or part of a picture, or part of an instruction..... With unique bit patterns, we can represent any character (including foreign characters), just the way we already used unique bit patterns to represent decimal values……

Another digression: However: Bit patterns that represent characters (alphanumeric) are typically not used used for mathematical computations like add or subtract. Instead: alphanumeric characters are mostly used to store textual content, which may be sorted or concatenated. So: although both numeric values (used for counting & math) and alphanumeric characters (used for text) are both represented using a bit pattern, they are treated differently.

Consider: Number characters (alphanumeric) are treated by the computer as text characters: 9 not= “9” 9 + 9 = 18 while “9” + “9” = “99” The Binary pattern that represents 9 is different from the binary pattern that represents “9”. yet sorting is possible because text characters also have a binary (numeric) value: The numeric value of the binary representation of a is smaller than b and also b is smaller than c and so on …

NOTICE how A < B < C …… 128 64 32 16 8 4 2 1 “Place” “0” 0 1 0 1 0 0 0 0 “1” 0 1 0 1 0 0 0 1 “2” 0 1 0 1 0 0 1 0 “A” 0 1 0 0 0 0 0 1 “B” 0 1 0 0 0 0 1 0 Letter B in binary code “C” 0 1 0 0 0 0 1 1 Letter B “in the box” How to represent C ??? NOTICE how A < B < C ……

Number of symbols possible Remember? x bits could represent 2x numbers 2 bits  22 = 4 different bit patterns Bit pattern 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Decimal value 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 bits?  16 different [24 = 16] SAME THING when representing alphanumeric characters: A two-bit code (two bulbs) can represent (e.g. encode) four unique characters.

22 = 4 A Base # bits = number of unique B C D = combinations 22 = 4 Base # bits = number of unique combinations (that represent values) = A B 1 C D

Base# of bits used = number of unique symbols the coding scheme can represent Bit pattern length LOGICAL Representation (bit coding scheme): CORRESPONDS DIRECTLY to the PHYSICAL Representation (hardware “bits”): How many bulbs (switches, transistors, vacuum tubes, magnetized locations on disk, ...) #-of-States # of bulbs = number of unique symbols the bulbs can represent

What if we use more expensive light bulbs? OFF LOW HIGH QUICK! Would that allow us to represent/encode MORE or LESS unique things? WHY? (assume will use only 2 bulbs) Then what has changed? Not how many bulbs, but what? #-of-States # of bulbs = number of unique combinations; which indicates number of unique values the bulbs can represent = A B C D 1 2 E F G H I 32 = 9 combinations

A D G B E H? C F = = 23 = 8 combinations What if we don’t want to use complicated bulbs---how else can we INCREASE how many things can be represented?? So, base (# of states) is two: (0 , 1) (off , on) NOW what MUST change? #-of-States # of bulbs = number of unique combinations; which indicates number of unique things the bulbs can represent Base# of bits used = number of unique things the coding scheme can represent 1 = A B C D E F G 1 = H? 23 = 8 combinations

22 = 4 combinations 23 = 8 “ 24 = 16 “ 25 = 32 “ 26 = 64 “ 27 = 128 “ 23 = 8 “ 24 = 16 “ 25 = 32 “ 26 = 64 “ 27 = 128 “ 28 = 256 “ 216= 65536 “ .... .... So, to get more things represented, we just keep adding bits (or light bulbs)

For alphanumeric character values: Bit pattern 0101 0000 0101 0001 0101 0010 0101 0011 (etc) 0100 0001 0100 0010 0100 0011 0100 0100 0100 0101 Character (text) value 1 2 3 A B C D E 7, 8, 16, 32, and 64-bit patterns are used for alphanumeric character values: 27= 128 character values 28= 256 character values 216= 65,536 character values 232= > 4 billion char values 264= 18,446,744,073,709,551,616 character values 14

Challenge 1: 26 upper-case characters in our alphabet Challenge 1: 26 upper-case characters in our alphabet. Want our electronic word processor to manipulate all 26. Must create binary coding scheme that will allow us enough unique patterns to encode all 26. What is the minimum bit pattern length that is required for our coding scheme? (minimum number of bulbs) What two parts of the equation do we already know? Base# bits used = no. of unique things coding scheme can represent States# bulbs used = no. of unique things coding scheme “ “ x 2 >= 26 x=5 (25=32)

26 >= X X=64 Maximum number of characters in the Zuni alphabet? Challenge 2: there are X number of characters in Zuni alphabet. Want our word processor to manipulate all of them. A binary coding scheme, which is six bits long, would allow enough unique patterns to be able to manipulate all the characters of the Zuni alphabet. Maximum number of characters in the Zuni alphabet? Base# of bits used = no. of unique things coding scheme can represent What parts do we already know? 26 >= X X=64

Character formats ASCII and Extended ASCII (ANSI): Standard ASCII: Basic set for character data: 7-bit code can represent how many characters? 128 ANSI: Extended ASCII to 8-bits. (Windows apps use 8 bits) can represent how many characters? 8 bits: each pattern also fits nicely into 1 memory cell. 256

8-bit ASCII 0 0101 0000 1 0101 0001 2 0101 0010 A 0100 0001 B 0100 0010 C 0100 0011 Hello 01001000 01100101 01101100 01101100 01101111 In 8-bit ASCII code: In the box (memory or storage): 8 bits: one byte (one character): logical 8 bulbs: stores one byte: physical 17

Representing other information types… pictures, sounds Other codes Unicode: 16-bit code (65,536 bit patterns) Internat’l Standards Org: 32-bit code (>4 billion bit patterns) Quotable... Representing other information types… pictures, sounds

Important digression: Data can travel and be stored in the form of a signal. Signal: anything that changes with time or space. Different types of signals: Analog: continuous values (measurable) Most of what we see/hear is in ANALOG form: sound, light, water, electricity, temperature, wind: can be plotted as a continuous, undulating line or wave. time Digital: discrete values (countable, like numbers) time

Converting analog info to digital form: Most natural forms of information (pictures, sounds) are in analog form--continuous values E.g.: Sound: how loud? How high? (pitch) E.g.: Color: GRAY . But how GRAY is it? No precise way in analog world to determine this perfectly and the same each time. G G G G Computers: designed to store and process (and transmit) discrete, on/off signals. So with digital computers, we’ll have to change analog signals with infinite precision into digital signals with finite precision. That process is called “digitizing” (or “sampling”).

Advantages of digital (over analog) Digital signals offer the following, and more… Known Precision Ordinality (built-in order of numbers) Shades from darkest to lightest are expressed as numbers, from smallest to largest. Example: Eight shades to work with, from black to white: 1 2 3 4 5 6 7 000 001 010 011 100 101 110 111 Absolute perfect replication Analog: Copy of a copy of a copy…..last as good as original? Content analysis much easier Compression techniques work well (later!!)

Representing visual info Images; graphics Computer images: formed by collections of dots; each dot is a picture element: pixel. How image is represented & stored inside the computer (logical structure) can be radically different. Bitmapped: Also called Raster Object-oriented: Also called Vector Each has its own advantages, disadvantages, and particular uses.

Bitmap graphics Image is represented by bits. Each bit pattern defines one pixel. Good illustration: SCANNER Regular photograph. What kind of information is it? What kind of information can be stored and manipulated inside a digital computer? Essentially, then, what does your SCANNER have to do? In laymen’s terms, how? Phys’l: Log’l: 000 001 010 011 100 101 110 111 0 1 2 3 4 5 6 7 Dec’l Binary 23

Stored representation of such a picture: “bitmap” or “pixmap” Stored bits are like a map of image being represented. B&W Image Bitmap Physical representation of bits are actually stored in memory. Program? Knows nothing about shapes of objects; only which pixels are what color value (more shortly…) 24

Monochrome (Black&White). If a single pixel can be either black or white, then how many bits are needed to represent one pixel? Why? 1 25

2? = 8 unique “shades” (or values of gray) Grayscale What if we want to represent more? Say, shades of gray. What has to happen to the bits stored in memory in order to represent more different values (shades) on the screen? Intuitively: LESS or MORE bits/pixel than with B&W? ILLUSTRATION: If a single pixel can be any one of eight shades, what minimum # of stored bits is needed to represent that one pixel? (Length of coding scheme?) 0 1 2 3 4 5 6 7 00 01 10 11 ? ? 000 001 010 011 100 101 110 111 OK, what about binary bits? Are two bits enough? 2? = 8 unique “shades” (or values of gray) 2? = 256 unique “shades” (or values of gray) 26

Editing bitmaps

Number of shades possible REMEMBER BACK? Bit pattern length Base# of bits used = number of unique concepts/values the coding scheme can represent Bit pattern length Base# of bits used = number of unique shades/colors the coding scheme can represent NOTICE a PATTERN HERE ? 28

Representing color Color Primary colors for computer graphics: RGB Digression: Why RGB? The additive reproduction process mixes various amounts of R, G and B light to produce other colors. For more information: Primary colors http://www.beer.org/~tpark/color.html How colors work: http://www.rgbworld.com/color.html 29

224 = ? ~16.7 million unique color values. “True” color uses a 24 bit code to represent each color value: (photographic quality) 8 bits for red (28 = 256 shades of red) 8 bits for green (28 = 256 shades of green) 8 bits for blue (28 = 256 shades of blue) 8 bits Combine various shades to make various color combinations (provides lots of bit patterns). SO: If one pixel is represented by a 24-bit code, how many different COLOR VALUES can a single pixel display? 224 = ? ~16.7 million unique color values. 30

LOOKING IN THE BOX: 24 bits stored for EACH PIXEL! 000000000000000000000000 = BLACK = All OFF 000000000000000000000001 000000000000000000000010 000000000000000000000011 Again, imagine an advancing odometer that would show all of the color values between black and white …! 000000000000000000000100 000000000000000000000101 000000000000000000000110 000000000000000000000111 000000000000000000001000 AND LOTS MORE! 111111111111111111111111 = WHITE = All ON

File formats for bitmap graphics File format : How information is encoded & stored Different software apps understand different graphics file formats (encoding systems). TIFF, GIF, JPEG, BMP,... Some better for certain purposes... Beyond the scope of COMP 4. When saving an image file one can usually choose a file format from a selection. PowerPoint, for example, recognizes a number of graphics file formats, but not all. However, utilities (filters) can interpret and convert one file format to another. Software often comes w/filters (or can download from software vendor’s Web site).

Advantages, disadvantages, applications: Photo realism. Software: Photo editing, and Paint. Can work at pixel level. HUGE files without compression! Storage and download time! Images do not scale up well: Image resolution is important Original bitmapped graphic Same image scaled up

Vector graphics Uses instructions to draw lines, fill shapes (rather than tracking and storing bits for each pixel)…. In English: “Draw a circle at the point that is 100 pixels to the right and 140 pixels down from the top-left corner of the screen with the radius of 25 pixels.” Software: Drawing. Shapes are known to the program. Does not work at pixel level, but rather at object-level. Scalable, no jaggies. Files relatively small Layering: “2 ½ dimensions” Seeing more vector graphics for the Web: .sfv, .cmg

Representing sound Produced by vibration; transmitted over a medium. another important means of conveying information. Produced by vibration; transmitted over a medium. Sound travels in analog wave patterns. Wave characteristics: amplitude (loudness) and frequency (pitch) can be measured & sampled over time, and stored as a sequence of binary numbers. Called? “Digitizing” or “sampling” Much like scanning an analog photograph spatially creates a digital bitmap. The higher the sampling rate, the better the quality of the digital signal!

Analog to digital audio dB Samples time Sampling rate Analog sounds can be: Captured in analog form by an analog microphone Converted to digital form by an ADC (audio to digital converter) Stored as file on a digital storage device (CD or hard drive). Then, for playback to human ears: Converted to analog form by a DAC (digital to analog converter) Played back by analog speakers.

These days, we can get Digital capture and player devices for both audio and video. Digital cameras Digital camcorders Digital microphones So, for that data, the computer does not need ADC or DAC converters: captured and played all in the same digital mode. MP3 files: file format that squeezes digital sound into small files through sophisticated compression adapted to the human ear (more later). Fast to download; less to store.

SUMMARY! We can use bit patterns of zeroes and ones to represent: Numeric values Alphanumeric text Pictures (bitmaps) Sounds and Instructions Vector graphics; MIDI (music); General programming (coming) RECAP: SOFTWARE determines if a stored bit pattern represents a numeric value, or alphanumeric text, or part of a sound, or part of a picture, or part of an instruction..... all bits look the same to the CPU!