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

WARM WELCOME TO 12

COMPUTER SCIENCE

https://quizizz.com/admin/quiz/6186cf7857708e001ec66b58/dat
a-representation
Information Representation
LEARNING OBJECTIVES
1.1.1 Number representation
 Show understanding of the basis of different number systems
and use the binary, denary and hexadecimal number system.
 Convert a number from one number system to another.

Success Criteria
 ALL— will be able to state what hexadecimal
is and why it’s used, you will be able to
convert simple decimal numbers to
hexadecimal.
 MOST— will be able to convert easily
between binary, denary and hexadecimal.
 SOME— will be able to write negative denary
RECAP
B7
11*16 + 7*1
=176+7=183

128

76
1 0 0 1 1 0 0
DENARY HEXADECIM BINARY
AL
0 0 0000
1 1 0001
2 2 0010
3 3 0011
CONVERT HEXADECIMAL TO DENARY 4 4 0100
(1A9B) 5 5 0101
6 6 0110
7 7 0111
8 8 1000
EXAMPLE 9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
DENARY=746
AC2
101011000010
CONVERTING NEGATIVE DENARY
NUMBER INTO BINARY
LESSON OBJECTIVE:

 1.TO LEARN ABOUT REPRESENT INTEGERS IN


BINARY(TWO’S COMPLIMENT)
 2. Finding the Denary value of given two’s Compliment
number
 3.BCD(Binary coded Decimal)
 4. Internal coding of text (ASCII AND UNICODE)
The reason for using two's complement representations is to simplify
the processes for arithmetic calculations
USING A BYTE TO REPRESENT EACH VALUE, CARRY OUT THE
SUBTRACTION OF DENARY 35 FROM DENARY 67 USING BINARY
ARITHMETIC WITH TWO'S COMPLEMENT REPRESENTATIONS.
BINARY .
Binary Encodings of Decimal Numbers
Ex: (94 ) BCD: 1001 0100
9 4

00001001 00000100 Unpacked

10010100 Packed

8503
UN PACKED 00001000 00000101 00000000 00000011

PACKED 10000101 00000011


APPLICATIONS OF BINARY CODED
DECIMAL
Application1:
BIOS in many personal computers stores the date and time in BCD
Ex: MC6818 real-time clock chip used in the original IBM PC AT motherboard provided the time
encoded in BCD. This form is easily converted into ASCII for display.

Application2:
The screen of a calculator or in a digital time display.
a currency value $300.25 it is as a fixed-point decimal number (ignoring the dollar sign).

Application 3:
IBM and BCD IBM used the terms binary-coded decimal and BCD for six-bit
alphameric codes that represented numbers, upper-case letters and special characters.
Some variation of BCD was used in most early IBM computers, including the IBM 1620, IBM 1400 series,
and non-Decimal Architecture members of the IBM 700/7000 series. With the introduction of System/360,
IBM replaced BCD with 8-bit EBCDIC
ASCII CODE

 ASCII code: If text is to be stored in a computer it is necessary to have a coding scheme that
provides a unique binary code for each distinct individual component item of the text. Such a
code is referred to as a character code.
 The scheme which has been used for the longest time is the ASCII (American Standard Code for
Information Interchange) coding scheme. This is an internationally agreed standard.
 There are some variations on ASCII coding schemes but the major one is the 7-bit code. It is
customary to present the codes in a table for which a number of different designs have been used.
 The full table shows the 27 (128) different codes available for a 7-bit code. You should not try to
remember any of the individual codes but the re are certain aspects of the coding scheme which
you need to understand.
ASCII TABLE

41-hex
01000001
UNICODE
HTTPS://WWW.YOUTUBE.COM/WATCH?V=5AJKKGSE
UNY https://www.youtube.com/watch?v=5aJKKgSEUnY
LESSON 3

 NEXT STEP:IMAGE,AUDIO
AND VIDEO FILES STORED.
IMAGES
 Graphics on a screen are made up of tiny blocks called pixels.

 The more pixels on the screen,


the higher the resolution and the better the quality of the picture will be.

 The higher the image resolution, the more memory is needed to store the graphic.

Image files can be either bitmaps or vectors.


ZOOM IN ON A BITMAP IMAGE YOU CAN
SEE THE INDIVIDUAL PIXELS THAT
MAKE UP THAT IMAGE
1. Bit map images are collection of bits
2. Bitmap images (or raster) images are stored as
a series of tiny dots called pixels.
3. The image consists of a matrix of individual dots
(or pixels (picture element)) that all have their
own color (described using bits,
the smallest possible units of information for a
computer).
4. Bitmap images are organized as a grid of
coloured squares called pixels (short for 'picture elements').
5. When zooming in or enlarging a bitmap image, the pixels are
stretched and made into larger blocks. This is why bitmap images
appear as poor quality when enlarged too much.
BMP, PCX, JPEG, FLI/FLC, and AVI files include headers that define the image size, number of colors,
and other information needed to display the image.
1. Confirmation that the file is a BMP File size
2. Location/offset of image data within the file
3. Dimensions of the image (in pixels)
4. Image resolution Color depth (bits per pixel, 1, 4, 8, 16, 24 or 32)
5. Type of compression used, if any

The screen resolution tells you how many pixels CAN YOU TELL
your screen can display horizontally and vertically WHAT IS THE
RESOLUTION OF
THIS SCREEN

1024X768=786432 PIXELS
How many pixels do an image contains ?

1. Measurement of number of pixels per unit measurement (or)


2. The number of pixels in an image (or)
3. The number of pixels wide by the number of pixels high or
4. number of pixels per row by the number of rows

For example, an image that is 2048 pixels wide and 1536 pixels high
(2048 x 1536) contains (multiply) 3,145,728 pixels (or 3.1 Megapixels)

The higher the resolution, the


more pixels are available.
Therefore the crisper the picture
The color depth of an image is measured in bits.

The number of bits indicates how many colors are available for each pixel

1. In the black and white image, only two colors are needed. This means it has a
color depth of 1 bit.
EACH COLOR OF AN IMAGE IS STORED AS A
BINARY NUMBER.
IN THE BLACK(1)-AND-WHITE(0) IMAGE BELOW,
EACH PIXEL IS EITHER BLACK OR WHITE
2.A 2-BIT COLOUR DEPTH WOULD ALLOW
FOUR DIFFERENT VALUES: 00, 01, 10, 11.
At least eight bits per pixel are necessary to code a coloured image.
1. The number of bits per pixel is sometimes referred to as the colour depth.
(8 bits or 1 byte for 1 pixel in coloured image) (Computer Science Book)

2. 24 bits almost always uses 8 bits of each of RGB(Red:8 Green:8 Blue:8)


8X8X8 = 24

3. As of 2018 24-bit color depth is used by virtually every computer and


phone display and the vast majority of image storage formats.

As an example, consider that a bitmap file is needed to fill a laptop screen where the resolution is 1366 by 768.
If the colour depth is to be 24 then the number of bits needed is: 1366 X 768 X 24 = 25178112 bits
The result of this calculation shows the number of bits but a file size is always quoted as a number of bytes or
multiples of bytes.
Thus our file size could be quoted as:
25178112 bits = 25178112/ 8
= 3147 264 bytes
= 3147264 /1024
= 3073.5 kibibytes (3073.5 KiB)
= 3073.5 /1024
= approximately 3 MiB
Using the diagram above we are going to work out how many pixels are required to display a
EXAMPLE: single frame on a VGA (Video Graphics Array)screen.
Checking the resolution:
Height = 480 Width = 640
Area = Width x Height = Total Pixels
Area = 640 x 480 = 307200 pixels
Hence, it takes 307,200 pixels to display on a VGA screen!

EXERCISES:
1. A bitmap file is needed to fill a laptop screen where the resolution is 1247
by 564.
If the colour depth is to be 24 then the number of bits needed

2. A bitmap file is needed to fill a laptop screen where the resolution is 2134 by
756.
If the colour depth is to be 24 then the number of bits needed .
Image Created by a drawing package or a computer-aided design (CAD)
package to consist of a number of geometric objects
Vector graphics are made from geometric objects such as
circles and polygons.
The outcome is then usually for the image to be stored as a vector graphic file Unlike bitmaps, vector images are not
based on pixel patterns, but instead use mathematical formulas to draw lines and curves that can be combined to
create an image Vector graphics are made from geometric objects such as circles and polygons.

1. Vector images are edited by manipulating the lines and curves that make up the image using a program such as
Adobe Illustrator.
2. Vector images tend to be smaller than bitmap images because a bitmap image has to store color information for
each individual pixel that forms the image.
3. A vector image just has to store the mathematical formulas that make up the image, which take up less space.
4. The three most popular image formats used on the Web (PNG, JPEG, and GIF) are bitmap formats.
5. The Scalable Vector Graphics (SVG) format comes in a distant fourth due to a legacy of poor support for vector
graphics in early browsers.
6. Today however, all major browsers support the SVG (Scalable Vector Graphics) format. The dimensions of the
vector image objects are not defined explicitly but instead are defined relative to an imaginary drawing canvas.
In other words, the image is scalable
1. Bitmap formats are best for images that need to have a wide range of color
DIFFERENCE gradations, such as most photographs.

2. Vector formats, on the other hand, are better for images that consist of a few
areas of solid color. Examples of images that are well suited for the vector
format include logos and type.
Vector Graphics
Bitmap Images
VECTOR GRAPHICS USED IN
VECTOR GRAPHIC
WE DO NEED TO CONSIDER HOW THE DATA IS STORED AFTER THE IMAGE HAS
BEEN CREATED.
1. DRAWING LIST: List of Commands and attributes used in drawing
2. DRAWING PROPERTIES:
a. The properties include the basic geometric
data such as, for a circle, the position of the centre and its radius.
b.In addition properties such as the thickness and style of a line,
the colour of a line and the colour that fills the shape,
if that is appropriate, are defined.
3. DRAWING OBJECTS: Include circles , square, rectangle etc.

Can you differentiate between bitmap Images


And vector graphics

Research: Find all where the vector


Graphics is used
SOUND

 1.1.3 Sound show understanding of how sound is represented and encoded


 terminology: sampling, sampling rate, sampling resolution
 show understanding of how file sizes depend on sampling rate and sampling
resolution
 understanding of how typical features found in sound editing software are
used in practice
Sound is an oscillation of pressure transmitted through a solid, liquid, or gas

Will sound travel through


vacuum?
Yes or no
Give reason.

Natural sound consists of variations in pressure which is detected by the human ear.
A typical sound contains a large number of individual waves each with a defined frequency.
The result is a wave form in which the amplitude of the sound varies in a continuous but
irregular pattern.
If there is a need to store sound or transmit it electronically
the original analogue sound signal has to be converted to a binary code.
A SOUND ENCODER HAS TWO
COMPONENTS.
1. BAND LIMITING FILTER
2. ANALOGUE TO DIGITAL CONVERTER.

Band limiting Filter

Analogue to digital convertor: Converts analogue sound into digital signals that can
be stored on a computer.
NOTE
ADC SAMPLING 1. The method of operation of the ADC is
described with reference to Figure.
2. The amplitude of the wave (the red line) has
to be sampled at regular intervals.
3. The blue vertical lines indicate the sampling
times. The amplitude cannot be measured
exactly;
4. instead the amplitude is approximated by the
closest of the defined amplitudes represented
by the horizontal lines in figure.
5. sample values 1 and 4 will be an accurate
estimate of the actual amplitude because the
wave is touching an amplitude line.
6. In contrast, samples 5 and 6 will not be
accurate because the actual amplitude is
approximately half way between the two
closest defined values.
DAC: CONVERTS DIGITAL SIGNALS STORED ON A
COMPUTER INTO ANALOGUE SOUND THAT CAN
BE PLAYED THROUGH DEVICES SUCH AS
SPEAKERS.

 Once in a digital format you can edit sounds with


programs such as audacity.
 To play digital audio you convert the sound from
digital values into analogue electrical signals
using the DAC,
 these signals are then passed to a speaker that
vibrating the speaker cone, moving the air to
create sound waves and analogue noise.
Sound waves in nature are continuous, this means they have an almost infinite amount of detail that
you could store for even the shortest sound. This makes them very difficult to record perfectly,
as computers can only store discrete data, data that has a limited number of data points

1. Bandwidth is the ability of a recorded signal to be reproduced at varying degrees of resolution


2. Audio signals can have a limited bandwidth if recorded digitally.
3. Once a digital recording is made, the bandwidth is set in place.
4. An analog recording is considered unlimited.
5. Therefore, it can move to a higher and higher resolution without losing its original quality.
6. Digital sound is broken down into thousands of samples per second. Each sound sample is stored as
binary data.
1. The sample rate is how many samples, or
measurements, of the sound are taken each second.
2. The more samples that are taken, the more detail
about where
the waves rise and fall is recorded and the higher the
quality of the audio. Also,
3. The shape of the sound wave is captured more
accurately.
4. Each sample represents the amplitude of the digital
signal at a specific point in time.
5. The amplitude is stored as either an integer or a
floating point number and encoded as a binary
number
1. The original analogue sound wave is a continuous set of points
2. ADC converts sound into digital data
3. DAC converts digital data into analogue sound, the
analogue wave produced may differ significantly from
the original sound wave.
CALCULATING FILE SIZE AUDIO
FILE
Compression can be lossy or lossless.
LOSSY COMPRESSION
LOSSLESS COMPRESSION
1. Lossless compression means that as the file size is compressed, the audio quality
remains the same - it does not get worse.
2. Also, the file can be restored back to its original state.
3. FLAC and ALAC are open source lossless compression formats.
4. Lossless compression can reduce file sizes by up to 50% without losing quality.
5. Lossless Compression allows original data to be perfectly reconstructed from
compression.
6. Run-length encoding: compression in which sequences with same data value in many
consecutive values are stored as a single data value and count E.g. 00001234111111 can
be written as (0-4)1234(1-6)
A. 78-34
B. 110-56
C.119-23

You might also like