Data Representation The storage of Text Numbers Graphics.

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

Technology ICT Option: Data Representation. Data Representation In our everyday lives, we communicate with each other using analogue data. This data takes.
1 Chapter 2 The Digital World. 2 Digital Data Representation.
The Binary Numbering Systems
Hardware. Basic Computer System Central Processing Unit Input Devices Output Devices Backing Storage Devices.
Connecting with Computer Science, 2e
Lecture 6 Graphics, Number Systems. 7.2 Bit-map Graphics Similar to real painting on the canvas, there is no way to change something but paint over it.
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
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.
Communications Technology 2104 Mercedes Lahey. Bit 1. bit=From a shortening of the words “binary digit” 2. the basic unit of information for computers.
Chapter 5 Data representation.
Higher Computing Data Representation.
Computer Systems Nat 4.5 Computing Science Data Representation Lesson 4: Storing Graphics EXTENSION.
Computing Higher - Unit 1… Computer Systems 1 Higher Computing Unit 1 – Topic 1 Data Representation.
Data and Program Representation
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 1. Data Representation Data Representation – Why do we use binary? simplicity,
Data Representation Int 2 Computing Unit 1 – Computer Systems St Kentigern’s Academy.
CS Topic 1 - Data Representation v2 1 Data representation considers how a computer uses numbers to represent data inside the computer. Three types of data.
Chapter 2 Computer Hardware
Shawlands Academy Higher Computing Data Representation.
Data Representation A series of eight bits is called a byte. A byte can be used to represent a number or a character. As you’ll see in the following table,
Graphics A graphics program allows you to combine pictures and text in many different ways. Features – General Level Draw graphics Enter Text Common Tools.
Slide 1 Wednesday, October 07, 2015 Low Level Machine.
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.
Why does it matter how data is stored on a computer? Example: Perform each of the following calculations in your head. a = 4/3 b = a – 1 c = 3*b e = 1.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
Bits and Bytes IGCSE. A binary number is either a 0 or a 1 and is known as a 'bit' or b inary dig it. However, the CPU cannot deal with just one bit at.
Marr CollegeHigher ComputingSlide 1 Higher Computing: COMPUTER SYSTEMS Part 1: Data Representation – 6 hours.
Quiz # 1 Chapters 1,2, & 3.
Graphics An image is made up of tiny dots called pixels (“picture elements”) The resolution determines the.
Int 2/ Higher - Data Representation - 1 Why use Binary? It is a two state system (on/off) which makes it simple to operate Even if degradation of current.
Computer Systems Nat 4.5 Computing Science Data Representation Lesson 4: Representing and Storing Graphics EXTENSION.
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.
Resolution The resolution of an image is determined by the number of individually addressable points that make up the image, whether it is the number.
Graphics in a computers memory How a picture (i.e. a graphic) is stored in a computers memory A computer screen is made up of little dots, called PICture.
Data Representation.
2.1.4 Data Representation Units.
Know what a computer is used for Understand the difference between hardware and software Be able to describe the way that data is stored in a computer.
Sci Vis I Exam Review Most Missed Review Questions.
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Data Representation. In our everyday lives, we communicate with each other using analogue data. This data takes the form of: Sound Images Letters Numbers.
OCR Computing OGAT Data Types. What OCR need you to know… Data Types a) Primitive data types, integer, real/floating point, character,
Text and Images Key Revision Points.
Computer Systems Nat 5 Computing Science Data Representation
Unit 2.6 Data Representation Lesson 3 ‒ Images
Storing Graphics Nat 5 Data Representation Lesson 4a: Storing Graphics
Images Data Representation.
Data Representation.
Computer Systems Nat 4/5 Data Representation Lesson 4:
3.1 Denary, Binary and Hexadecimal Number Systems
Computer Science Higher
Intermediate 2 Computing
Learning Intention I will learn how a computer stores graphics.
GRAPHICS Source:
Ch2: Data Representation
Summer Term Year 10 Slides
Computer Systems – Unit 1
Chapter 2 Data Representation.
Why use Binary? It is a two state system (on/off) which makes it simple to operate Even if degradation of current occurs (ie a slight drop in voltage)
How Computers Store Data
Computer Systems.
Computer Systems Nat 4.5 Computing Science Data Representation
Option: Data Representation
Computer Systems Nat 4/5 Data Representation Lesson 4:
Presentation transcript:

Data Representation The storage of Text Numbers Graphics

As everything in binary is to do with powers of 2, we don’t use thousands, millions, billions etc. 1 bit (binary digit) = 0 or 1 (2 3 ) 8 bits = 1 byte (2 10 ) 1024 bytes = 1 Kilobyte (2 20 ) 1024 Kb = 1 Megabyte (2 30 ) 1024 Mb = 1 Gigabyte (2 40 ) 1024 Gb = 1 Terabyte

Data Representation ASCII is a 7 bit code giving a unique code for 128 characters. The first 32 are CONTROL CODES which make something happen. The rest are alphanumeric characters on the keyboard. As computers use 8 bits as a minimum, this allows an extended ASCII set to include symbols like square root, some foreign letters etc.

Data Representation Even with 8 bits for ASCII there are only 256 possibilities, not nearly enough to code alphabets from other languages UNICODE solves this problem. Unicode uses 16 bits for each character giving different codes. This proves sufficient to code all the main alphabets of the world.

Data Representation In base 2 binary, the headings are powers of two Headings:….8421 Number Giving 1 eight 1 four 1 two 0 unitsmaking 14 in decimal

To change any binary number to decimal (denary): Put the headings 2 n … above the number. Add up the headings where there is a one. Example: = 99 Data Representation

To change any decimal number to binary you divide repeatedly by 2. The remainders become the binary number. Example 57 2 | 57 2 | 28 R 1 2 | 14 R 0 2 | 7 R 0 2 | 3 R 1 2 | 1 R 1 0 R 1 Data Representation =

However, you can more easily work it out from the headings E.g. 46 This needs a 32 an 8 a 4 and a Data Representation

In two’s complement, you represent a negative by: Write its positive value in binary Flip each bit (1  0, 0  1) Add 1 Example: -18 using 8 bit numbers. 18 = Flip Add

How do you find the value of a two’s complement number? Flip and add 1 to get the value. (i.e. do the 2’s complement again) Eg This is -ve because it begins with a 1 Flip : Add 1 : = 53, so the original number was –53. Data Representation

In storing numbers the computer always sets aside the same amount of storage locations in RAM. It doesn’t matter if the number is 3 or 5 billion. Let’s say it just sets aside 1 byte for integers. 8 bits can hold 2 8 = 256 different values With 2 bytes for each integer: 16 bits can hold 2 16 = different values.

Data Representation Now if 8 bits can hold 2 8 = 256 different values The RANGE is 0 to 255 With 2 bytes for each integer: 16 bits can hold 2 16 = different values. The RANGE is 0 to

Usually 4 bytes are set aside for integer variables. For positive numbers this gives 2 32 different values. With a range from 0 to This is: 0 to Data Representation

For n bits there are : 2 n different values So the RANGE is 0 to 2 n - 1 Data Representation

For decimals Computers use The point floats to the FRONT of the number. Take This can be written.93 x 10 8 Why bother with the 10? Write it as.93 8 Why bother with the point? A computer stores it as 93 8

Data Representation The floating point number 93 8 Is made up of a MANTISSA: 93 And an EXPONENT: 8 Of course all this is done in binary on the computer with two’s complement for negatives.

With floating point storage locations have to be set aside for both the mantissa and the exponent. Decisions have to be made about how many bits for the mantissa and how many for the exponent. As you have seen this affects the range of values that can be stored. Data Representation

If you increase the storage for the mantissa you increase the PRECISION (accuracy) that real numbers can be stored in (more significant figures). If you increase the storage for the exponent, you increase the RANGE of numbers that can be stored. Data Representation

Computer pictures / images are made up of dots on paper, called pixels on a display. A typical printer will print 600 or 1200 dpi. A monitor displays 72 or 90 dpi. In black and white these pixels can be stored as a 1 or a 0. So one bit per pixel. Resolution is the number of pixels or dots used. Data Representation

To store colours, you need more than one bit per pixel. Colour depth is the name for how many bits are stored per pixel for colours. 1 bit gives 2 1 colours = 2 2 bits gives 2 2 colours = 4 3 bits gives 2 3 colours = 8 4 bits gives 2 4 colours = 16 8 bits gives 2 8 colours = bits gives 2 16 colours = bits gives 2 24 colours = (called true colour)

Data Representation If this was part of a screen using 4 colours 00white 01green 10red 11black Then it would be stored as shown on the left

Data Representation If a computer screen has 1024 pixels along and 768 up and had 256 colours You need 8 bits per pixel: 1024 x 768 x 8 = bits / 8 = bytes / 1024 = 768 Kb approx.

Data Representation If a graphic measuring 2” by 4” is scanned at 600 dpi using true colour, what is the storage requirement for the scan? True colour needs 24 bits per pixel 2 x 4 x 600 x 600 x 24 = bits / 8 = bytes / 1024 = Kb / 1024 = 8.25 Mb approx.

Data Representation Graphics that are stored pixel by pixel are called BITMAPS. Every pixel (and its colour) is mapped to a set of bits in memory or on backing storage. There is another type of graphic storage called VECTOR GRAPHICS.

Data Representation Vector Graphics store graphics as individual objects. Text is an object, a square, a circle, a line etc. Each object has ATTRIBUTES. For instance in a graphics package a rectangle might be object number 3. Attributes would be things like the co-ordinates of the corners, the line colour, fill colour etc.

Data Representation So a rectangle might be stored as : 3, 100, 200, 400, 800, 2, 3, 5 3 means rectangle. 100, 200 is the screen co-ordinates of the bottom left corner. 400, 800 the co-ordinates of the top right corner. 2 is the colour of the line 3 the line thickness 5 the fill colour.

Data Representation Bitmaps use a large amount of storage You can rub out parts of a bitmap You can use paint effects in bitmap. You cannot improve the resolution of a bitmap on a better device. Vector graphics only store the objects, not the whole screen. You can edit objects in vector graphics (resize, change colour etc) You can change layers (e.g. bring to front) Resolution independent (e.g. print better quality on a better printer) Differences between bitmap and vector graphics:

Data Compression Because bitmaps can have such large files we need data compression for storing or transmitting them. A 5 Megapix camera using true colour needs 15 Meg for each photo. Because of this data compression is needed, for instance jpeg could reduce that 15 Meg photo to 2 Meg without any noticeable loss of quality.