Bit patterns Analogue And Digital Flashcards

(456 cards)

1
Q

AQA Computer Science A-Level

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

4.5.6 Representing images

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

sound and other data

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Intermediate Notes

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

www.pmt.education

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Specification:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

4.5.6.1 Bit patterns

A

images

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe how bit patterns may represent other forms of data

A

including

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

graphics and sound.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

4.5.6.2 Analogue and digital:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Understand the difference between analogue and digital:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

● data

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

● signals

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

4.5.6.3 Analogue/digital conversion:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Describe the principles of operation of:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

● an analogue to digital converter (ADC)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

● a digital to analogue converter (DAC)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Know that ADCs are used with analogue sensors.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Know that the most common use for a DAC is to convert a digital audio

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

signal to an analogue signal.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

4.5.6.4 Bitmapped graphics:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Explain how bitmaps are represented.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Explain the following for bitmaps:
26
● resolution
27
● colour depth
28
● size in pixels
29
Calculate storage requirements for bitmapped images and be aware
30
that bitmap image files may also contain metadata.
31
Be familiar with typical metadata.
32
4.5.6.5 Vector graphics:
33
Explain how vector graphics represents images using lists of objects.
34
Give examples of typical properties of objects.
35
Use vector graphic primitives to create a simple vector graphic.
36
37
www.pmt.education
38
39
4.5.6.6 Vector graphics versus bitmapped graphics:
40
Compare the vector graphics approach with the bitmapped graphics
41
approach and understand the advantages and disadvantages of each.
42
Be aware of appropriate uses of each approach.
43
4.5.6.7 Digital representation of sound:
44
Describe the digital representation of sound in terms of:
45
● sample resolution
46
● sampling rate and the Nyquist theorem
47
Calculate sound sample sizes in bytes.
48
4.5.6.8 Musical Instrument Digital Interface (MIDI):
49
Describe the purpose of MIDI and the use of event messages in MIDI.
50
Describe the advantages of using MIDI files for representing music.
51
4.5.6.9 Data compression:
52
Know why images and sound files are often compressed and that other
53
files
such as text files
54
Understand the difference between lossless and lossy compression and
55
explain the advantages and disadvantages of each.
56
Explain the principles behind the following techniques for lossless
57
compression:
58
● run length encoding (RLE)
59
● dictionary-based methods
60
4.5.6.10 Encryption:
61
Understand what is meant by encryption and be able to define it.
62
Be familiar with Caesar cipher and be able to apply it to encrypt a
63
plaintext message and decrypt a ciphertext. Be able to explain why it is easily
64
cracked.
65
Be familiar with Vernam cipher or one-time pad and be able to apply it
66
to encrypt a plaintext message and decrypt a ciphertext. Explain why Vernam
67
cipher is considered as a cypher with perfect security.
68
Compare Vernam cipher with ciphers that depend on computational
69
security.
70
71
www.pmt.education
72
73
Bit patterns
images
74
So far
we’ve only seen bit patterns used to represent ​numbers​. However
75
use bit patterns to represent ​all other forms of data​
including ​pictures ​and ​sound​.
76
77
Analogue and digital
78
Analogue ​data has ​no limits​ to the values that it can take. In contrast
digital data can only
79
take ​particular values​.
80
Analogue and digital signals vary in a similar way. An analogue signal can take ​any values
81
and can change ​as much as required​ whereas a digital signal must always take​ one of a
82
specified range of values​ and can only change value ​at specified intervals​.
83
84
Analogue signal
85
86
Digital signal
87
88
Analogue/digital conversion
89
Digital to analogue conversion
90
When converting from digital to analogue
a device called a ​digital to analogue converter
91
(or ​DAC ​for short) is used. The device reads a bit pattern representing an analogue signal
92
and outputs an analogue electrical ​current​.
93
Analogue to digital conversion
94
When a computer needs to make use of analogue sensors
they use an ​analogue to digital
95
converter ​(​ADC​ for short) to convert the analogue signal to a digital bit pattern. The device
96
works by taking a ​reading ​of an analogue signal at ​regular intervals​ and recording the
97
value in a process called ​sampling​.
98
Samples are taken at a specific ​frequency​
which determines the ​number of samples taken
99
per second​. This is usually a​ high number​.
100
101
www.pmt.education
102
103
Once the value of the analogue signal has been recorded
it can be stored ​digitally ​as a bit
104
pattern.
105
106
Bitmapped graphics
107
Computers represent ​images ​in two different ways
one of which is by using​ bitmap
108
graphics​. In bitmap graphics
an image is broken down into ​pixels​
109
binary ​value assigned to it.
110
The ​resolution ​of an image refers to the ​number of pixels​ in an image
for example
111
image below could be said to have a resolution of ​5 × 5 ​pixels.
112
The ​value assigned​ to a pixel ​determines the colour ​of the pixel. The example below
113
shows the ​binary representation​ of a simple bitmap image in which a 1 represents a black
114
pixel and a 0 represents a white pixel.
115
116
1 0 0 0 1
117
1 1 0 1 1
118
1 0 1 0 1
119
1 0 0 0 1
120
1 0 0 0 1
121
The ​number of bits​ assigned to a pixel in an image is called its ​colour depth​. In the
122
example above
each pixel has been assigned ​one bit​
123
represented.
124
125
www.pmt.education
126
127
00 11 11 11 11 11 00
128
11 11 11 11 11 11 11
129
11 00 01 11 00 01 11
130
11 00 00 11 00 00 11
131
11 11 11 11 11 11 11
132
11 11 10 10 10 11 11
133
00 11 11 11 11 11 00
134
135
In order to calculate the ​storage required​ to represent a bitmap image
multiply the ​number
136
of pixels​ (width × height) by the​ bit depth​.
137
The picture of the face has 7 × 7 = 49 pixels
each of which is assigned ​two bits​
138
requires​ 98 bits ​to be represented.
139
140
7 × 7 × 2 = 98 bits
141
This method of calculating the storage requirements for bitmapped images produces a
142
minimum value​. This is because bitmap image files may also contain ​metadata​
typical
143
examples of which include the image’s ​width​
​height​
144
145
www.pmt.education
146
147
Vector graphics
148
Vector graphics represent images using ​objects ​and ​shapes ​such as rectangles
circles
149
and lines. The ​properties ​(such as fill colour
fill style and dimensions) of each geometric
150
object or shape in the image are stored in a ​list​.
151
152
shape
153
154
properties
155
156
rectangle
157
158
fill-colour: green
159
fill-style: solid
160
height: 2
161
width: 10
162
start-position: (0
0)
163
164
square
165
166
fill-colour: yellow
167
fill-style: vignette
168
width: 6
169
start-position: (4
2)
170
171
triangle
172
173
fill-colour: grey
174
fill-style: solid
175
width: 7
176
start-position: (3
8)
177
178
Vector graphics versus bitmapped graphics
179
Because vector graphics use shapes rather than pixels
they can be enlarged ​without
180
losing quality​. Enlarging a bitmap image results in a ​blurry ​or even ​pixelated ​image
181
whereas enlarging a vector graphic results in ​no loss of clarity​.
182
Vector graphics frequently use ​less storage space ​than bitmapped graphics
as
183
information is stored for each shape
rather than for every single pixel in an image.
184
185
www.pmt.education
186
187
Digital representation of sound
188
Computers represent sound as a ​sequence of samples​
each of which takes a ​digital
189
value​. The number of samples per second is called the ​sampling rate​.
190
191
Analogue signal sampled
192
193
Samples used to recreate signal
194
digitally
195
196
The​ number of bits​ allocated to each sample is referred to as the ​sample resolution​.
197
Higher sample resolutions result in ​greater audio quality​ but also​ increased file size​.
198
The size of a sound sample can be calculated by ​multiplying together​ the ​duration of the
199
sample in seconds​
the ​sampling rate in Hertz​ and the ​sample resolution​.
200
For example
a ​45 second long​ audio file sampled at ​500 Hz​ with a sample resolution of ​16
201
bits​ would require ​45000 bytes ​of storage.
202
203
45 × 500 × 16 = 360000 bits
204
360000 ÷ 8 = 45000 bytes
205
The Nyquist Theorem
206
The Nyquist theorem states that the sampling rate of a digital audio file must be ​at least
207
twice​ the frequency of the sound. If the sampling rate is below this
the sound may not be
208
accurately represented.
209
210
www.pmt.education
211
212
Musical Instrument Digital Interface (MIDI)
213
Musical instrument digital interface
or ​MIDI​
214
which can be ​connected to computers​. MIDI stores sound as a series of​ event messages​
215
each of which represents an ​event​ in a piece of music. These can be thought of as a
216
series of instructions ​which could be used to recreate a piece of music.
217
Event messages could contain information such as:
218
● The ​duration ​of a note
219
● The ​instrument ​with which a note is played
220
● How ​loud ​a note is (its ​volume​)
221
There are numerous advantages to using MIDI over a sampled recording of a piece of
222
music. Using MIDI allows ​easy manipulation​ of music ​without loss of quality​. The
223
instruments on which notes sound can be changed
notes can be ​changed ​and the
224
duration of notes can be altered.
225
Furthermore
MIDI files are often ​smaller in size​ than sampled audio files.
226
However
MIDI ​can't be used for storing speech​ and sometimes results in a​ less realistic
227
sound ​than sampled recordings.
228
229
Data compression
230
FIles are compressed in order to​ reduce their size​. Smaller files can be​ transferred faster
231
between storage devices.
232
Images are often compressed
but sound files and text files can also be compressed.
233
There are two categories of compression
​lossy ​and ​lossless​.
234
235
Lossy compression
236
When using lossy compression
​some information is lost​ in the process of reducing the
237
file’s size. This could be​ reducing the resolution​ of an image or​ lowering the sample
238
resolution ​of an audio file.
239
240
www.pmt.education
241
242
Lossless compression
243
In contrast to lossy compression
there is​ no loss of information ​when using lossless
244
compression. The size of a file can be reduced ​without decreasing its quality​.
245
Two methods of lossless compression are​ run length encoding ​and ​dictionary-based
246
methods​.
247
Run length encoding (RLE)
248
Run length encoding (​RLE​ for short) ​reduces the size​ of a file by removing ​repeated
249
information​ and replacing it with ​one occurance ​of the repeated information followed by the
250
number of times​ it is to be repeated.
251
252
BLUE​
253
5
254
BLUE​
255
2​ PURPLE​
256
3
257
BLUE​
258
2​ YELLOW​
259
3
260
BLUE​
261
2​ PURPLE​
262
3
263
BLUE​
264
2​ YELLOW​
265
3
266
267
Using RLE to​ replace repeated pixels​ with one pixel colour and a ​number or repetitions
268
reduces the storage space required to represent the image.
269
270
www.pmt.education
271
272
Dictionary-based methods
273
When a file is compressed with a dictionary-based method
a ​dictionary ​containing
274
repeated data​ is ​appended ​to the file.
275
For the picture above
the dictionary on the left could be used.
276
277
= 1
278
279
1
280
2
281
282
= 2
283
284
3
285
2
286
287
= 3
288
289
3
290
291
Using the dictionary
the file could be represented using just the data ​12323​
292
as shown on
293
the right.
294
This method results is a ​significant reduction​ in size
but don’t forget that the dictionary
295
used to compress the data ​has to be present in the file ​in order for the image to be
296
reproduced. This will​ increase the size​ of the file.
297
Lossy Compression
298
299
Lossless Compression
300
301
Some information is lost ​in the
302
compression process
303
304
No loss​ of information
305
306
Quality of file is​ reduced
307
308
No loss​ of quality
309
310
Encryption
311
Encryption is the process of ​scrambling data​ so that it ​cannot be understood if intercepted
312
in order to ​keep it secure during transmission​. Unencrypted information is referred to as
313
plaintext ​and encrypted information is called ​ciphertext​. A ​cipher ​is a type of encryption
314
method.
315
In order to decrypt ciphertext
you must know the ​encryption method ​used and the ​key
316
used to encrypt the information.
317
318
www.pmt.education
319
320
Caesar ciphers
321
Caesar ciphers encrypt information by ​replacing characters​. One character is ​always
322
replaced by the ​same character​. There are two types of Caesar cipher that you need to be
323
aware of. ​Shift ciphers ​and ​substitution ciphers​.
324
Shift ciphers
325
When encrypting using a shift cipher
all of the letters in the alphabet are ​shifted by the
326
same amount​. The amount by which characters are shifted forms the key.
327
Plaintext
328
329
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
330
331
X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
332
Ciphertext
333
334
The example above uses a ​shift​ of three characters
so the key is ​three​. Using the key
335
three
the plaintext “​BAT​
336
” could be encrypted as the ciphertext “​YXQ​
337
”.
338
Substitution ciphers
339
Substitution ciphers are a type of Caesar cipher in which letters are ​randomly replaced​.
340
Plaintext
341
342
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
343
F J E D M K B I C H L S A T U R V W G Y Q N P Z X O
344
Ciphertext
345
346
Using the cipher in the example
the plaintext “​DOG​
347
” would be encrypted as “​DUB​
348
”.
349
Caesar ciphers can be​ easily cracked​. For example
the most frequently occurring letter in
350
an encrypted message is likely to be an ​E​
351
.
352
353
www.pmt.education
354
355
Vernam ciphers
356
The Vernam cipher is an example of a one-time pad cipher. This means that ​each key
357
should only ever be used once​. Additionally
the Vernam cipher requires the key to be
358
random ​and ​at least as long as the plaintext​ that is to be encrypted.
359
The Vernam cipher works by:
360
1. Aligning ​the characters of the ​plaintext ​and the ​key
361
2. Converting each character to ​binary ​(using an
362
information coding system​)
363
3. Applying a logical ​XOR ​operation to the two bit
364
patterns
365
4. Converting the result back to a character
366
Example
encrypting:
367
368
H
369
370
I
371
372
1001000
373
374
1001001
375
376
u
377
378
r
379
380
Key binary
381
382
1110101
383
384
1110010
385
386
Plaintext binary
387
XOR key binary
388
389
111101
390
391
111011
392
393
=
394
395
;
396
397
Plaintext
398
Plaintext binary
399
Key
400
401
Ciphertext
402
403
In the example above
each of the characters in the plaintext and the key are converted to
404
binary
then XORed before being converted back to characters.
405
As the example shows
the plaintext ​HI​is encrypted by a Vernam cipher with the key ​ur
406
as the ciphertext ​=;​
407
.
408
409
www.pmt.education
410
411
Example
decrypting:
412
When decrypting using a Vernam cipher
the key that was used to encrypt the plaintext is
413
used again.
414
415
=
416
417
;
418
419
111101
420
421
111011
422
423
u
424
425
r
426
427
Key binary
428
429
1110101
430
431
1110010
432
433
Ciphertext binary
434
XOR key binary
435
436
1001000
437
438
1001001
439
440
H
441
442
I
443
444
Ciphertext
445
Ciphertext binary
446
Key
447
448
Plaintext
449
450
The Vernam cipher is the only cipher mathematically proven to be completely secure.
451
Computational security
452
All ciphers other than the Vernam cipher are
in theory
453
reasonable timeframe given current computing power. Ciphers that use this form of
454
security are said to rely on ​computational security​.
455
456
www.pmt.education