1 / 24

Data Representation

Data Representation. Miss Skinner. Decimal Numbers. Every day we use decimal numbers to represent numerical data: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 This is a 10 base system. The Binary Number System. Using only 2 numbers to represent what happens inside the computer is called the binary system.

belita
Download Presentation

Data Representation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Representation Miss Skinner

  2. Decimal Numbers Every day we use decimal numbers to represent numerical data: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 This is a 10 base system

  3. The Binary Number System Using only 2 numbers to represent what happens inside the computer is called the binary system. 1 = On 0 = Off This is a 2 base system

  4. Why use the Binary system? Computers use the binary system and not decimal number system for various reasons: It is a simple two state system where 1 = ON & 0 = OFF Arithmetic calculations are simpler since there are fewer combinations of 1s and 0s. For example, there are only 4 rules for addition: 0+0, 1+0, 0+1, 1+1 where as the decimal system would require 100 rules It is easier to represent two states physically on backing storage.

  5. Units The following units are used to describe file sizes and storage capacities on a computer system:

  6. Whole Numbers Whole numbers are stored in a computer in Binary. Example: 185 128 + 32 + 16 + 8 + 1 = 185 (this shows how much 8 bits can represent)

  7. Floating Point Representation Floating point numbers are made up of a decimal fraction part called the mantissa and the power part called the exponent. Example: 987723553 = . 987723553 x 10^9

  8. Floating Point Representation Advantage: Very large and very small numbers can be represented in a few number of bits. Disadvantage: Accuracy is lost because the mantissa is rounded off to a set number of significant figures.

  9. Questions: Give one reason why computers store data using the binary system. Put the following terms in decreasing order of size: byte, TB, KB, GB, bit, MB. Convert the number 137 into 8-bit-binary Describe the two components of a floating point number.

  10. Answers Backing storage devices lend themselves to storing two physical states it is a simple two state system which only has to store 1 or 0 Arithmetic calculations are simpler Terabyte– Gigabyte – Megabyte – Kilobyte – byte - bit 128 + 8 + 1 128 + 8 + 1 = 137 Mantissa – decimal fraction part Exponent - the power part

  11. Intermediate 2 Computing Wiki Computer Systems Task 1 – positive numbers Task 2 – units exercise Extension – Binary Game (In THAT order!)

  12. Negative Numbers (Higher) Signed Bit Representation The simplest way of representing a negative number is to use the first bit of the number to represent whether the number is positive or negative. 011 = 3 111 = -3 The problem with signed bit representation is that there are 2 values for zero: 000 = 0 100 = -0

  13. Negative Numbers (Higher) Two’s Complement Representation A better way of representing negative numbers in binary is by using Two’s Complement. Two’s complement is designed so that the set of integers show symmetry about zero Example -7 Step 1: Write out the number as a positive Step 2: Reverse the 1s and 0s Step 3: Add 1

  14. Representing Text ASCII Stands for: American Standard Code for Information Interchange ASCII uses 7 bit code which can be used to store 128 characters Extended ASCII uses 8 bit code which can be used to store 256 characters. Control Characters – characters that don’t print on the screen but affect the layout e.g. RETURN, TAB etc. (first 31 characters on the keyboard) Character Set – letters, numbers and symbols on your keyboard. e.g. – uppercase letters ABC Numerics 123 lowercase letters abc Symbols !”£

  15. Representing Text TASK Using the ASCII table and Decoding sheet, crack the secret code: 01001001, 01000011, 01010100, 00100000, 01101001, 01110011, 00100000, 01110100, 01101000, 01100101, 00100000, 01100010, 01100101, 01110011, 01110100

  16. Representing Text (Higher) UNICODE The fact that ASCII can only store the maximum of 256 characters creates a problem for international communication. The 256 characters are based on European alphabets and don’t include Arabic or Japanese characters. UNICODE can store 65,536 characters.

  17. Bitmapped Graphics A bitmapped graphic stores the data of 2D grid of pixels. Pixels are the tiny dots that make up the image. Pixel Stands for PICTURE ELEMENT Resolution – is the number of pixels in a fixed area. High resolution is a large number of small pixels. Low resolution is a small number of large pixels. Bit Depth – The number of bits used to encode the colour of each pixel. The higher the bit depth, the higher number of colours that can be represented.

  18. Bitmapped Graphics

  19. Each pixel in a black and white graphic can have two possible states: black or white. One bit is required to store the colour of each pixel. Black = 1 White = 2 Therefore the number of bits required to store black and white image is the same as the number of pixels in the graphic. Storage Calculations HOW MANY BITS ARE REQUIRED TO STORE THIS IMAGE?

  20. EXAMPLE: An image that is 240 pixels by 320 pixels 240 x 320 = 76,800 pixels Each pixel requires 1 bit of storage. Therefore the total storage is: 76,800 bits = 76,800 / 8 = 9,600 bytes / 1024 =9.4 KB Storage Calculations

  21. Questions: What do the letters ASCII stand for? What is a character set? Explain how a bit-mapped graphic is stored on a computer system. Calculate the storage requirements in BYTES for a black and white graphic that measure 560 by 400 pixels.

  22. Answers American Standard Code for Information Interchange, it is used to represent text in a computer system. A character set is the complete list of characters that a computer system can represent. E.g. ABC, abc, 123, !ӣ$ A graphic is stored as a bitmap in which binary code represents the colour of each pixel that makes up the graphic. Storage Requirements = 560 x 400 = 224,000 bits 224,000 / 8 = 28,000 bytes TerabyteРGigabyte РMegabyte РKilobyte Рbyte - bit 128 + 8 + 1 128 + 8 + 1 = 137 Mantissa Рdecimal fraction part Exponent - the power part

  23. Vector Graphics (Higher) A vector graphic stores the image as a list of objects, each object being described by its attributes. For example: rectangle, circle, line objects Example: Line: start X, start Y, end X, end Y, line colour, line thickness Circle: centre X, centre Y, radius, fill colour, line colour Rectangle: start X, start Y, length, breadth, fill colour, line colour

  24. Vector Graphics v Bitmapped (Higher)

More Related