Personal Development Planning

Download Report

Transcript Personal Development Planning

Data Types
Level 3 Extended Diploma
Unit 19
Computer Systems Architecture
Previously ….
• We learnt how values can be represented in:
•
•
•
Decimal
Binary
Hexadecimal
• Now we look at how other things can be represented in a
computer
Text
• We need a method of coding the alphabet and other
characters
• This has to be recognised across all computers
• ASCII (American Standard Code for Information
Interchange) is a method of doing this
• Standardises binary codes eg:
•
01000001is uppercase A
ASCII code
Char
Hex
Binary
Char
Hex
Binary
Char
Hex
Binary
Char
Hex
Binary
A
41
01000001
N
4E
01001110
a
61
01100001
n
6E
01101110
B
42
01000010
O
4F
01001111
b
62
01100010
o
6F
01101111
C
43
01000011
P
50
01010000
c
63
01100011
p
70
01110000
D
44
01000100
Q
51
01010001
d
64
01100100
q
71
01110001
E
45
01000101
R
52
01010010
e
65
01100101
r
72
01110010
F
46
01000110
S
53
01010011
f
66
01100110
s
73
01110011
G
47
01000111
T
54
01010100
g
67
01100111
t
74
01110100
H
48
01001000
U
55
01010101
h
68
01101000
u
75
01110101
I
49
01001001
V
56
01010110
I
69
01101001
v
76
01110110
J
4A
01001010
W
57
01010111
j
6A
01101010
w
77
01110111
K
4B
01001011
X
58
01011000
k
6B
01101011
x
78
01111000
L
4C
01001100
Y
59
01011001
l
6C
01101100
y
79
01111001
M
4D
01001101
Z
5A
01011010
m
6D
01101101
z
7A
01111010
Text
• One bit to switch between upper and lower
case
• A = 0100 0001
a = 0110 0001
• No information about font, size, colour (this is
the job of scripting languages – HTML etc, or
word processors)
• Similar values for punctuation etc
Exercise
• Write out your surname in binary and hex
• Decode this message (x20 is a space)
537475666620666F722073747564656E7473
• What are the ASCII codes for ? @ # £ $
Graphics
• 2 ways to represent graphics
• Bitmaps
• Vectors
Bit maps
• Resolution – horizontal x vertical pixels or bits
• 640 x 480, 1280 x 1024 etc
• This example is 5x7, a 0 is black and a 1 is white
0
0
0
1
1
0
1
1
1
1
0
1
1
1
1
0
0
0
1
1
0
1
1
1
1
0
1
1
1
1
0
0
0
1
1
Colour bit maps
• Images made up of coloured pixels
Colour bit maps
• Colour depth – number of colour bits per pixel
• 1 bit – monochrome
0 = white
1 = black
• 8 bit – grey scale – 256 shades
00000000 = black
00001111 = mid grey
11111111= white
Colour
• 24 bit = 8 bits per red/green/blue = 16 million
colours
• Exercise – how many colours in 30 bit Deep
Colour
Vector graphics
• Lines are drawn
• Can be scaled up or
down without loss of
quality
• Allows much smaller
file sizes than
bitmaps
4
0
Y – axis
3
2
1
• What is going to be
drawn (eg line)
• Start point (x1,y1)
• End point (x2,y2)
• Where x and y are coordinates on a grid
5
Vector graphics
0
1
2
3
X – axis
4
5
Draw a square
// set the starting point for the line
graphics.moveTo(10,10);
// move the line through a series of coordinates
graphics.lineTo(10,100);
graphics.lineTo(100,100);
graphics.lineTo(100,10);
graphics.lineTo(10,10);
Exercise
• What applications allow you to create and
edit bitmaps or vector graphics?
• What are the advantages of each method of
drawing images?
• Consider
• File size
• What happens when you scale the image
• Colour reproduction
Sound
• Sound consists of a continuously varying
waveform
• It is an analogue signal
A-D conversion
Amplitude
• An A-D convertor
(analogue to digital)
is used to sample the
waveform for
amplitude at fixed
Sample
intervals
period
• The values are
stored digitally
Sampling rates and bits
• For CD the sampling rate is 44.1kHz
• Higher sampling rates give better quality
• HD-DVD uses 192 kHz
• The bit depth determines the range of
amplitude from loudest to softest
• 16 bits are used for CD quality
• 24 bits professionally
Bit rate
• Bit rate = (sampling rate) x (bit depth) x
(number of channels)
• For a recording with a 44.1 kHz sampling
rate, a 16 bit depth, and 2 channels (stereo):
44100 x 16 x 2 = 1411200 bits per second, or
1.4112 Mbit/s
Compression
• Audio can be compressed to reduce file sizes
• Uncompressed files contain as many bits for
silence as for sound
• Lossless compression replaces the silence with
information about how long the silence lasts. Can
reduce file size by half
• Lossy compression eliminates the less audible
sounds and can reduce files to one tenth of the
original size
File types
• Uncompressed
• WAV, AVI
• Lossless
• FLAC, Apple lossless
• Lossy
• Mp3, mp4, Vorbis, AAC, ATRAC
D-A conversion
• To convert a digital file back to sound
• The bits are fed into a D-A converter
• This produces a voltage with the amplitude
proportional to the value of the 16 bits
• This is played back at the sampling rate