Download presentation
Presentation is loading. Please wait.
Published byRalf Pierce Modified over 9 years ago
1
Marr CollegeHigher ComputingSlide 1 Higher Computing: COMPUTER SYSTEMS Part 1: Data Representation – 6 hours
2
Marr CollegeHigher ComputingSlide 2 Data Representation Positive 8-bit binary numbers Convert binary to decimal 1.Write place headings 2.Write binary number 3.Total headings where 1 present (ignore 0s) 1286432168421 01011101 => 64 + 16 + 8 + 4 + 1 = 93 Binary 0101 1101 is Decimal 93 Place headings Binary number INT 2
3
Marr CollegeHigher ComputingSlide 3 Data Representation Advantages of Binary Advantages 1 Binary 0 and 1 can be simply used to represent OFF or ON 2 A “degraded” signal can still be detected as representing 1 3 Binary has only 5 rules for addition making calculations simpler. INT 2
4
Marr CollegeHigher ComputingSlide 4 Data Representation Range up to and including 32-bits The range of positive integer numbers in binary up to 32 bits are detailed in the table below: UnitRange 1 Bit0 to 2 1 – 1 (0 to 1) 8 bits (1 Byte)0 to 2 8 – 1 (0 to 255) 16 bits (2 bytes)0 to 2 16 – 1 (0 to 65,535) 24 bits (3 bytes)0 to 2 24 – 1 (0 to 16, 777, 215) 32 bits (4 bytes)0 to 2 32 – 1 (0 to 4,294,967,295) These measurements are used to determine the lower and upper limits of the range numbers possible with a given amount of bits or bytes.
5
Marr CollegeHigher ComputingSlide 5 Data Representation Negative numbers and two’s complement Two’s complement 1 State the positive binary number 2 Invert 0s and 1s 3 Add 1 1286432168421 00001001 11110110 00000001 11110111 => (-128 )+ 64 + 32 + 16 + 4 + 2 + 1 = - 9 Rules of Binary Addition 0 + 0 = 01 + 1 = 0 carry 1 0 + 1 = 11 + 1 + 1 = 1 carry 1 1 + 0 = 1 Example: Represent -9 using two’s complement method. = +9 = Inversion = Add binary 1 = Answer! Indicates sign 0 = +, 1 = -
6
Marr CollegeHigher ComputingSlide 6 Data Representation Floating point representation Here is a fractional binary number… 1 1 0 1. 0 0 1 1 0 1 1 1 0 0 1 0 Rule: Move the point in front of the digits. Binary point So the same number could be written as... 1 1 0 1 0 0 1 1 0 1 1 1 0 0 1 0 x 2 0000 0100 MantissaExponent INT 2
7
Marr CollegeHigher ComputingSlide 7 Data Representation Floating point representation And the same number would be stored in memory as… Byte 1 Byte 2Byte 3 1 1 0 1 0 0 1 10 1 1 1 0 0 1 00 0 0 0 0 1 0 0 Therefore… The mantissa stores the actual digits of the number. Increasing the number of bits increases the precision (accuracy) of the number. The exponent stores the number of places the point has been moved. Increasing the number of bits increases the range of numbers that can be stored. MantissaExponent
8
Marr CollegeHigher ComputingSlide 8 Data Representation Storage Capacity Memory is organised into groups of bytes and large files sizes are represented as powers of 2. UnitBytes 1 Bit0,1 1 Byte8 bits 1 Kilobyte (Kb)2 10 = 1024 bytes 1 Megabyte (Mb)2 20 = 1,048,576 bytes (1024 Kb) 1 Gigabyte (Gb)2 30 = 1,073,741,824 bytes (1024 Mb) 1 Terabyte (Tb)2 40 = 1,099,511,627,776 bytes (1024 Gb) These measurements are used in memory (e.g. RAM) and backing storage (e.g. hard disc, DVD etc.) INT 2
9
Marr CollegeHigher ComputingSlide 9 Data Representation ASCII - American Standard Code for Information Interchange To represent text a unique 7 or 8 bit binary code is used for each character on the keyboard. CharacterASCII codeDecimal A0100 000165 B0100 001066 Z0101 101090 a0110 000197 20011 001050 Beep0000 01117 &0010 011038 Examples of Standard ASCII Note the leftmost bit is always 0, hence only 7-bits used in Standard ASCII. The ‘eighth bit’ increases the range of possible characters to 256 and gives Extended ASCII. A character set is the complete set of characters that are on the keyboard e.g. 1 2 3, a b c, ! ” £, and control characters. A control character is non-printable e.g. RETURN, TAB, ESCAPE, SPACE etc. They are the first 32 characters in ASCII. ASCII enables the transfer data from one computer or software package to another e.g. email. It is the simplest form of text with no formatting. INT 2
10
Marr CollegeHigher ComputingSlide 10 Data Representation Unicode Unicode is a 16-bit code (2 bytes) that supports 65,536 characters Snapshot of German keyboard Advantages A code for every character based alphabet in the world Has codes for Chinese, Arabic etc. Covers all punctuation marks and control characters
11
Marr CollegeHigher ComputingSlide 11 Data Representation Bitmapped graphics Any graphic is made up from a series of pixels (picture elements). Each pixel is an individual dot on the screen. The BIT MAP of the imagePixel pattern using 8 x 8 grid In a monochrome graphic, each pixel is represented by either 0 - white OR 1 - black INT 2
12
Marr CollegeHigher ComputingSlide 12 Data Representation Resolution The quality of the image depends on the number of pixels More pixels means higher resolution and clearer, sharper image. Pixel pattern using 8 x 8 gridPixel pattern using 16 x 16 grid High resolution = many small pixels, larger file size Low resolution = larger pixels, smaller file size INT 2
13
Marr CollegeHigher ComputingSlide 13 Data Representation Storage Each pixel requires 1 bit of storage. So, the more pixels used, the larger the file size. 8 x 8 = 64 bits 64 bits / 8 = 8 bytes File size of this graphic is 8 bytes Example 1 16 x 16 = 256 bits 256 bits / 8 = 32 bytes File size of this graphic is 32 bytes Example 2 INT 2
14
Marr CollegeHigher ComputingSlide 14 Data Representation Bit-depth and no. of colours up to 24-bits (true colour) Bitmap graphics are made up of pixels (dots) and each dot is stored as bits or bytes in memory. Bit-depth is the number of bits used to represent shades of colours of a pixel. ColoursBitsBytes 21 1/81/8 164 1/21/2 25681 65, 536162 16, 777, 216243 The more bits per pixel the more colours can be used - but file size will increase.
15
Marr CollegeHigher ComputingSlide 15 Data Representation Dots per inch (dpi) Dpi is a measure of how many pixels (dots) are in an square inch. Printers and scanners state resolution in dpi. Example The dimensions of an image are 4” x 6”, the resolution is 300 dpi and it is black and white. Calculate the file size. Formula: Pixels / bits = length x breadth x dpi 2 4 x 6 x 300 x 300 = 2,160,000 bits => 2160000 / 8 = 270,000 bytes => 270,000 = 263.7 kilobytes File size of this graphic is 263.7 bytes
16
Marr CollegeHigher ComputingSlide 16 Data Representation Bitmapped graphics Advantages Individual pixels can be edited Complexity of image does not affect file size Can be compressed to JPEG, GIF or TIFF to reduce file size Disadvantages ×Large file size e.g. 3 bytes per pixel ×Individual objects cannot be edited ×Resolution dependent: low resolution = low quality ×Image ‘pixellated’ when resized bigger Pixellated bitmap
17
Marr CollegeHigher ComputingSlide 17 Data Representation Need for compression of bitmaps Bitmapped graphics often have a large file size. So... A 1024 x 768 24-bit colour graphic has a file size of 2.25 Megabytes. An image of this size would be slow to transmit across a network or slow to download from the Internet.... Bitmaps can be compressed using compression algorithms into JPEG or GIF to reduce file size and enable faster transfer / download across networks.
18
Marr CollegeHigher ComputingSlide 18 Data Representation Need for compression of bitmaps JPEG (Joint Photographics Expert Group) Lossy compression algorithm where some pixel data is removed, but retains 24-bit colour and minimal loss of quality to human eye – ideal for photographs.
19
Marr CollegeHigher ComputingSlide 19 Data Representation Need for compression of bitmaps GIF (Graphics Interchange Format) Lossless compression algorithm where colour depth is reduced to 8-bit resulting in 256 colours – ideal for clip art etc but not for photographs.
20
Marr CollegeHigher ComputingSlide 20 Data Representation Vectored graphics Vectors are stored as a description of the objects that make up the graphic e.g. start x, start y, line thickness, fill colour etc. Advantages Individual objects can be edited Objects can be grouped and manipulated as one Are resolution independent i.e. same quality regardless of resolution Do not lose quality when resized Small file size as values not stored for every pixel Disadvantages ×Cannot be edited at pixel level ×File size can be large if many objects / layers
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.