Похожие презентации:
Chapter 1
1.
0101110?AE73F9?
CHAPTER 1.1
Number
System
2.
BinarySystem
3.
Why Binary SystemMotivation
Any form of information needs to be converted into a binary format so that it
can be processed by a computer
• Computer contains millions and millions of tiny switches, which can be turned
on and off.
• Therefore, the binary system is chosen as the way for a computer to represent any
sort of data.
On = 1
Off = 0
4.
ExplanationDenary System
Eg. 365
102 =100
101 =10
100 =1
3
6
5
Explanation: Multiply the digit value (eg.3) by the place value (eg. 100)
(3x100) + (6x10) + (5x1) = 365
5.
ExplanationBinary
Denary
Denary
Binary
6.
BinaryDenary
Explanation
22 =4
21 =2
20 =1
1
1
1
(1x4) + (1x2) + (1x1) = 7 in denary
7.
BinaryExplanation
Denary
Eg. "1011"
23 =8
22 =4
21 =2
20 =1
1
0
1
1
Explanation: Multiply the digit value (eg.1) by the place value (eg. 8).
Then sum it all up!
(1x8) + (0x4) + (1x2) + (1x1) = 11 in denary
8.
BinaryDenary
DIY
What is the denary form of "11100"?
24 =16
23 =8
22 =4
21 =2
20 =1
1
1
1
0
0
9.
BinaryDenary
DIY
ANSWER
24 =16
23 =8
22 =4
21 =2
20 =1
1
1
1
0
0
(1x16) + (1x8) + (1x4) + (0x2) + (0x1)
= 28 in denary
10.
DenaryBinary
Explanation
Convert 5 to binary:
5
2
2
2
5
2
1
0
remainder
remainder
remainder
1
0
1
Answer: 101
Read the remainder
from bottom to top
11.
DenaryBinary
Explanation
Convert 39 to binary:
39
2
2
2
2
2
2
39
19
9
4
2
1
0
remainder
remainder
remainder
remainder
remainder
remainder
1
1
1
0
0
1
Answer: 100111
Read the remainder
from bottom to top
12.
DenaryBinary
DIY
What is the binary form of 42?
25 =32
24 =16
23 =8
22 =4
21 =2
20 =1
13.
DenaryBinary
DIY
ANSWER
Convert 42 to binary:
42
2
2
2
2
2
2
42
21
10
5
2
1
0
remainder
remainder
remainder
remainder
remainder
remainder
0
1
0
1
0
1
Read the remainder
from bottom to top
Answer: 101010
14.
Denary SystemRECAP
102
101
100
7
6
5
Hundredth
Tenth
Ones
(7x100) + (6x10)
+ (5x1) = 765
15.
Denary SystemRECAP
102
101
100
7
6
5
(7x100) + (6x10)
+ (5x1) = 765
Binary System
22
21
20
1
1
1
(1x4) + (1x2)
+ (1x1) = 7
16.
BinaryDenary
DIY
What is the denary form of "1010"?
23 =8
22 =4
21 =2
20 =1
1
0
1
0
17.
BinaryDenary
DIY
ANSWER
23 =8
22 =4
21 =2
20 =1
1
0
1
0
(1x8) + (1x2) = 10 in denary
18.
DenaryBinary
DIY
What is the binary form of 38?
25 =32
24 =16
23 =8
22 =4
21 =2
20 =1
19.
DenaryBinary (Method 2)
DIY
ANSWER
Convert 38 to binary:
38
2
2
2
2
2
2
38
19
9
4
2
1
0
remainder
remainder
remainder
remainder
remainder
remainder
0
1
1
0
0
1
Read the remainder
from bottom to top
Answer: 100110
20.
PA S T Y E A R Q U E S T I O N21.
ANSWER22.
HexadecimalSystem
23.
MotivationHexadecimal System
It is a base 16 system.
It uses 16 digits to represent each value
Number System
Digits used to represent each value
Denary
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary
0, 1
Hexadecimal
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 , A, B, C, D, E, F
24.
ExplanationHexadecimal System
Binary System
Denary System
102 =100 101 =10 100 =1
3
6
5
(3x100) + (6x10) + (5x1) = 365
22 =4
21 =2
20 =1
1
0
1
(1x4) + (0x2) + (1x1) = 5
Hexadecimal System
?2 =?
?1 =?
?0 =?
3
E
5
25.
ExplanationHexadecimal System
Binary System
Denary System
102 =100 101 =10 100 =1
3
6
5
Hexadecimal System
162 =256 161 =16 160 =1
E
21 =2
20 =1
1
0
1
(1x4) + (0x2) + (1x1) = 5
(3x100) + (6x10) + (5x1) = 365
3
22 =4
5
26.
ConversionBinary
Hexadecimal
Hexadecimal
Binary
27.
BinaryHexadecimal
Explanation
Since 16 = 24 this means that FOUR binary digits are equivalent to each
hexadecimal digit.
28.
BinaryExplanation
Hexadecimal
101111100001
101 1
111 0
0 0 01
B
E
1
ANSWER : BE1
29.
BinaryExplanation
Hexadecimal
10 000111111101
00 10
2
0001 1111
1
F
ANSWER : 21FD
1101
D
30.
BinaryHexadecimal
What is the hexadecimal form of
0111010011100?
DIY
31.
BinaryDIY
Hexadecimal
ANSWER
0111010011100
0000 1110
0
E
1001 1100
9
C
32.
ExplanationBinary
Hexadecimal
F 9 3 5
1111
0011
0101
1001
Answer: 1111 1001 0011 0101
33.
HexadecimalBinary
What is the binary form of
BF08?
DIY
34.
BinaryHexadecimal
DIY
B F 0 8
1011
0000
1000
1111
Answer: 1011 1111 0000 1000
35.
ConversionHexadecimal
Denary
Denary
Hexadecimal
36.
BinaryDenary
RECAP
Eg. "111"
22 =4
21 =2
20 =1
1
1
1
(1x4) + (1x2) + (1x1) = 7 in denary
37.
HexadecimalDenary
Explanation
Eg. "45A"
162 =256
161 =16
160 =1
4
5
A
Note: A=10
(4x256) + (5x16) + (10x1) = 1114 in denary
38.
HexadecimalDenary
Explanation
Eg. "C8F"
162 =256
161 =16
160 =1
C
8
F
Note: C=12, F=15
(12x256) + (8x16) + (15x1) = 3215 in denary
39.
HexadecimalDIY
Denary
What is the denary form of BF08?
163 =4096
162 =256
161 =16
160 =1
B
F
0
8
40.
HexadecimalDIY
Denary
ANSWER
163 =4096
162 =256
161 =16
160 =1
B
F
0
8
(11x4096) + (15x256) + (0x16) + (8x1) = 48904 in denary
41.
DenaryBinary (Method 2)
RECAP
Convert 5 to binary:
5
2
2
2
5
2
1
0
remainder
remainder
remainder
1
0
1
Answer: 101
Read the remainder
from bottom to top
42.
DenaryHexadecimal
Explanation
Eg. "2004"
2004/16 = 125
remainder = 4
125/16 = 7
remainder = 13
2004
16 125 remainder 4
remainder
7
16
13
remainder
0
7
16
Note: 13=D
Answer: 7D4
43.
DenaryHexadecimal
DIY
What is the hexadecimal form of 3179?
3179/16 = ?
3179
16 198 remainder ?
remainder
?
16
?
remainder
?
?
16
44.
DenaryDIY
Hexadecimal
What is the hexadecimal form of 3179?
3179/16 = 198
remainder = 11
198/16 = 12
remainder = 6
3179
16 198 remainder 11
16 12 remainder 6
remainder 12
0
16
Answer: C6B
45.
PA S T Y E A R Q U E S T I O N46.
ANSWER47.
PA S T Y E A R Q U E S T I O N48.
ANSWER49.
Chapter 1.2Use of hexadecimal
system
50.
Use of hexadecimal systemDiscussion Time
Binary
Hexadecimal
110101111110
1AFD39
100111001
Brainstorm time: Why is Hexadecimal used?
51.
Use of hexadecimal systemExplanation
One hex digit represents four binary digits
The hex number is far easier for humans to
remember, copy and work with
Four uses of the hexadecimal system
52.
Usage 1: Error CodeExplanation
Error codes are often shown as
hexadecimal values.
These numbers refer to the memory
location of the error.
They are generated by the computer.
The programmer needs to know how to
interpret the hexadecimal error codes.
53.
Usage 1: Error CodeExplanation
54.
Usage 2: MAC addressExplanation
Media Access Control (MAC) address refers to
a number which uniquely identifies a device on a network.
The MAC address refers to the network interface card (NIC)
which is part of the device
The MAC address is rarely changed so that a particular
device can always be identified no matter where it is.
55.
Usage 2: MAC addressExplanation
00_1C_B3_4F_25_FE
Message
00_1C_C3_4F_23_AE
Mac address uniquely identify a device on a Local Area Network
56.
ExplanationUsage 2: MAC address
Form 1
NN-NN-NN-DD-DD-DD
00-1C-B3-4F-25-FE
Form 2
2
NN:NN:NN:DD:DD:DD
00:1C:B3:4F:25:FE
Mac Address comes with 2 forms
57.
ExplanationUsage 2: MAC address
00-1C-B3
4F-25-FE
Identity number of
Serial number of
the manufacturer
a device
Eg. 00 – 14 – 22 which identifies devices made by Dell
00 – a0 – c9 which identifies devices made by Intel
58.
Usage 3: InternetProtocol Addresses
Explanation
Each device connected to a network is given an address
known as the Internet Protocol address
An IPv4 address is a 32-bit number written in denary or
hexadecimal form e.g. 109.108.158.1 (or 77.76.9e.01 in hex)
IPv4 has recently been improved upon by the adoption of
IPv6. An IPv6 address is a 128-bit number broken down into
16-bit chunks, represented by a hexadecimal number.
Eg. a8f b:7a88:fff0:0fff:3d21:2085:66f b:f0fa
59.
Usage 4: HyperText MarkupLanguage (HTML) colour code
Explanation
HyperText Mark-up Language (HTML) is used when writing
and developing web pages.
It is not a programming language, but a markup language.
A mark-up language is used in the processing, definition
and presentation of text.
60.
OverviewExplanation
The 4 usages of Hexadecimals - EMIH
1. E - Error Codes
2. M - MAC Address
3. I - Internet Protocol Address
4. H - HTML Colour Code
61.
PA S T Y E A R Q U E S T I O N62.
ANSWER63.
PA S T Y E A R Q U E S T I O N64.
ANSWER65.
Chapter 1.3Addition of
binary number
66.
Addition of binary numberExplanation
How do we perform add and carry in denary?
0+0=0
0+9=9
9+0=9
9 + 1 = 10
1
9
+1
10
67.
ExplanationAddition of binary number
How do we perform add and carry in denary?
1 1
56
+79
1 35
6+9 = 15 (>9)
1+5+7 = 13 (>9)
68.
Addition of binary numberHow do we perform add and carry in binary?
0+0=0
0+1=1
1+0=1
1 + 1 = 10
Explanation
69.
ExplanationAddition of binary number
How do we perform add and carry in binary?
1 1 1
00100111
+01001010
0 1110 001
70.
Addition of binary numberHow do we perform add and carry in binary?
Perform
01111110 + 00111110
DIY
71.
Addition of binary numberThe overflow condition
1 11 111
01101110
+11011110
1 01 001 100
Explanation
72.
Addition of binary numberThe overflow condition
Explanation
1 11 111
01101110
+11011110
1 01 001 100
The maximum denary of an 8-bit binary number (11111111)
is (28 - 1 ) = 255
The generation of a 9th bit is a clear indication that the
sum has exceeded this value.
This is known as an overflow error. The sum is too big to
be stored using 8 bits.
73.
Addition of binary numberThe overflow condition
01101110 = 110
\
11011110 = 222
Explanation
1 11 111
01101110
+11011110
1 01 001 100
110 + 222 = 322
322 > 255 (overflow)
The sum is too big to be stored in a 8 bit binary.
74.
Lesson1.4:Objectives
Chapter
Binary
Last lesson on the binary system
Shifting
BINARY SHIFTING
Multiplication
and division of
binary numbers
TWO COMPLEMENTS
Represent
negative
number in
binary
75.
BINARY SHIFTINGBinary shift is a process that a CPU uses to perform
multiplication and division.
76.
BINARY SHIFTING - MULTIPLICATIONFor a CPU to multiply a binary number, the number
needs to be shifted to the left and will fill the remaining
gaps with zeros.
77.
BINARY SHIFTING -M ULTIPLICATIO NExamples: 111 (Binary)
64
32
16
0
0
0
8
0
4
1
2
1
1
1
Examples: 1110 (Binary)
64
32
16
0
0
0
8
1
4
1
2
1
1
0
Examples: 11100 (Binary)
64
32
16
0
0
1
8
1
4
1
2
0
1
0
78.
BINARY SHIFTING - MULTIPLICATIONExamples: 111 (Binary)
64
32
16
0
0
0
8
0
4
1
2
1
1
1
Multiply by 2, shift 1 place to the left
1110
Multiply by 4, shift 2 place to the left
11100
Multiply by 8, shift 3 place to the left
111000
Multiply by 2^n, shift n place to the left
79.
BINARY SHIFTING - DIVISIONFor a CPU to multiply a binary number, the number
needs to be shifted to the right.
80.
BINARY SHIFTING - DIVISIONExamples: 101100 (Binary)
32
16
8
1
0
1
4
1
2
0
1
0
8
0
4
1
2
1
1
0
Examples: 1011 (Binary)
32
16
8
0
0
1
4
0
2
1
1
1
Examples: 10110 (Binary)
32
0
16
1
81.
BINARY SHIFTING - DIVISIONExamples: 101100 (Binary)
32
16
8
1
0
1
4
1
2
0
1
0
Divide by 2, shift 1 place to the right
10110
Divide by 4, shift 2 place to the right
1011
Divide by 8, shift 3 place to the right
101
Divide by 2^n, shift n place to the right
82.
BINARY SHIFTING WITH 8-BIT BINARY NUMBERSRegisters contained within the CPU often have 8-bits limits
on the amount of data they can hold at any one time.
• The multiplying shifting process can cause bits to be lost at
one end of the register, and zeros added at the opposite
end.
• This process is known as losing the most significant bit.
83.
BINARY SHIFTING WITH 8-BIT BINARY NUMBERSExamples: 10110101 (181 in denary)
128
1
64
0
32
1
16
1
8
0
4
1
2
0
1
1
10110101 -> 01101010
106 in denary
The bit lost is called the most significant bit, and when it
is shifted beyond the furthest-column the binary data that
is stored loses precision due to overflow.
84.
BINARY SHIFTING WITH 8-BIT BINARY NUMBERSThe same process can happen when dividing an 8-bit
binary number.
Example: 10111101 (189 in denary)
128
1
64
0
32
1
16
1
8
1
4
1
2
0
1
1
Divide this number by 32 (move 5 places to the right)
128
0
64
0
32
0
16
0
The division shift produces the
binary number 101 = 5, not
5.9 that arithmetic suggests.
8
0
4
1
2
0
Least
Significant
bit
1
1
11101
85.
Lesson1.5:Objectives
Chapter
Two
Last lesson on the binary system
Complements
BINARY SHIFTING
Multiplication
and division of
binary numbers
TWO COMPLEMENTS
Represent
negative
number in
binary
86.
TWO COMPLEMENTSA PROCESSOR CAN ALSO REPRESENT NEGATIVE
NUMBERS.
• ONE OF THE METHOD THAT A PROCESS
REPRESENT NEGATIVE NUMBERS IS CALLED
TWO'S COMPLEMENT.
87.
TWO COMPLEMENTS88.
TWO COMPLEMENTSTO REPRESENT NEGATIVE NUMBERS, IT IS IMPORTANT TO THINK
ABOUT THE PLACE VALUE OF THE FURTHEST-LEFT BIT IN A
DIFFERENT WAY.
• PROCESSOR CAN BE SET UP TO SEE THE BIT IN THE EIGHTH
COLUMN AS A SIGN BIT.
0 = POSITIVE
1 = NEGATIVE
89.
CONVERT POSITIVE BINARY INTEGER TO A TWO'S COMPLEMENT 8-BIT INTEGERExamples:13
Step 1: Convert 13 into binary.
1101 in binary
Step 2: Put the number into the place value column
-128
0
64
0
32
0
16
0
8
1
4
1
2
0
Step 3: Ensure that the the leftmost bit is 0 (+).
1
1
90.
DIYConvert 19 into a Two's complement
8-bit Integer
91.
CONVERT POSITIVE BINARY INTEGER TO A TWO'S COMPLEMENT 8-BIT INTEGERExamples:19
Step 1: Convert 19 into binary.
10011 in binary
Step 2: Put the number into the place value column
-128
0
64
0
32
0
16
1
8
0
4
0
2
1
Step 3: Ensure that the the leftmost bit is 0 (+).
Answer: 00010011
1
1
92.
CONVERT TWO'S COMPLEMENT 8-BIT INTEGER TO A POSITIVE BINARY INTEGERExamples: Convert 00010011 (two's complement) to denary
Step 1: Put the number into the place value column
-128
0
64
0
32
0
16
1
8
0
4
0
2
1
1
1
Step 2: This shows that it is a positive number, we can
just convert the binary into denary directly.
Step 3: Calculate the denary value.
(1x16) + (1x2) + (1x1) = 19
93.
DIYConvert 01010011 (two's complement)
to denary
94.
CONVERT TWO'S COMPLEMENT 8-BIT INTEGER TO A POSITIVE BINARY INTEGERExamples: Convert 01010011 (two's complement) to denary
Step 1: Put the number into the place value column
-128
0
64
1
32
0
16
1
8
0
4
0
2
1
1
1
Step 2: This shows that it is a positive number, we can
just convert the binary into denary directly.
Step 3: Calculate the denary value.
(1x64) + (1x16) + (1x2) + (1x1) = 83
95.
CONVERT NEGATIVE BINARY NUMBERS IN TWO'S COMPLEMENT FORMAT ANDCONVERT TO DENARY
Examples: 10010011
Step 1: Put the number into the place value column
-128
1
64
0
32
0
16
1
8
0
4
0
2
1
1
1
Step 2: The left-most bit is 1, this means that it is a
negative number.
Step 3: Compute the denary value as usual.
(1x -128) + (1x16) + (1x2) + (1x1)
= -128 + 16 + 2 + 1
= -109
96.
DIYConvert 10110011 (Two's Complement)
to denary
97.
CONVERT NEGATIVE BINARY NUMBERS IN TWO'S COMPLEMENT FORMAT ANDCONVERT TO DENARY
Examples: 10110011
Step 1: Put the number into the place value column
-128
1
64
0
32
1
16
1
8
0
4
0
2
1
1
1
Step 2: The left-most bit is 1, this means that it is a
negative number.
Step 3: Compute the denary value as usual.
(1x -128) (1x32)+ (1x16) + (1x2) + (1x1)
= -128 + 32 + 16 + 2 + 1
= -77
98.
CONVERTING NEGATIVE DENARY NUMBERS INTO BINARY NUMBERS IN TWO’SCOMPLEMENT FORMAT
Examples: -67
Step 1: Convert the number to positive.
67
Step 2: Write the number in binary form (8 bits).
01000011
Step 3: Invert each binary value.
10111100
99.
Step 4: Add 1 to the binary number.10111100
1
+
10111101
Step 5: This gives us -67.
-128
1
64
0
32
1
16
1
8
1
4
1
-128 + 32 + 16 + 8 + 4 + 1 = -67
2
0
1
1
100.
DIYConvert -65 to 8 bit two's complement
binary number
101.
CONVERTING NEGATIVE DENARY NUMBERS INTO BINARY NUMBERS IN TWO’SCOMPLEMENT FORMAT
Examples: -65
Step 1: Convert the number to positive.
65
Step 2: Write the number in binary form (8 bits).
01000001
Step 3: Invert each binary value.
10111110
102.
Step 4: Add 1 to the binary number.10111110
1
+
10111111
Step 5: This gives us -65.
-128
1
64
0
32
1
16
1
8
1
4
1
2
1
-128 + 32 + 16 + 8 + 4 + 2 + 1 = -65
1
1
103.
Summary: Convert negative denary to two's complementExamples: -65
65
Convert to (+)
01000001
Convert to binary
10111110
Invert the digit
1
10111111
+1
Final result
104.
Chapter 1.6105.
106.
107.
108.
109.
110.
111.
112.
113.
The number of bits used to represent sound amplitude indigital sound recording, as known as bit depth
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
Chapter 1.7Measurement of Data
Storage and Calculation
of file size
125.
Measurementof Data
Storage
A bit is the basic unit of all computing memory
storage terms and is either 1 or 0.
The byte is the smallest unit of memory in a
computer.
8 bits = 1 byte
4 bits = 1 nibble
126.
MemorySize
System
Based on the SI (base 10) system of units where
1 kilo is equal to 1000.
127.
MemorySize
As memory size is actually measured in terms of powers of 2...
System
Based on the IEC (base 2) system of units where
1 kilo is equal to 1024 (2^10).
128.
MemorySize
System
Converting Bytes into KiB, MiB and GiB
68719476736 Bytes
= 68719476736 Bytes / 1024 = 67108864 KiB
= 67108864 KiB / 1024
= 65536 MiB
= 65536 MiB / 1024
= 64 GiB
129.
MemorySize
System
Converting Gib, Mib, Kib into bytes
64 GiB
= 64 x 1024
= 65536 MiB
= 65536 x 1024
= 67108864 KiB
= 67108864 x 1024
= 68719476736 Bytes
130.
DIYConvert the size of GTA-V to bytes
72 GiB
= 72 x 1024
= 73728 MiB
= 65536 x 1024
= 75497472 KiB
= 75497472 x 1024
= 77309411328 Bytes
131.
Calculationof file
size
Image
Audio
132.
Calculationof file
size - Image
Image Resolution - The number of pixels
that make up an image.
The higher the image resolution, the higher
the quality of the image.
133.
Calculationof file
size - Image
Formula
image resolution (pixels) x colour depths (bits)
134.
Example 1Calculation
of file
size - Image
2px
2px
Total pixels = 2 x 2 = 4
Calculation = (2x2) x 2
= 8 bits = 1 byte
00 01
10 11
Colour depth = 2
135.
CalculationExample 2
of file
size - Image
Formula : image resolution (pixels) x colour depths (bits)
Question:
Image Resolution = 1024 x 1080
Colour depth = 32
Calculate the size of this image in Bytes.
Workings:
1024 x 1080 = 1105920 pixels
1105920 x 32 = 35389440 bits
Answer in byte: 35389440/8 = 4423680 bytes
136.
Calculationof file
size - Image
Example 2
Question:
Image Resolution = 1024 x 1080
Colour depth = 32
Calculate the size of this image in Bytes. How many photograph of
this size would fit onto a memory stick of 64Gib.
Each image = 4423680 bytes
First convert 64 Gib into bytes:
64 x 1024 = 65536 MiB
65536 x 1024 = 67108864 KiB
67108864 x 1024 = 68719476736 bytes
137.
Calculationof file
size - Image
Example 2
Question:
Image Resolution = 1024 x 1080
Colour depth = 32
Calculate the size of this image in Bytes. How many photograph of
this size would fit onto a memory stick of 64Gib.
Each image = 4423680 bytes
First convert 64 Gib into bytes = 68719476736 bytes
68719476736/4423680 = 15534 photos.
138.
DIYQuestion:
Image Resolution = 2048 x 2048
Colour depth = 16
Calculate the size of this image in Bytes.
139.
DANSWERQuestion:
Image Resolution = 2048 x 2048
Colour depth = 16
Calculate the size of this image in Bytes.
Answer:
2048 x 2048 x 16 = 67108864 bits
= 67108864/8
= 8388608 bytes
140.
DIYQuestion:
Image Resolution = 2048 x 2048
Colour depth = 16
Calculate the size of this image in Bytes (Answer: 8388608 bytes).
What is the size of the image in MiB.
141.
DANSWERQuestion:
Image Resolution = 2048 x 2048
Colour depth = 16
Calculate the size of this image in Bytes (Answer: 8388608 bytes).
What is the size of the image in MiB.
8388608 / 1024 = 8192 KiB
8192 / 1024 = 8 MiB
142.
CalculationFormula
of file
size - Sound
Sample Rate (in Hz) x Sample Resolution (in bits) x length of sample (in seconds)
143.
Calculationof file
size - Sound
Mono Sound vs Stereo Sound
Comparison
144.
CalculationExample 1 - Mono Sound
of file
size - Sound
Question:
Sample Rate: 44100
Sample Resolution: 8 bits
Length of the music: 20 seconds
Calculate the size of the audio in KiB.
44100 x 8 x 20 = 7056000 bits
7056000/8 = 882000 bytes
882000 / 1024 = 861.328 KiB
145.
Calculationof file
Example 1 - Stereo Sound
size - Sound
An audio CD has a sample rate of 44100 and a sample resolution of 16 bits. The
music being sampled uses two channels to allow for stereo recording. Calculate the
file size for a 60-minute recording.
44100 x 16 x 3600 = 2540160000 bits
2540160000 x 2 = 5080320000 bits
5080320000 / 8 = 635040000 bytes
635040000 / 1024 = 620156.25 KiB
620156.25 / 1024 = 605.62 MiB
146.
DIYAn audio CD has a sample rate of 44100 and a sample resolution of 8 bits. The
music being sampled uses two channels to allow for stereo recording. Calculate the
file size for a 25-minute recording.
147.
DIYAn audio CD has a sample rate of 44100 and a sample resolution of 8 bits. The
music being sampled uses two channels to allow for stereo recording. Calculate the
file size for a 25-minute recording in MiB.
44100 x 8 x 1500 = 529200000 bits
529200000 x 2 = 1058400000 bits
1058400000 / 8 = 132300000 bytes
132300000 / 1024 = 129199.218 KiB
129199.218 / 1024 = 126.17 MiB
148.
PA S T Y E A R Q U E S T I O N149.
ANSWER150.
151.
DATA COMPRESSION152.
DATA COMPRESSION153.
FILE SIZE OF IMAGES AND SOUND CAN BE VERY LARGE.• THEREFORE, DATA COMPRESSION IS NEEDED TO REDUCE
THE SIZE OF A FILE.
154.
WHAT ARE SOME BENEFITS OF REDUCINGTHE FILE SIZE?
155.
156.
LOSSYFILE
COMPRESSI
ON
LOSSLESS
FILE
COMPRESSI
ON
157.
FILE COMPRESSION ALGORITHM ELIMINATESUNNECESSARY DATA FROM THE FILE.
• ORIGINAL FILE CANNOT BE RECONSTRUCTED ONCE IT HAS
BEEN COMPRESSED.
• IMAGE - REDUCE THE RESOLUTION // COLOUR DEPTH
• SOUND - REDUCE THE SAMPLING RATE // SAMPLING
RESOLUTION
• SOME LOSSY FILE COMPRESSION ALGORITHMS ARE:
MPEG-3
MPEG-4
JPEG
158.
MPEG-3
A COMPRESSION TECHNOLOGY THAT
REDUCES THE SIZE OF A NORMAL MUSIC
FILE BY ABOUT 90%.
SECRET
• REMOVE
SOUNDS
OUTSIDE THE
HUMAN EAR
RANGE
• ELIMINATE THE
SOFTER SOUND
- PERCEPTUAL
MUSIC SHAPING
159.
ALLOWS STORAGE OF MULTIMEDIA FILESRATHER THAN JUST SOUND.
MPEG-4
SECRET
• MOVIES CAN BE
STREAMED
USING THE MP4
FORMAT
WITHOUT
LOSING ANY
REAL
DISCERNIBLE
QUALITY
160.
A LOSSY COMPRESSION ALGORITHM USEDFOR BITMAP IMAGES. ORIGINAL FILE CAN NO
LONGER BE CONSTRUCTED
JPEG
SECRET
• REMOVE
COLOUR
SHADES
(HUMAN CAN'T
NOTICE THEM)
161.
162.
163.
ALL THE DATA FROM THE ORIGINALUNCOMPRESSED FILE CAN BE
RECONSTRUCTED
• THIS IS IMPORTANT FOR FILES WHERE LOSS
OF DATA WOULD BE DISASTROUS
(COMPLEX SPREADSHEET).
• LOSSLESS FILE COMPRESSION IS DESIGNED
SO THAT NONE OF THE ORIGiNAL DETAIL
FROM THE FILE IS LOST.
LOSSLESS
FILE
COMPRESSI
ON
164.
1. CAN BE USED FOR LOSSLESS COMPRESSION OF A NUMBER OFDIFFERENT FILE FORMATS.
RUNLENGTH
ENCODING
2. IT REDUCES THE SIZE OF A STRING OF ADJACENT, IDENTICAL DATA.
3. A REPEATED STRING IS ENCODED INTO TWO VALUES.
NUMBER OF
IDENTICAL
DATA
DATA ITEM
165.
RUNLENGTHENCODING
IN
ACTION
16
bytes
166.
Does not work well when no repeated data!RUN-LENGTH
ENCODING
IN
ACTION
Each digit - 1 byte
Total size = 8 bytes (50% reduction in size)
167.
3,2,5,2,42,4,3,4,3
1.6.1.6.2
0, 15,1
TO BE
CONTINUE
168.
169.
REDUCECOLOUR
DEPTH
REDUCE
IMAGE
RESOLUTION
170.
A LOSSY COMPRESSION ALGORITHM USEDFOR BITMAP IMAGES. ORIGINAL FILE CAN NO
LONGER BE CONSTRUCTED
JPEG
SECRET
• REMOVE
COLOUR
SHADES
(HUMAN CAN'T
NOTICE THEM)