Chapter 1 o level computer science with past paper

NoumanShamim1 132 views 174 slides Sep 17, 2024
Slide 1
Slide 1 of 174
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130
Slide 131
131
Slide 132
132
Slide 133
133
Slide 134
134
Slide 135
135
Slide 136
136
Slide 137
137
Slide 138
138
Slide 139
139
Slide 140
140
Slide 141
141
Slide 142
142
Slide 143
143
Slide 144
144
Slide 145
145
Slide 146
146
Slide 147
147
Slide 148
148
Slide 149
149
Slide 150
150
Slide 151
151
Slide 152
152
Slide 153
153
Slide 154
154
Slide 155
155
Slide 156
156
Slide 157
157
Slide 158
158
Slide 159
159
Slide 160
160
Slide 161
161
Slide 162
162
Slide 163
163
Slide 164
164
Slide 165
165
Slide 166
166
Slide 167
167
Slide 168
168
Slide 169
169
Slide 170
170
Slide 171
171
Slide 172
172
Slide 173
173
Slide 174
174

About This Presentation

o level computer scince chapter 1 with past paper questio


Slide Content

Number System CHAPTER 1.1 0101110? AE73F9?

Binary System

Why Binary System Any form of information needs to be converted into a binary format so that it can be processed by a computer On = 1 Off = 0 Motivation 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.

Eg. 365 10 2 =100 3 6 5 Denary System (3x100) + (6x10) + (5x1) = 365 Explanation 10 1 =10 10 =1 Explanation: Multiply the digit value (eg.3) by the place value ( eg. 100)

Explanation Denary Binary Binary Denary

1 1 1 (1x4) Explanation Denary Binary 2 2 =4 2 1 =2 2 =1 + (1x2) + (1x1) = 7 in denary

Eg. "1011" 1 1 1 Denary Binary 2 2 =4 2 1 =2 2 =1 2 3 =8 Explanation (1x8) + (0x4) + (1x2) = 11 in denary + (1x1) Explanation: Multiply the digit value (eg.1) by the place value ( eg. 8). Then sum it all up!

DIY 1 1 1 What is the denary form of "11100"? Denary Binary 2 2 =4 2 1 =2 2 =1 2 3 =8 2 4 =16

DIY 1 1 1 ANSWER Denary Binary 2 2 =4 2 1 =2 2 =1 2 3 =8 2 4 =16 (1x16) + (1x8) + (1x4) + (0x2) + (0x1) = 28 in denary

5 2 2 2 1 1 Denary Binary Convert 5 to binary: 5 Explanation remainder remainder 2 remainder 1 Read the remainder from bottom to top Answer: 101

39 2 2 19 9 1 1 Denary Binary Convert 39 to binary: 39 Explanation remainder remainder 2 4 remainder 1 Read the remainder from bottom to top Answer: 100111 2 2 remainder 2 1 remainder 2 remainder 1

DIY What is the binary form of 42? Denary Binary 2 2 =4 2 1 =2 2 =1 2 3 =8 2 4 =16 2 5 =32

DIY ANSWER 42 2 2 21 10 1 Convert 42 to binary: 42 remainder remainder 2 5 remainder Read the remainder from bottom to top 2 2 remainder 1 2 1 remainder 2 remainder 1 Answer: 101010 Denary Binary

Denary System 7 6 5 10 2 10 1 10 (7x100) + (6x10) + (5x1) = 765 Ones Tenth Hundredth RECAP

Denary System 7 6 5 10 2 10 1 10 Binary System 1 1 1 2 2 2 1 2 (7x100) + (6x10) + (5x1) = 765 (1x4) + (1x2) + (1x1) = 7 RECAP

DIY 1 1 What is the denary form of "1010"? Denary Binary 2 2 =4 2 1 =2 2 =1 2 3 =8

DIY 1 1 ANSWER Denary Binary 2 2 =4 2 1 =2 2 =1 2 3 =8 (1x8) + (1x2) = 10 in denary

DIY What is the binary form of 38? Denary Binary 2 2 =4 2 1 =2 2 =1 2 3 =8 2 4 =16 2 5 =32

DIY ANSWER 38 2 2 19 9 1 Convert 38 to binary: 38 remainder remainder 2 4 remainder 1 Read the remainder from bottom to top 2 2 remainder 2 1 remainder 2 remainder 1 Answer: 100110 Denary Binary (Method 2)

PAST YEAR QUESTION

ANSWER

Hexadecimal System

Hexadecimal System Motivation It is a base 16 system. It uses 16 digits to represent each value Number System Digits used to represent each value Denary Binary Hexadecimal 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 0, 1 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 , A, B, C, D, E, F

Hexadecimal System Explanation 3 6 5 (3x100) + (6x10) + (5x1) = 365 1 1 (1x4) + (0x2) + (1x1) = 5 Denary System Binary System Hexadecimal System 3 E 5 2 2 =4 2 1 =2 2 =1 10 2 =100 10 1 =10 10 =1 ? 2 =? ? 1 =? ? =?

Hexadecimal System 3 6 5 (3x100) + (6x10) + (5x1) = 365 1 1 (1x4) + (0x2) + (1x1) = 5 Denary System Binary System Hexadecimal System 3 E 5 Explanation 16 2 =256 16 1 =16 16 =1 2 2 =4 2 1 =2 2 =1 10 2 =100 10 1 =10 10 =1

Binary Binary Hexadecimal Hexadecimal Conversion

Binary Hexadecimal Explanation Since 16 = 2 4 this means that FOUR binary digits are equivalent to each hexadecimal digit.

1 0 1 1 1 1 1 0 0 0 0 1 Binary Hexadecimal Explanation 1 1 1 1 1 1 1 1 E B ANSWER : BE1

1 0 0 0 0 1 1 1 1 1 1 1 0 1 Binary Hexadecimal Explanation 10 D F 1 ANSWER : 21FD 0001 1111 1101 00 2

DIY What is the hexadecimal form of 0111010011100? Binary Hexadecimal DIY

DIY ANSWER Binary Hexadecimal DIY 0111010011100 1100 1001 1110 0000 C 9 E

Binary Hexadecimal Explanation F 9 3 5 1111 1001 0011 0101 Answer: 1111 1001 0011 0101

DIY What is the binary form of BF08? Binary Hexadecimal DIY

B F 0 8 1111 0000 1000 Answer: DIY Binary Hexadecimal DIY 1011 1011 1111 0000 1000

Denary Denary Hexadecimal Hexadecimal Conversion

Eg. "111" 1 1 1 (1x4) + (1x2) + (1x1) = 7 in denary RECAP Denary Binary 2 2 =4 2 1 =2 2 =1

Denary Hexadecimal Explanation Eg. "45A" 4 5 A (4x256) + (5x16) + (10x1) = 1114 in denary Note: A=10 16 2 =256 16 1 =16 16 =1

Denary Hexadecimal Explanation Eg. "C8F" C 8 F (12x256) + (8x16) + (15x1) = 3215 in denary Note: C=12, F=15 16 2 =256 16 1 =16 16 =1

DIY What is the denary form of BF08? Denary Hexadecimal DIY B F 8 16 2 =256 16 1 =16 16 =1 16 3 =4096

DIY ANSWER Denary Hexadecimal DIY B F 8 (11x4096) + (15x256) + (0x16) + (8x1) = 48904 in denary 16 2 =256 16 1 =16 16 =1 16 3 =4096

5 2 2 2 1 1 Denary Binary Convert 5 to binary: 5 RECAP (Method 2) remainder remainder 2 remainder 1 Read the remainder from bottom to top Answer: 101

Denary Hexadecimal Explanation Eg. "2004" 2004 16 16 125 remainder 2004 /16 = 4 125 /16 = 7 13 remainder 16 remainder 7 Answer: 7D4 Note: 13=D 125 remainder = 4 7 remainder = 13

DIY What is the hexadecimal form of 3179? Denary Hexadecimal DIY 3179 16 16 198 remainder ? ? ? remainder 16 ? remainder ? 3179 /16 = ?

DIY 16 6 What is the hexadecimal form of 3179? Denary Hexadecimal DIY 3179 16 198 remainder 11 12 remainder 16 remainder 12 3179 /16 198 /16 Answer: C6B = 198 remainder = 11 = 12 remainder = 6

PAST YEAR QUESTION

ANSWER

PAST YEAR QUESTION

ANSWER

Chapter 1.2 Use of hexadecimal system

Discussion Time Use of hexadecimal system Binary Hexadecimal 110101111110100111001 1AFD39 Brainstorm time: Why is Hexadecimal used?

Explanation Use of hexadecimal system 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

Explanation Usage 1: Error Code 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.

Explanation Usage 1: Error Code

Explanation Usage 2: MAC address 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.

Explanation Usage 2: MAC address 00_1C_B3_4F_25_FE 00_1C_C3_4F_23_AE Mac address uniquely identify a device on a Local Area Network Message

Explanation Usage 2: MAC address 00-1C-B3-4F-25-FE NN-NN-NN-DD-DD-DD 00:1C:B3:4F:25:FE NN:NN:NN:DD:DD:DD Form 1 Form 2 2 Mac Address comes with 2 forms

Explanation Usage 2: MAC address 00-1C-B3 4F-25-FE Identity number of the manufacturer Serial number of a device Eg. 00 – 14 – 22 which identifies devices made by Dell 00 – a0 – c9 which identifies devices made by Intel

Explanation Usage 3: Internet Protocol Addresses 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. E g. a8f b:7a88:fff0:0fff:3d21:2085:66f b:f0fa

Explanation Usage 4: HyperText Markup Language (HTML) colour code 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.

Explanation Overview The 4 usages of Hexadecimals - EMIH 1. E - Error Codes 2. M - MAC Address 3. I - Internet Protocol Address 4. H - HTML Colour Code

PAST YEAR QUESTION

ANSWER

PAST YEAR QUESTION

ANSWER

Chapter 1.3 Addition of binary number

Explanation How do we perform add and carry in denary? 0 + 0 = 0 0 + 9 = 9 9 + 0 = 9 9 + 1 = 10 9 +1 1 1 Addition of binary number

Explanation How do we perform add and carry in denary? 56 +79 6+9 = 15 (>9) 5 1 1+5+7 = 13 (>9) 3 1 1 Addition of binary number

Explanation How do we perform add and carry in binary? 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10 Addition of binary number

Explanation How do we perform add and carry in binary? 00100111 +01001010 1 1 1 1 1 1 1 Addition of binary number

DIY How do we perform add and carry in binary? Perform 01111110 + 00111110 Addition of binary number

Explanation The overflow condition 01101110 +11011110 1 1 1 1 1 1 1 1 1 1 Addition of binary number

Addition of binary number Explanation The overflow condition 01101110 +11011110 1 1 1 1 1 1 1 1 1 1 The maximum denary of an 8-bit binary number (11111111) is (2 8 - 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.

Explanation The overflow condition 01101110 +11011110 1 1 1 1 1 1 1 1 1 1 01101110 = 110 \ 11011110 = 222 110 + 222 = 322 322 > 255 (overflow) The sum is too big to be stored in a 8 bit binary. Addition of binary number

Lesson Objectives Last lesson on the binary system BINARY SHIFTING Multiplication and division of binary numbers TWO COMPLEMENTS Represent negative number in binary Chapter 1.4: Binary Shifting

BINARY SHIFTING Binary shift is a process that a CPU uses to perform multiplication and division.

BINARY SHIFTING - MULTIPLICATION For a CPU to multiply a binary number, the number needs to be shifted to the left and will fill the remaining gaps with zeros.

16 32 8 4 2 1 64 16 32 8 4 2 1 64 16 32 8 4 2 1 64 BINARY SHIFTING - MULTIPLICATION Examples: 111 (Binary) 1 1 1 Examples: 1110 (Binary) 1 1 1 Examples: 11100 (Binary) 1 1 1

16 32 8 4 2 1 64 BINARY SHIFTING - MULTIPLICATION Examples: 111 (Binary) 1 1 1 Multiply by 2, shift 1 place to the left 1110 Multiply by 4, shift 2 place to the left Multiply by 8, shift 3 place to the left 11100 111000 Multiply by 2^n, shift n place to the left

BINARY SHIFTING - DIVISION For a CPU to multiply a binary number, the number needs to be shifted to the right.

16 32 8 4 2 1 16 32 8 4 2 1 16 32 8 4 2 1 BINARY SHIFTING - DIVISION Examples: 101100 (Binary) 1 1 1 Examples: 10110 (Binary) 1 1 1 Examples: 1011 (Binary) 1 1 1

16 32 8 4 2 1 BINARY SHIFTING - DIVISION Examples: 101100 (Binary) 1 1 1 Divide by 2, shift 1 place to the right 10110 Divide by 4, shift 2 place to the right Divide by 8, shift 3 place to the right 1011 101 Divide by 2^n, shift n place to the right

BINARY SHIFTING WITH 8-BIT BINARY NUMBERS Registers 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.

16 32 8 4 2 1 64 128 BINARY SHIFTING WITH 8-BIT BINARY NUMBERS Examples: 10110101 (181 in denary) 1 1 1 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.

16 32 8 4 2 1 64 128 16 32 8 4 2 1 64 128 BINARY SHIFTING WITH 8-BIT BINARY NUMBERS The same process can happen when dividing an 8-bit binary number. 1 1 1 1 1 1 Example: 10111101 (189 in denary) Divide this number by 32 (move 5 places to the right) 1 1 Least Significant bit The division shift produces the binary number 101 = 5, not 5.9 that arithmetic suggests. 11101

Lesson Objectives Last lesson on the binary system BINARY SHIFTING Multiplication and division of binary numbers TWO COMPLEMENTS Represent negative number in binary Chapter 1.5: Two Complements

TWO COMPLEMENTS A PROCESSOR CAN ALSO REPRESENT NEGATIVE NUMBERS. ONE OF THE METHOD THAT A PROCESS REPRESENT NEGATIVE NUMBERS IS CALLED TWO'S COMPLEMENT.

TWO COMPLEMENTS

TWO COMPLEMENTS TO 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

16 32 8 4 2 64 -128 CONVERT POSITIVE BINARY INTEGER TO A TWO'S COMPLEMENT 8-BIT INTEGER Examples:13 1 1 1 1 Step 2: Put the number into the place value column Step 3: Ensure that the the leftmost bit is 0 (+). Step 1: Convert 13 into binary. 1101 in binary

DIY Convert 19 into a Two's complement 8-bit Integer

16 32 8 4 2 64 -128 CONVERT POSITIVE BINARY INTEGER TO A TWO'S COMPLEMENT 8-BIT INTEGER Examples:19 1 1 1 1 Step 2: Put the number into the place value column Step 3: Ensure that the the leftmost bit is 0 (+). Step 1: Convert 19 into binary. 10011 in binary Answer: 00010011

16 32 8 4 2 64 -128 CONVERT TWO'S COMPLEMENT 8-BIT INTEGER TO A POSITIVE BINARY INTEGER Examples: Convert 00010011 (two's complement) to denary 1 1 1 1 Step 1: Put the number into the place value column 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

Convert 01010011 (two's complement) to denary DIY

16 32 8 4 2 64 -128 CONVERT TWO'S COMPLEMENT 8-BIT INTEGER TO A POSITIVE BINARY INTEGER Examples: Convert 01010011 (two's complement) to denary 1 1 1 1 1 Step 1: Put the number into the place value column 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

16 32 8 4 2 64 -128 CONVERT NEGATIVE BINARY NUMBERS IN TWO'S COMPLEMENT FORMAT AND CONVERT TO DENARY Examples: 10010011 1 1 1 1 1 Step 1: Put the number into the place value column Step 3: Compute the denary value as usual. Step 2: The left-most bit is 1, this means that it is a negative number. (1x -128) + (1x16) + (1x2) + (1x1) = -128 + 16 + 2 + 1 = -109

Convert 10110011 (Two's Complement) to denary DIY

16 32 8 4 2 64 -128 CONVERT NEGATIVE BINARY NUMBERS IN TWO'S COMPLEMENT FORMAT AND CONVERT TO DENARY Examples: 10110011 1 1 1 1 1 1 Step 1: Put the number into the place value column Step 3: Compute the denary value as usual. Step 2: The left-most bit is 1, this means that it is a negative number. (1x -128) (1x32)+ (1x16) + (1x2) + (1x1) = -128 + 32 + 16 + 2 + 1 = -77

CONVERTING NEGATIVE DENARY NUMBERS INTO BINARY NUMBERS IN TWO’S COMPLEMENT 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

Step 4: Add 1 to the binary number. 1 10111101 + 10111100 Step 5: This gives us -67. 16 32 8 4 2 64 -128 1 1 1 1 1 1 1 -128 + 32 + 16 + 8 + 4 + 1 = -67

Convert -65 to 8 bit two's complement binary number DIY

CONVERTING NEGATIVE DENARY NUMBERS INTO BINARY NUMBERS IN TWO’S COMPLEMENT 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

Step 4: Add 1 to the binary number. 1 10111111 + Step 5: This gives us -65. 16 32 8 4 2 64 -128 1 1 1 1 1 1 1 1 -128 + 32 + 16 + 8 + 4 + 2 + 1 = -65 10111110

Summary: Convert negative denary to two's complement Examples: -65 01000001 10111110 65 1 10111111 Convert to (+) Convert to binary Invert the digit +1 Final result

Chapter 1.6

The number of bits used to represent sound amplitude in digital sound recording, as known as bit depth

Measurement of Data Storage and Calculation of file size Chapter 1.7

Measurement of 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

Memory Size System Based on the SI (base 10) system of units where 1 kilo is equal to 1000.

Memory Size System Based on the IEC (base 2) system of units where 1 kilo is equal to 1024 (2^10). As memory size is actually measured in terms of powers of 2...

Memory Size 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

Memory Size System Converting Gib, Mib, Kib into bytes = 68719476736 Bytes 64 x 1024 = = 65536 MiB = 65536 x 1024 = 67108864 KiB = 67108864 x 1024 64 GiB

DIY Convert the size of GTA-V to bytes = 77309411328 Bytes 72 x 1024 = = 73728 MiB = 65536 x 1024 = 75497472 KiB = 75497472 x 1024 72 GiB

Calculation of file size Image Audio

Calculation of 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.

Calculation of file size - Image Formula image resolution (pixels) x colour depths (bits)

Calculation of file size - Image Example 1 00 01 10 11 2px 2px Total pixels = 2 x 2 = 4 Colour depth = 2 Calculation = (2x2) x 2 = 8 bits = 1 byte

Calculation of file size - Image Example 2 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

Calculation of 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

Calculation of 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.

DIY Question: Image Resolution = 2048 x 2048 Colour depth = 16 Calculate the size of this image in Bytes.

DANSWER Question: 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

DIY Question: 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.

DANSWER Question: 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

Calculation of file size - Sound Formula Sample Rate (in Hz) x Sample Resolution (in bits) x length of sample (in seconds)

Calculation of file size - Sound Mono Sound vs Stereo Sound Comparison

Calculation of file size - Sound Example 1 - Mono 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

Calculation of file size - Sound Example 1 - Stereo 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

DIY An 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.

DIY An 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

PAST YEAR QUESTION

ANSWER

DATA COMPRESSION Chapter 1.8

DATA COMPRESSION

DATA COMPRESSION

FILE SIZE OF IMAGES AND SOUND CAN BE VERY LARGE. THEREFORE, DATA COMPRESSION IS NEEDED TO REDUCE THE SIZE OF A FILE. DATA COMPRESSION

WHAT ARE SOME BENEFITS OF REDUCING THE FILE SIZE? DATA COMPRESSION

Benefits of Data Compression SAVE STORAGE SPACE REDUCE STREAMING TIME REDUCE TIME TAKEN TO UPLOAD AND DOWNLOAD MEDIA REDUCE COST

LOSSY FILE COMPRESSION LOSSLESS FILE COMPRESSION DATA COMPRESSION

LOSSY FILE COMPRESSION FILE COMPRESSION ALGORITHM ELIMINATES UNNECESSARY 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

LOSSY FILE COMPRESSION 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

LOSSY FILE COMPRESSION MPEG-4 ALLOWS STORAGE OF MULTIMEDIA FILES RATHER THAN JUST SOUND. SECRET MOVIES CAN BE STREAMED USING THE MP4 FORMAT WITHOUT LOSING ANY REAL DISCERNIBLE QUALITY

LOSSY FILE COMPRESSION JPEG A LOSSY COMPRESSION ALGORITHM USED FOR BITMAP IMAGES. ORIGINAL FILE CAN NO LONGER BE CONSTRUCTED SECRET REMOVE COLOUR SHADES (HUMAN CAN'T NOTICE THEM)

LOSSY FILE COMPRESSION

LOSSY FILE COMPRESSION

DATA COMPRESSION LOSSLESS FILE COMPRESSION ALL THE DATA FROM THE ORIGINAL UNCOMPRESSED 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 COMPRESSION RUN-LENGTH ENCODING 1. CAN BE USED FOR LOSSLESS COMPRESSION OF A NUMBER OF DIFFERENT FILE FORMATS. 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

LOSSLESS FILE COMPRESSION RUN-LENGTH ENCODING IN ACTION 16 bytes

RUN-LENGTH ENCODING IN ACTION Each digit - 1 byte Total size = 8 bytes (50% reduction in size) Does not work well when no repeated data! LOSSLESS FILE COMPRESSION

3,2,5,2,4 2,4,3,4,3 1.6.1.6.2 0, 15,1 TO BE CONTINUE LOSSLESS FILE COMPRESSION

DIY

DIY REDUCE COLOUR DEPTH REDUCE IMAGE RESOLUTION

LOSSY FILE COMPRESSION JPEG A LOSSY COMPRESSION ALGORITHM USED FOR BITMAP IMAGES. ORIGINAL FILE CAN NO LONGER BE CONSTRUCTED SECRET REMOVE COLOUR SHADES (HUMAN CAN'T NOTICE THEM)

PAST YEAR QUESTION

ANSWER

PAST YEAR QUESTION

ANSWER
Tags