0% found this document useful (0 votes)
168 views192 pages

Chapter 1 Information-Representation

Uploaded by

Chall
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
168 views192 pages

Chapter 1 Information-Representation

Uploaded by

Chall
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 192

Chapter 1-Information representation

1.1 Data Representation


1.2 Multimedia – Graphics, Sound
1.3 Compression

09-Sep-22 Mr. Noureddine Tadjerout 1


Learning objectives
1.1 Data Representation

09-Sep-22 Mr. Noureddine Tadjerout 2


Learning objectives
1.2 Multimedia:
Graphics

Sound

09-Sep-22 Mr. Noureddine Tadjerout 3


Learning objectives
1.3 Compression

09-Sep-22 Mr. Noureddine Tadjerout 4


Chapter 1-Information representation

1.1 Data Representation

09-Sep-22 Mr. Noureddine Tadjerout 5


Learning objectives
1.1 Data Representation

09-Sep-22 Mr. Noureddine Tadjerout 6


1.1 Data Representation
Introduction:

What is binary?

Binary is a base 2 number system, meaning that all numbers and other data can only
represented using ones and zeros. All modern computer systems store data and programs in
binary

This stream of ones and zeros could represent any form of data – text, graphics, video, sound

09-Sep-22 Mr. Noureddine Tadjerout 7


1.1 Data Representation
Introduction:
What is binary?
Key Advantages:

•Binary data can be transmitted easily and reliably.


•Binary data can be stored and read very easily and reliably.
•Computers use circuits that can only be on one of 2 states – on or off, these work very well
with binary calculations.
•The input voltage in to computers is not very stable, so only a system that use voltage/no
voltage would be reliable.
Take a look at the following video in the next slide for more detailed information.

09-Sep-22 Mr. Noureddine Tadjerout 8


1.1 Data Representation
Introduction:
What is binary?
Click the link below to watch the video at home 17 minutes
https://youtu.be/k-5jpns0uTA

09-Sep-22 Mr. Noureddine Tadjerout 9


1.1 Data Representation
Bits, Bytes & Nibbles
Bit – e.g. 0
Each individual 1 or 0 is known as a bit.
Here are three bits – 110
Byte – e.g. 11001100
Each group of 8 bits is known as a Byte
Here is a stream of Bytes:
01010011 01101011 01111001 01110010 01101001 01101101 00100000 01101001 01110011
00100000 01100001 01110111 01100101 01110011 01101111 01101101 01100101 00100001

Nibble – e.g. 1111

A nibble is 4 bits, or half a Byte.

Here is a nibble – 1101

09-Sep-22 Mr. Noureddine Tadjerout 10


1.1 Data Representation
Measurement of the size of computer memories
The Difference Between Kilobytes and Kibibytes
A kibibyte is the formal name for 1024 Bytes. It is “supposed” to be used instead of kilobyte for
this quantity, which according to SI naming conventions is supposed to be used for 1000
bytes. Kibibyte, Kilobyte.
In my experience, the “kibi” terms seem to be rarely used, as just about every computer
person other than some people on the net uses kilobyte to mean 1024 bytes and megabyte (or
“meg”) to be 1024^2 bytes (versus “mebibyte”, which I’ve seen even more rarely).
In practice, powers of 1024 bytes tend to end up being used for RAM, while powers of 1000
end up being used for selling hard disks and other persistent storage. Confusingly, file sizes in
bytes are also typically reported in terms of 1024 byte powers by most Unix/Linux file size
tools, such as “ls -lh”. (ls -lh. This command will show you the file sizes in human readable
format)
Whenever I hear the word “kibibyte”, I think of this…

09-Sep-22 Mr. Noureddine Tadjerout 11


1.1 Data Representation
Measurement of the size of computer memories

09-Sep-22 Mr. Noureddine Tadjerout 12


1.1 Data Representation
The Difference Between Kilobytes and Kibibytes

This system is more accurate. Internal memories (such as RAM) should be measured using
the IEC system. A 64 GiB RAM could, therefore, store 64 × 230 bytes of data (68 719 476 736
bytes).
09-Sep-22 Mr. Noureddine Tadjerout 13
1.1 Data Representation
Number systems:
Designers of computer systems adopted the binary (base 2) number system since this allows
only two values, 0 and 1.

09-Sep-22 Mr. Noureddine Tadjerout 14


Learning objectives
1.1 Data Representation
Number systems: Converting from binary to denary
We use a number system that uses 10 different numbers. (Base 10 number system):
0 , 1, 2, 3, 4, 5, 6, 7, 8, 9
This is called the Denary System: example: 00000011 is binary for 3.

09-Sep-22 Mr. Noureddine Tadjerout 15


1.1 Data Representation
Number systems: Converting from binary to denary
Let’s suppose we are trying to find the decimal for the binary number 01101011.

09-Sep-22 Mr. Noureddine Tadjerout 16


1.1 Data Representation
Number systems: Converting from binary to denary

09-Sep-22 Mr. Noureddine Tadjerout 17


Number systems
Watch the video for the Binary-Decimal or Denary conversions
https://www.youtube.com/watch?v=VLflTjd3lWA

09-Sep-22 Mr. Noureddine Tadjerout 18


1.1 Data Representation
Number systems: Converting from denary to binary

Let’s suppose we are trying to find the binary for the decimal number 75

09-Sep-22 Mr. Noureddine Tadjerout 19


1.1 Data Representation
Number systems: Converting from denary to binary

09-Sep-22 Mr. Noureddine Tadjerout 20


Number systems
Watch the video for Decimal or Denary to Binary conversions
https://www.youtube.com/watch?v=rsxT4FfRBaM

09-Sep-22 Mr. Noureddine Tadjerout 21


1.1 Data Representation
Hexadecimal
Hexadecimal (or hex) is a base 16 system used to simplify how binary is represented. A hex digit
can be any of the following 16 digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F.
Each hex digit reflects a 4-bit binary sequence.
This table below shows each hex digit with the equivalent values in binary and denary.

09-Sep-22 Mr. Noureddine Tadjerout 22


1.1 Data Representation
Hexadecimal
This means an 8-bit binary number can be written using only two different hex digits - one hex
digit for each nibble (or group of 4-bits). It is much easier to write numbers as hex than to write
them as binary numbers.
For example:
11010100 in binary would be D4 in hex
FFFF3 in hex would be 11111111111111110011 in binary

Hex codes are used in many areas of computing to simplify binary codes. It is important to note
that computers do not use hexadecimal - it is used by humans to shorten binary to a more
easily understandable form. Hexadecimal is translated into binary for computer use.

Some examples of where hex is used include:

colour references
assembly language programs
error messages

09-Sep-22 Mr. Noureddine Tadjerout 23


1.1 Data Representation
Hexadecimal
Hex can be used to represent colours on web pages and image-editing programs using the
format #RRGGBB (RR = reds, GG = greens, BB = blues). The # symbol indicates that the number has been
written in hex format.
This system uses two hex digits for each colour, eg #FF6600.

As one hex digit represents 4 bits, two hex digits together make 8 bits (1 byte). The values for each colour
run between 00 and FF. In binary, 00 is 0000 0000 and FF is 1111 1111. That provides 256 possible values
for each of the three colours.
That gives a total spectrum of 256 reds x 256 greens x 256 blues - which is over 16 million colours in total.
#FF0000 will be the purest red - red only, no green or blue.
Black is #000000 - no red, no green and no blue.
White is #FFFFFF.
spectrum mean is a band of colours

09-Sep-22 Mr. Noureddine Tadjerout 24


1.1 Data Representation
a).Converting from Hexadecimal to Decimal or (Denary)
Using the same method as denary and binary, this gives the headings of 160, 161, 162, 163 and
so on. The typical headings for a hexadecimal number with five digits would be

25
1.1 Data Representation
a.)Converting from Hexadecimal to Decimal or (Denary)

26
1.1 Data Representation
a).Converting from Hexadecimal to Decimal or (Denary)

27
1.1 Data Representation
a).Converting from Hexadecimal to Decimal or (Denary)

28
1.1 Data Representation
a).Converting from Hexadecimal to Decimal or (Denary)
Click the link below to watch the video to How to convert Hexadecimal to Decimal or (Denary)
https://www.youtube.com/watch?v=pg-HEGBpCQk

29
1.1 Data Representation
b).Converting from Decimal to Hexadecimal

30
1.1 Data Representation
b).Converting from Decimal to Hexadecimal

31
1.1 Data Representation
b).Converting from Decimal to Hexadecimal

32
1.1 Data Representation
b).Converting from Decimal to Hexadecimal
Click the link below to watch the video to How to convert Decimal to Hexadecimal
https://www.youtube.com/watch?v=QJW6qnfhC70

09-Sep-22 Mr. Noureddine Tadjerout 33


1.1 Data Representation
C). Converting from Binary to Hexadecimal

34
1.1 Data Representation
C). Converting from Binary to Hexadecimal
Click the link below to watch the video to How to convert Binary to Hexadecimal
https://www.youtube.com/watch?v=tSLKOKGQq0Y

09-Sep-22 Mr. Noureddine Tadjerout 35


1.1 Data Representation
d). Converting from Hexadecimal to Binary
Click the link below to watch the video to How to convert Hexadecimal to Binary
https://www.youtube.com/watch?v=D_YC6DSPpQE

09-Sep-22 Mr. Noureddine Tadjerout 36


1.1 Data Representation
d). Converting from Hexadecimal to Binary

37
1.1 Data Representation
Number systems: Binary addition and subtraction
Click the link below to watch the video to How To Add and Subtract Binary Numbers:
https://www.youtube.com/watch?v=C5EkxfNEMjE

09-Sep-22 Mr. Noureddine Tadjerout 38


1.1 Data Representation
Number systems: Binary Addition:

09-Sep-22 Mr. Noureddine Tadjerout 39


1.1 Data Representation
Number systems: Binary Addition:

09-Sep-22 Mr. Noureddine Tadjerout 40


1.1 Data Representation
Number systems: Binary Addition:

Question:

09-Sep-22 Mr. Noureddine Tadjerout 41


1.1 Data Representation
Number systems: Binary Addition

Answer:

09-Sep-22 Mr. Noureddine Tadjerout 42


1.1 Data Representation
Number systems: Binary Subtraction: for this example we will look at 2 complement in details in
slides 58

09-Sep-22 Mr. Noureddine Tadjerout 43


1.1 Data Representation

Number systems: Binary addition and subtraction


Carry out these binary subtraction. Convert your answers to denary.

a) 0 0 1 1 0 1 0 1 - 0 1 0 0 1 0 0 0
b) 0 1 0 0 1 1 0 1 - 0 1 1 0 1 1 1 0
c) 0 1 0 1 1 1 1 1 - 0 0 0 1 1 1 1 0
d) 0 1 0 0 0 1 1 1 - 0 1 1 0 1 1 1 1
e) 1 0 0 0 0 0 0 1 - 0 1 1 1 0 1 1 1
f) 1 0 1 0 1 0 1 0 - 1 0 1 0 1 0 1 0

09-Sep-22 Mr. Noureddine Tadjerout 44


1.1 Data Representation
Number systems: Hexadecimal addition and subtraction
Click the link below to watch the video on
https://www.youtube.com/watch?v=y0B6tuC6niE

09-Sep-22 Mr. Noureddine Tadjerout 45


1.1 Data Representation
Number systems: Hexadecimal addition

09-Sep-22 Mr. Noureddine Tadjerout 46


1.1 Data Representation
Number systems: Hexadecimal addition
To double check your answer click in the link below:
https://www.calculator.net/hex-calculator.html

09-Sep-22 Mr. Noureddine Tadjerout 47


1.1 Data Representation
Number systems: Hexadecimal addition

09-Sep-22 Mr. Noureddine Tadjerout 48


1.1 Data Representation
Number systems: Hexadecimal subtraction

09-Sep-22 Mr. Noureddine Tadjerout 49


1.1 Data Representation
Number systems: Hexadecimal subtraction
To double check your answer click in the link below:
https://www.calculator.net/hex-calculator.html

09-Sep-22 Mr. Noureddine Tadjerout 50


1.1 Data Representation
Binary coded decimal (BCD)
Binary-coded decimal is a system of writing numerals that assigns a four-digit binary code
to each digit 0 through 9 in a decimal (base 10) number. Simply put, binary-coded decimal
is a way to convert decimal numbers into their binary equivalents. However, binary-coded
decimal is not the same as simple binary representation. Compared to the binary system, it
is easy to code and decode binary-coded decimal numbers.
The binary-coded decimal (BCD) system uses a 4-bit code to represent each denary digit:
The most obvious use of BCD is in the representation of digits on a calculator or clock display.

09-Sep-22 Mr. Noureddine Tadjerout 51


1.1 Data Representation
Watch the video for the Binary coded decimal (BCD)
https://www.youtube.com/watch?v=AM0tr8Kyvzg

09-Sep-22 Mr. Noureddine Tadjerout 52


1.1 Data Representation

Activity :Binary coded decimal (BCD)

09-Sep-22 Mr. Noureddine Tadjerout 53


1.1 Data Representation
Number systems: One’s and Two’s Compliment
Up until now we have assumed all binary numbers have positive values. There are a number
of methods to represent both positive and negative numbers. We will consider:

• Signed Magnitude method


• one’s complement
• two’s complement.

It is not possible to add minus or plus symbol in front of a binary number because a binary
number can have only two symbol either 0 or 1 for each position or bit. That’s why we use
this extra bit called sign bit or sign flag. The value of sign bit is 1 for negative binary numbers
and 0 for positive numbers.
When an integer binary number is positive, the sign is represented by 0 and the magnitude
by a positive binary number. When the number is negative, the sign is represented by 1 but
the rest of the number may be represented in one of three possible ways: Sign-Magnitude
method, 1’s Complement method, and 2’s complement method. These are explained as
following below.
09-Sep-22 Mr. Noureddine Tadjerout 54
1.1 Data Representation
Number systems: One’s and Two’s Compliment
a). Signed Magnitude method

In this method, number is divided into two parts: Sign bit and Magnitude. If the number is
positive then sign bit will be 0 and if number is negative then sign bit will be 1. Magnitude is
represented with the binary form of the number to be represented.

Example 1: Let we are using 5 bits register. The representation of -5 to +5 will be as follows:

Most significant bit (MSB) and Least significant bit (LSB)

09-Sep-22 Mr. Noureddine Tadjerout 55


1.1 Data Representation
Number systems: One’s and Two’s Compliment
a). Signed Magnitude method

Example 1: Let we are using 4 binary bits register. The representation of -7 to +7 will be as
follows:

09-Sep-22 Mr. Noureddine Tadjerout 56


1.1 Data Representation
Number systems: One’s and Two’s Compliment
b). One’s Complement Method:
Positive numbers are represented in the same way as they are represented in sign magnitude
method. If the number is negative then it is represented using 1’s complement. First represent
the number with positive sign and then take 1’s complement of that number.
In one’s complement, each digit in the binary number is inverted (in other words, 0 becomes 1
and 1 becomes 0).
For example 1: 01000110 (denary value 70) becomes 10111001 (denary value −70).
For example 2: Let we are using 5 bits register. The representation of -5 and +5 will be as
follows

57
1.1 Data Representation
Number systems: One’s and Two’s Compliment
c). Two’s Complement Method:
Positive numbers are represented in the same way as they are represented in sign magnitude
method. If the number is negative then it is represented using 2’s complement. First represent
the number with positive sign and then take 2’s complement of that number.

58
1.1 Data Representation
Number systems: One’s and Two’s Compliment
c). Two’s Complement Method:
Example 2: Let we are using 5 bits registers. The representation of -5 and +5 will be as follows:

+5 is represented as it is represented in sign magnitude method. -5 is represented using the


following steps:
(i) +5 = 0 0101
(ii) Take 2’s complement of 0 0101 and that is 1 1011. MSB is 1 which indicates that number
is negative.
MSB is always 1 in case of negative numbers
59
1.1 Data Representation
Number systems: One’s and Two’s Compliment
c). Two’s Complement Method:
Example 2: Let we are using 8 bits registers. The representation of -104 and +104 will be as
follows:

+104 128 64 32 16 8 4 2 1
Binary 0 1 1 0 1 0 0 0
1 comp 1 0 0 1 0 1 1 1
Opposite
Add 1 0 0 0 0 0 0 0 1
- 104 1 0 0 1 0 0 0 0

60
Recap Two's Complement

09-Sep-22 Mr. Noureddine Tadjerout 61


1.1 Data Representation
c). Two’s Complement Method:
Number systems: Binary Subtraction

09-Sep-22 Mr. Noureddine Tadjerout 62


1.1 Data Representation
c). Two’s Complement Method
Number systems: Binary Subtraction

09-Sep-22 Mr. Noureddine Tadjerout 63


1.1 Data Representation
Number systems: One’s and Two’s Compliment:
Watch the video for the Signed Binary (Sign and Magnitude & Two's Complement)
https://www.youtube.com/watch?v=sJXTo3EZoxM

09-Sep-22 Mr. Noureddine Tadjerout 64


1.1 Data Representation
Watch the video for theTwo’s complement representation of a signed integer
https://www.youtube.com/watch?v=mRvcGijXI9w

09-Sep-22 Mr. Noureddine Tadjerout 65


1.1 Data Representation
Number systems: One’s and Two’s Compliment:
Convert the following negative Decimal number to binary

(- 49) = ?
(- 109) = ?
(- 107) = ?
(- 77) = ?
(- 17) = ?
( - 122) = ?
( - 38 ) = ?
( - 200 ) = ?
( -26 ) = ?
(-2) = ?
( -11) = ?
( - 52) = ?

09-Sep-22 Mr. Noureddine Tadjerout 66


1.1 Data Representation
Number systems: One’s and Two’s Compliment:

09-Sep-22 Mr. Noureddine Tadjerout 67


AS level Paper 1 Exam: Question 1
AS level Paper 1 Exam: Answer 1
AS level Paper 1 Exam: Question 2
AS level Paper 1 Exam: Answer 2
AS level Paper 1 Exam: Question 3
AS level Paper 1 Exam: Answer 3
AS level Paper 1 Exam: Question 4
AS level Paper 1 Exam: Answer 4
AS level Paper 1 Exam: Question 5
AS level Paper 1 Exam: Answer 5
AS-level Paper 1 Exam: Question 6
AS-level Paper 1 Exam: Answer 6
AS-level Paper 1 Exam: Question 7
AS-level Paper 1 Exam: Question 7
AS-level Paper 1 Exam: Answer 7
1.1 Data Representation
Watch the video for the ASCII Code
https://www.youtube.com/watch?v=H4l42nbYmrU

09-Sep-22 Mr. Noureddine Tadjerout 83


1.1 Data Representation
ASCII Code Table:

09-Sep-22 Mr. Noureddine Tadjerout 84


1.1 Data Representation
Watch the video for the ASCII and Unicode Character Sets
https://www.youtube.com/watch?v=5aJKKgSEUnY

09-Sep-22 Mr. Noureddine Tadjerout 85


ASCII and Unicode Character Sets
ASCII
The ASCII character set is a 7-bit set of codes that allows 128 different characters.
That is enough for every upper-case letter, lower-case letter, digit and punctuation
mark on most keyboards. ASCII is only used for the English language.
This table shows some examples of letters represented using the ASCII character set:

Extended ASCII
Extended ASCII code is an 8-bit character set that represents 256 different characters,
making it possible to use characters such as é or ©. Extended ASCII is useful for
European languages

09-Sep-22 Mr. Noureddine Tadjerout 86


ASCII and Unicode Character Sets
Advantage and Disadvantage ASCII
Advantages: ASCII code takes less space as it has only 256 characters. it
stores all alphanumeric characters. The demand for memory in ASCII is
less than the Unicode.

Disadvantages of ASCII : maximum 128 characters that is not enough


for some key boards having special characters. 7bit may not enough to
represent larger values.

09-Sep-22 Mr. Noureddine Tadjerout 87


ASCII and Unicode Character Sets
Unicode
Unicode uses between 8 and 32 bits per character, so it can represent characters
from languages from all around the world. It is commonly used across the internet. As
it is larger than ASCII, it might take up more storage space when saving documents.

Global companies, like Facebook and Google, would not use the ASCII character set
because their users communicate in many different languages.

09-Sep-22 Mr. Noureddine Tadjerout 88


ASCII and Unicode Character Sets
Advantage and disadvantage Unicode.

Advantage: Unicode is a 16-bit system which can support many more


characters than ASCII.

Disadvantage: One disadvantage Unicode has over ASCII, though, is


that it takes at least twice as much memory to store a Roman alphabet
character because Unicode uses more bytes to enumerate its vastly
larger range of alphabetic symbols.

09-Sep-22 Mr. Noureddine Tadjerout 89


1.1 Data Representation
Watch the video for the Representing Text in Binary (ASCII & Unicode)
https://www.youtube.com/watch?v=tdmeXcDX-Uc

09-Sep-22 Mr. Noureddine Tadjerout 90


1.1 Data Representation

09-Sep-22 Mr. Noureddine Tadjerout 91


Learning objectives
1.2 Multimedia:
Graphics

Sound

09-Sep-22 Mr. Noureddine Tadjerout 92


1.2 Multimedia:

09-Sep-22 Mr. Noureddine Tadjerout 93


Bitmaps
• General purpose

• Contain pixels as the smallest component

• Pixel has a defined colour and position

• A bitmap image has a defined resolution

• Can be scaled but quality is affected

• A bitmap file has a header containing meta data, which defines the colour
depth and the resolution

Let's explore more about sampling by clicking the link below:

https://www.bbc.co.uk/bitesize/guides/zqyrq6f/revision/1

09-Sep-22 Mr. Noureddine Tadjerout 94


1.2 Multimedia:
A)- Graphics :

Bit-map images are made up of pixels (picture elements); the image is stored in a two
dimensional matrix of pixels.

09-Sep-22 Mr. Noureddine Tadjerout 95


Bitmaps
Watch the video for the Bitmap Images ( 6 minutes)
https://www.youtube.com/watch?v=0KmimFoalTI

09-Sep-22 Mr. Noureddine Tadjerout 96


Bitmaps
Calculating bit-map image file sizes

It is possible to estimate the file size needed to store a bit-map image. The file size will need to
take into account the image resolution and bit depth.

Example: a full screen with a resolution of 1920 × 1080 pixels and a bit depth of 24 requires
1920 × 1080 × 24 bits = 49 766 400 bits for the full screen image

Dividing by 8 gives us 6 220 800 bytes (equivalent to 6.222 MB using the SI units or 5.933 MiB
using IEE units). An image which does not occupy the full screen will obviously result in a
smaller file size.

Note: when saving a bit-map image, it is important to include a file header; this will contain
items such as file type (.bmp or .jpeg), file size, image resolution, bit depth (usually 1, 8, 16, 24
or 32), any type of data compression employed and so on.

09-Sep-22 Mr. Noureddine Tadjerout 97


Bitmaps
Watch the video for the Representing Images in Binary (5mintes)
https://www.youtube.com/watch?v=a3Y_ZvOr0K0

09-Sep-22 Mr. Noureddine Tadjerout 98


1.2 Multimedia:
A)- Graphics : Vector graphics (2 minutes)
https://youtu.be/ywIpBSblBdA

09-Sep-22 Mr. Noureddine Tadjerout 99


1.2 Multimedia:
A)-Graphics : Vector graphics
Vector graphics are computer images created using a sequence of commands or mathematical
statements that place lines and shapes in a two-dimensional or three-dimensional space. In
vector graphics, a graphic artist's work, or file, is created and saved as a sequence of vector
statements.
A vector graphic file describes a series of points to be connected.
These files are sometimes called geometric files. Images created with tools such as Adobe
Illustrator and Corel's Corel DRAW are usually vector image files.
Simplified, vector graphics are like connect-the-dots drawings.

09-Sep-22 Mr. Noureddine Tadjerout 100


1.2 Multimedia:
A)-Graphics : Vector graphics

09-Sep-22 Mr. Noureddine Tadjerout 101


AS-level Paper 1 Exam: Question 1
AS-level Paper 1 Exam: Question 1
AS-level Paper 1 Exam: Answer 1
AS-level Paper 1 Exam: Answer 1
AS-level Paper 1 Exam: Question 2
AS-level Paper 1 Exam: Question 2
AS-level Paper 1 Exam: Answer 2
AS-level Paper 1 Exam: Answer 2
1.2 Multimedia:
B)-Sound :
Sampling rate is the number of sound samples taken per second. The higher the sampling rate
and/or sampling resolution, the greater the file size. For example, a 16-bit sampling resolution is
used when recording CDs to give better sound quality.

Let's explore more about sampling by clicking the link below:

https://www.bbc.co.uk/bitesize/guides/z7vc7ty/revision/2

09-Sep-22 Mr. Noureddine Tadjerout 110


1.2 Multimedia:
B)-Sound :
Sound requires a medium in which to travel through (it cannot travel in a vacuum). This is
because it is transmitted by causing oscillations of particles within the medium. The human ear
picks up these oscillations (changes in air pressure) and interprets them as sound. Each sound
wave has a frequency and wavelength; the amplitude specifies the loudness of the sound.

09-Sep-22 Mr. Noureddine Tadjerout 111


Sound
Watch the video for the Representing Sound in Binary
https://www.youtube.com/watch?v=HlOTuCFtuV8 (4 minutes)

09-Sep-22 Mr. Noureddine Tadjerout 112


1.2 Multimedia:
B)- Sound
• Sound arises from pressure changes

• Sound is an irregular analogue waveform

• Sound has to be sampled to be stored

• Sampling has a defined sampling resolution and a defined sampling rate

• A sound encoder contains a band-limiting filter and an analogue to


digital converter

09-Sep-22
© Cambridge University Press 2019 Mr. Noureddine Tadjerout 113
1.2 Multimedia:
B)-Sound :
Sound is an analogue value; this needs to be digitized in order to store sound in a computer. This
is done using an analogue to digital converter (ADC). If the sound is to be used as a music file, it
is often filtered first to remove higher frequencies and lower frequencies which are outside the
range of human hearing. To convert the analogue data to digital, the sound waves are sampled
at a given time rate. The amplitude of the sound cannot be measured precisely, so approximate
values are stored.

What is Amplitude of Sound?


The amplitude of a sound wave is the measure of the height of the wave. The amplitude of a sound wave
can be defined as the loudness (Volume) or the amount of maximum displacement of vibrating particles of
the medium from their mean position when the sound is produced. It is the distance between the crest or
trough and the mean position of the wave and its measure in decibel (db)

09-Sep-22 114
1.2 Multimedia:
B)-Sound :
What is bandwidth of frequency?
Bandwidth is a range of frequencies within a continuous set of frequencies. It is measured
in Hertz (Hz). The purpose of a communication system is to transfer information from the
transmitter which is located in one place to a receiver which is usually far away from the
transmitter.

09-Sep-22 115
1.2 Multimedia:
B)-Sound :

Figure above shows a sound wave. The x-axis shows the time intervals when the sound was sampled (0 to
20), and the y-axis shows the amplitude of the sampled sound (the amplitudes above 10 and below 0 are
filtered out in this example).

At time interval 1, the approximate amplitude is 9; at time interval 2, the approximate amplitude is 4, and so
on for all 20 time intervals. Because the amplitude range in Figure above is 0 to 10, then 4 binary bits can be
used to represent each amplitude value (for example, 9 would be represented by the binary value 1001).

Increasing the number of possible values used to represent sound amplitude also increases the accuracy of
the sampled sound (for example, using a range of 0 to 127 gives a much more accurate representation of
the sound sample than using a range of, for example, 0 to 10). This is known as the sampling resolution
(also known as the bit depth).
09-Sep-22 Mr. Noureddine Tadjerout 116
1.2 Multimedia:
B)-Sound :

09-Sep-22 Mr. Noureddine Tadjerout 117


AS-level Paper 1 Exam: Question 1
AS-level Paper 1 Exam: Question 1
AS-level Paper 1 Exam: Answer
AS-level Paper 1 Exam: Question 2
AS-level Paper 1 Exam: Answer 2
AS-level Paper 1 Exam: Question 3
AS-level Paper 1 Exam: Answer 3
AS-level Paper 1 Exam: Question 4
AS-level Paper 1 Exam: Question 4
AS-level Paper 1 Exam: Question 4
AS-level Paper 1 Exam: Answer 4
Learning objectives
1.3 Compression

09-Sep-22 Mr. Noureddine Tadjerout 129


Learning objectives
1.3 Compression

09-Sep-22 Mr. Noureddine Tadjerout 130


1.3 Compression
• Any binary data can be compressed

• Original data is recoverable intact if compression is lossless but not if lossy

• Text data compression must be lossless

• Run-length encoding and Huffman coding are examples of lossless


compression

• Lossy used for multimedia files

09-Sep-22 Mr. Noureddine Tadjerout 131


Compression
Watch the video for the Compression 95 minutes)
https://www.youtube.com/watch?v=kOFA8FPL5kE

09-Sep-22 Mr. Noureddine Tadjerout 132


Compression
Watch the video for the Lossy and Lossless (RLE) Compression (4 minutes)
https://www.youtube.com/watch?v=v1u-vY6NEmM

09-Sep-22 Mr. Noureddine Tadjerout 133


Compression
The Lossy and Lossless Compression

09-Sep-22 Mr. Noureddine Tadjerout 134


Compression
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. It encodes the sequence to
store only a single value and its count. For example, consider a screen containing plain black
text on a solid white background.

What is RLE used for?


RLE is particularly well suited to palette-based bitmap images such as computer icons, and was
a popular image compression method on early online services such as CompuServe before the
advent of more sophisticated formats such as GIF

Example: The sequence of data is stored as a single value and count. For example, for a minute
of a scene filmed at a beach there would be similar colours on screen for the duration of the
shot, such as the blues of the sky and the sea, and the yellows of the sand.

09-Sep-22 Mr. Noureddine Tadjerout 135


Compression
Watch the video for Run-length encoding (RLE) (6 minutes)
https://youtu.be/uaV2RuAJTjQ

09-Sep-22 Mr. Noureddine Tadjerout 136


Compression
Watch the video for Run-length encoding (RLE) (6 minutes)
https://www.youtube.com/watch?v=cAAeSn8_aCU

09-Sep-22 Mr. Noureddine Tadjerout 137


09-Sep-22 Mr. Noureddine Tadjerout 138
AS-level Paper 1 Exam: Question 1
AS-level Paper 1 Exam: Answer 1
AS-level Paper 1 Exam: Question 2
AS-level Paper 1 Exam: Question 2
AS-level Paper 1 Exam: Answer 2
AS-level Paper 1 Exam: Answer 2
AS-level Paper 1 Exam: Question 3
AS-level Paper 1 Exam: Answer 3
AS-level Paper 1 Exam: Question 4
AS-level Paper 1 Exam: Question 4
AS-level Paper 1 Exam: Question 4
AS-level Paper 1 Exam: Answer 4
AS-level Paper 1 Exam: Question 5
AS-level Paper 1 Exam: Question 5
AS-level Paper 1 Exam: Question 5
AS-level Paper 1 Exam: Answer 5
AS-level Paper 1 Exam: Answer 5
AS-level Paper 1 Exam: Answer 5
AS-level Paper 1 Exam: Question 6
AS-level Paper 1 Exam: Question 6
AS-level Paper 1 Exam: Answer 6
AS-level Paper 1 Exam: Question 7
AS-level Paper 1 Exam: Question 7
AS-level Paper 1 Exam: Question 7
AS-level Paper 1 Exam: Answer 7
AS-level Paper 1 Exam: Answer 7
AS-level Paper 1 Exam: Question 8
AS-level Paper 1 Exam: Question 8
AS-level Paper 1 Exam: Question 8
AS-level Paper 1 Exam: Question 8
AS-level Paper 1 Exam: Answer 8
AS-level Paper 1 Exam: Answer 8
AS-level Paper 1 Exam: Question 9
AS-level Paper 1 Exam: Question 9
AS-level Paper 1 Exam: Question 9
AS-level Paper 1 Exam: Question 9
AS-level Paper 1 Exam: Answer 9
AS-level Paper 1 Exam: Answer 9
AS-level Paper 1 Exam: Question 10
AS-level Paper 1 Exam: Question 10
AS-level Paper 1 Exam: Question 10
AS-level Paper 1 Exam: Answer 10
AS-level Paper 1 Exam: Answer 10
AS-level Paper 1 Exam: Question 11
AS-level Paper 1 Exam: Question 11
AS-level Paper 1 Exam: Question 11
AS-level Paper 1 Exam: Answer 11
AS-level Paper 1 Exam: Answer 11
AS-level Paper 1 Exam: Question 12
AS-level Paper 1 Exam: Question 12
AS-level Paper 1 Exam: Question 12
AS-level Paper 1 Exam: Answer 12
AS-level Paper 1 Exam: Answer 212
AS level Paper 1 Exam: Chapter 1: Information Representation more exercises

You might also like