Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 79

DATA

REPRESENTATION
Section I
Representation?

H ow
What is c om d oe
put s the
data? the er s
se t
files ore
?

Computer uses numeric


codes to store the various
kinds of data such as text,
images, songs, movies, etc.
OBJECTIVE

Candidates should be able to:

• Recognise the use of binary, denary and Hexadenary numbers in computer systems

• Convert positive denary integers into binary and positive binary integers into denary, Denary to
Hexadenary, Hexadenary to denary (a maximum of 16 bits will be used)

• Show understanding of the concept of a byte and how the byte is used to measure memory size, represent
numbers stored in registers and main memory as hexadecimal

• Use binary in computer registers for a given application (such as in robotics, digital instruments and
counting systems)

• Identify current uses of hexadecimal numbers in computing, such as defining colours in Hypertext
MarkupLanguage (HTML), Media Access Control (MAC) addresses, assembly languages and machine
code, debugging

• Show understanding that sound (music), pictures, video, text and numbers are stored in different formats
1.2 TEXT REPRESENTATION
Computer is processing millions of numbers and text
Lets think how computer process the text, the images and the
audios, the movies?

Lets Understand it now


1.1 Number systems
Counting starts….
Decimal Number System
Now, Lets Look at these images
Binary Number System
Where did u see these kind of numbers??

Note: Few letters are teamed up with the decimal number


Hexadecimal Number System
Lets watch SOME videos
Importance of Binary number system: Click here

Video V1
Lets Learn how we can switch from one number system to
another.
Converting denary 155 into 8 bit binary – Method 1

ASSGN 1
Converting denary 155 into 8 bit binary – Method 2

2 155
Denary
Binary

Eg. Convert (1110)2 to denary


Place
Value 128 64 32 16 8 4 2 1
Binary
Digit 0 0 0 0 1 1 1 0
Decimal
Value 8 4 2

8+4+2 = 14
Ans = (14) 10
Binary – Hexadecimal – Denary equivalent table
Binary Hexadecimal
Now think, How we can convert numbers from Decimal
to Hexadecimal or Hexadecimal to Decimal ???

Decimal Hexadecimal
Lets watch SOME videos

Understanding ASCII and UNICODE Click here


RECAP - CONVERSIONS

• Use the table


DECIMAL • Divide by 2 continuously and
(BASE-10)
D-B write remainders in the reverse
order
C
BINARY O
(BASE-2) N
• Use the table
V
NUMBERS SYTEM E B-D
R
T
I
O
N
S
• Replace each hexa number
by its 4 bit binary equivalent
HEXADECIMAL H-B
(BASE-16)

• Make groups of 4 from right to


left for the integer part and
B-H [add 0 to the left if needed]
• Replace each group by its
hex number

D-H D-B-H
USES OF HEXADECIMAL NUMBER SYSTEM

ERROR CODES
Hexadecimal is often used in error messages on your computer. The hex number refers to the memory
location of the error. This helps programmers to find and then fix problems.

It is shorter and easier to use Hexadecimal

For Eg. In a MAC computer if the computer was over heated then it throws a error C0010FF
USES OF HEXADECIMAL NUMBER SYSTEM

MAC ADDRESS

Here ,
NN:NN:NN – Manufacturer Identity
DD:DD:DD – Device Serial number
USES OF HEXADECIMAL NUMBER SYSTEM

IP ADDRESS
USES OF HEXADECIMAL NUMBER SYSTEM

HTML COLOUR CODES

Eg.

https://www.hexcolortool.com/#401cd4

Activity 1.7 (pg 15)


https://www.w3schools.com/colors/colors_picker.asp
BINARY ADDITION

ACTIVITY 1.8, 1.9


CONCEPT OF OVERFLOW AND OVERFLOW ERROR For Eg.

Activity 1.8/9(pg 16)

WS_Binary addition

Note : make sure that the number of digits are the same
BINARY ADDITION…..overflow

ASSGN 9-Activity
1.10(pg 17)
LEFT SHIFT AND RIGHT SHIFT ON 8 BIT BINARY

Consider the Example given below

• Bits shifted from the end of the register are lost


and zeros are shifted in at the opposite end of the
register
• The positive binary integer is multiplied or
divided according to the shift performed
• The most significant bit(s) or least significant
bit(s) are lost

Activity 1.11(pg 20)


Note : The number of shifts(Left and Right) is limited
WS_Logical shift
USING 2’ TO REPRESENT 8 BIT POSITIVE AND NEGATIVE
BINARY INTEGERS

Note : MSB(Left most bit) – 1 – indicates negative number 0 – indicates Positive number
USING 2’ TO REPRESENT 8 BIT POSITIVE AND
NEGATIVE BINARY INTEGERS

The MSB is 1 so it means its value is -8

-8+2

-6
Convert a positive binary or denary integer to a
two’s complement 8-bit integer and vice versa

WS_Two’s Complement
Note: For positive numbers it is the same as converting and putting the MSB as 0
Convert a Negative binary integer to a
two’s complement 8-bit integer and vice versa

Note: For negative numbers it is the same as converting and putting the MSB as 1 and substituting with its negative equivalent and solving the equation
Convert a Negative denary integer to binary using
two’s complement 8-bit integer and vice versa

Method 1(Using the example)


1. Put 1(one) as MSB for –ve numbers
2. Perform - 128+ 67 = -61
3. Fill up the equivalent value of 61 in
- the table (32+16+8+4+1 =61)
4. Therefore -128+61 = -67

WS_Two’s Complement

Activity 1.13/.14(pg 25)


TEXT
REPRESENTATION
1.2 IMAGE
REPRESENTAT
ION
Image file types

BMP (BitMaP image file)

JPG(Joint Photographic Expert Group)

GIF(Graphics Interchange Format)

PNG(Portable Network Graphics)

TIF(Tagged Image File Format)


Bitmap (or Raster) images

• Bitmap images are made up of PICture ELement or PIXELS


• A pixel is the smallest identifiable area of an image
• Each pixel is a single colour and is given a binary value
which represents that colour e.g. 11000000 might equal Red
• A pixel’s colour can be changed by changing this value.
VDU Pixel displays

• Similar in concept to that of a


mosaic, a VDU screen divides an
image into millions of pixels
• Pixels are arranged into rows and
columns
• A pixel is a single point in a
graphical image
Image resolution

• Resolution is the concentration of pixels within a specific area


• The area is defined by the image width and height in pixels e.g.
3264x2448
• 72dpi = screen resolution
• 300 dpi = print quality resolution

1x1 2x2 5x5 10x10 25x25 50x50


72x72 300x300
Creating a monochrome image

0 0 0 0 1 0 0 0 0 0
• Each pixel is given a binary value 0 0 0 1 1 0 0 0 0 0
0 0 1 1 1 0 1 0 0 0
• Each value represents a different
0 1 1 1 1 0 1 1 0 0
colour 1 1 1 1 1 0 1 1 1 0
0 0 0 0 1 0 1 0 0 0
• Using one bit per pixel allows only 2
1 1 1 1 1 1 1 1 1 1
values, 0 and 1 0 1 1 1 1 1 1 1 1 0
0 0 1 1 1 1 1 1 1 0
• 1 = Black, 0 = White
0 0 0 0 0 0 0 0 0 0
ASSGN 7
Increasing the number of colours

• More bits per pixel = more colour


combinations
1 bit = 2 Colours
2 bits = 4 Colours
3 bits = 8 Colours
4 bits = 16 Colours

• How many bits per pixel required for


256 colours?
Colours and resolution vs File Size

20 pixels

• How does the number of


colours affect file size?
• How does the size of the

20 pixels
image affect file size?

8 colours
Color or bit depth

• Each pixel can represent a finite number of colours

A pixel is attributed a number of n bits

The number of combinations (2n) dictates the bit depth and therefore the number of colours that can be represented

A higher bit depth gives a greater range of colour and a better quality of image

• 8 bits per pixel = 28 = 256 colours


• 16 bits per pixel = 216 = 65,536 colours
• 24 bits per pixel = 224 = 16,777,216 colours
Variation in quality

• Changing the colour depth of an image will affect the number of colours it
can display, as shown below:

2 Colours 4 Colours 8 Colours 16 Colours 256 Colours 16.7m


Colours
Image metadata

• Metadata is data about data


• It is information other than image data that is stored with a file
• This will include:
Colour depth in bits per pixel

Resolution (Height and width in pixels)

Date created

Author

Info: An image file may also contain metadata describing the type and amount of compression in the image, the software used to
create the file and, if it is a digital photograph, the date and time the image was taken and the camera/lens settings
An image with the CORRECT size metadata – The same data but with the WRONG size
16 x 24 pixels metadata – 24 x 16 pixels

The original image, before zooming


in to reveal the individual pixels.
Lets watch videos

Digital image representation Click here

How a pixel gets its color Click here

RECAP
https://www.goconqr.com/flashcard/1446377/gcse-computing-4-representation-of-data-in-computer-systems
1.2 SOUND
REPRESENTATION
What is sound?
Now think, How we can convert sound waves which are in
Analogue form into Digital ???

Sound sampling Click here


Sample rate

Sample rate Click here


Mono and
stereo sound
Click here
Lets calculate Audio file size…

ASSIGNMENT 8
Lets watch some videos

Recap Sound Click here

Recap Images Click here


What is Compression and why do we need it.

Compression exists to reduce the size of


the file

The impact of this is, e.g.:


– less bandwidth required
– less storage space required
– shorter transmission time
1.3 Data storage and compression
Measurement of Data Storage
1.3 DATA STORAGE AND FILE COMPRESSION
Example:
JPEG image, MPEG video and MP3
audio formats.
Example:
RLE,PDF, GIF and PNG
CALCULATION OF FILE SIZE
CALCULATION OF FILE SIZE…Eg 1/2
CALCULATION OF FILE SIZE…Eg 2/2

Activity 1.16(pg 33)


Run Length Encoding( RLE)

Run–length encoding (RLE) is a simple form of lossless data


compression that runs on sequences with the same value occurring
many consecutive times.
RLE-video Click here WS_RLE encoding
Exam style questions
Thank you……☺

You might also like