Standard Grade Computing Studies Commercial Data Processing

Download Report

Transcript Standard Grade Computing Studies Commercial Data Processing

Higher Computing
Computer Systems
1
Higher Computing
Computer Systems
J L Martin
Topics
•
•
•
•
•
Data Representation (6 Hours)
Computer Structure (7 Hours)
Peripherals (5 hours)
Networking (9 Hours)
Computer Software (9 hours)
• Also – Multimedia Vector Graphics &
Synthesised Sound (6 hours)
2
Higher Computing
Computer Systems
J L Martin
Assessment
• 1 written NAB (? 4/2/2010)
• 1 practical NAB (? 17-25/3/2010)
• Coursework (? 17-25/2/2010)
3
Higher Computing
Computer Systems
J L Martin
Homework
•
•
•
•
4
Weekly consolidation questions/tasks
1 week to complete substantial HWs
Glossary of definitions
Mindmaps
Higher Computing
Computer Systems
J L Martin
Resources
•
•
•
•
•
•
5
Course booklets
PowerPoints will be put on network
Practice NABs (online)
Blank glossary
Learning Intentions
Mindmap software
Higher Computing
Computer Systems
J L Martin
Expectations
• Consistent application throughout is
essential
• Course will be fast paced
• Written answers require depth, detail
and maturity
6
Higher Computing
Computer Systems
J L Martin
Course Files
P:/ Drive
5&6 Year Progs
Computing Department
Higher Computing
Computer Systems
7
Higher Computing
Computer Systems
J L Martin
Data Representation – Technical
terms
6 hours
8
Higher Computing
Computer Systems
J L Martin
Units of Measurement
• Decimal number system
– 0-9
– Powers of 10
1000s
100s
10s
Units
103
102
101
100
1
2
8
1
5
9
2
Higher Computing
Computer Systems
J L Martin
Units of Measurement
• Binary number system
– 0, 1
10
21
2
29
512
22
4
210
1024
23
8
211
2048
24
16
212
4096
25
32
213
8192
26
64
214
16384
27
128
215
32768
28
256
216
65536
Higher Computing
Computer Systems
J L Martin
Scales
Units
Kilo
Mega
Giga
Tera
11
1
1000
1024
210
1024x1024
220
(billion)
1024x1024x10
24
230
1,000,000,000,000
1024x1024x
(trillion)
1024x1024
(thousand)
1,000,000
(million)
1,000,000,000
240
Higher Computing
Computer Systems
J L Martin
Converting between Units
•
•
•
•
•
8 bits in a byte
1024 bytes in a Kb
1024 Kb in a Mb
1024 Mb in a Gb
1024 Gb in a Tb
1. Convert 553,476 bits into Kb
2. How many bytes in 91 Mb?
12
Higher Computing
Computer Systems
J L Martin
Answers
• 553,476 bits /8
69,184.5 bytes /1024
67.56 Kb (rounded to 2 decimal
places)
• 91 Mb * 1024
93,184 Kb * 1024
95,420,416 Bytes
13
Higher Computing
Computer Systems
J L Martin
Processor
• Clock speed is measured in GigaHertz
(GHz)
• Hertz = 1 cycle (pulse) per second
• E.g. 2 GHz = approx 2 billion clock
beats per second
14
Higher Computing
Computer Systems
J L Martin
Word
• The word size of a computer is the
number of bits which can be moved
and processed in a single operation
• As a rule, it also tends to be the size
of the data bus (more later)
• e.g. 16-bit, 32-bit (Nintendo 64!)
15
Higher Computing
Computer Systems
J L Martin
Memory
• Measured in Mb or Gb
• E.g. 512Mb upwards
16
Higher Computing
Computer Systems
J L Martin
Backing Storage
• Measured in Gb – e.g. 80Gb hard disk
• Floppy Disk (almost obsolete) –
1.44Mb
• Etc
• File sizes – depends on data type
– Word processed document – Kb
– Graphic file (uncompressed) – Mb
– Video file - Gb
17
Higher Computing
Computer Systems
J L Martin
Resolution
• Printers measured in dots per inch
(dpi)
– E.g. Laser printer 2400dpi
– Ink jet 750 dpi
• Monitors measured in pixels
– E.g. 1024 x 768 pixels
18
Higher Computing
Computer Systems
J L Martin
Data Representation
• Computers store and process binary
numbers
• Binary uses two digits 1, 0
• These can be represented by
– Electricity on or off
– Land or pit (on optical disk)
• This is why a computer is called a
two-state machine
19
Higher Computing
Computer Systems
J L Martin
Counting in Binary
• Learn these place values!
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
0
1
1
0
1
0
1
• = 128+32+16+4+1 = 181
20
Higher Computing
Computer Systems
J L Martin
Why do we use binary?

• simplicity, in only having to generate
and detect two voltage levels (on/off)
• good tolerance, because a degraded 1
is still recognisable as a 1.
• calculations are kept simple as the
only combinations are 0+0, 0+1, 1+0
and 1+1
21
Higher Computing
Computer Systems
J L Martin
Why do we use binary?

• Numbers are long
• Difficult to read, write and recognise
• Value is “hidden” from humans
22
Higher Computing
Computer Systems
J L Martin
Why NOT use decimal?
•
•
•
•
•
23
Decimal is familiar to humans but…
There are too many symbols 0-9
Too many rules for +,-,* and /
Would require 10 voltage levels
Would require a circuit for every
combination of two digits e.g. 2+3,
6+7 etc
Higher Computing
Computer Systems
J L Martin
Bits and Values
• The number of bits determines the
number of values which can be
represented
24
Higher Computing
Computer Systems
J L Martin
Bits and Values
# of bits
(n)
Number of values
(Zero to 2n-1)
(2n)
1
0, 1
0-1
2
2
00,01,10,11
0-3
4
4
0000-1111
0-15
16
8
0000000011111111
0-255
256
16
Two bytes
0-65535
65536 (64k)
24
Three bytes
0-16,777,215
16,777,216 (16 Mb)
32
25
i.e.
Range
Four bytes
0-4,294.967,295
4,294,967,296
(4 Gb)
Higher
Computing
Computer Systems
J L Martin
Data Types
• Computers need to represent
different types of data:–
–
–
–
–
26
Text
Numbers (integers and real)
Graphics
Sound
etc
Higher Computing
Computer Systems
J L Martin
Text
• ASCII standard
• American Standard Code for
Information Interchange
• All computers use the same codes to
represent the same characters
• Allows computers to communicate
27
Higher Computing
Computer Systems
J L Martin
ASCII
• Each character is stored in 1 byte
• Only 7 bits are used (with leading
zero)
• 7 bits = 128 characters (27)
• E.g.
– A is 01000001 or 65
– 0 is 00110000 or 48
28
Higher Computing
Computer Systems
J L Martin
Control Characters
• First 32 characters in the ASCII
character set
• Non-printing characters
• Perform some function instead
• E.g. audible beep, arrow keys
• NOT Enter, tab, space-bar
29
Higher Computing
Computer Systems
J L Martin
ANSI
• American National Standards
Institute
• Uses 8 bits to represent 256
characters
• First 128 same as ASCII
• Then additional characters such as ©,
â, ç and Ä
30
Higher Computing
Computer Systems
J L Martin
Unicode
• Uses 16 bits
• Can store up to 65,536 characters
• Enables characters from every
language to be stored
• E.g. Japanese and Chinese characters
31
Higher Computing
Computer Systems
J L Martin
Lesson 2
Binary – Decimal Conversion
32
Higher Computing
Computer Systems
J L Martin
Homework
• Homework questions – Data
Representation 1
• For 17/6/09
33
Higher Computing
Computer Systems
J L Martin
Data Representation - Numbers
Decimal umbers are converted into binary
in order to be stored.
34
Higher Computing
Computer Systems
J L Martin
Converting binary to decimal
Here is an example of how to convert the
binary number 10011010 to a decimal:
128
1
64
0
32
0
16
1
8
1
4
0
2
1
1
0
= 128 + 16 + 8 + 2 = 154.
35
Higher Computing
Computer Systems
J L Martin
Binary to Decimal – 3 steps
1)Draw an appropriately sized table
with place values (8,16,24,32)
2)Fill the binary number from right to
left
3)Add together the place values which
have 1s
36
Higher Computing
Computer Systems
J L Martin
Task
Convert the following binary numbers to
decimal
(a) 111101010010
(b) 11011001010101
(c) 1011001011010100
(d) 10010101
(e) 1000001101001111
37
Higher Computing
Computer Systems
J L Martin
Task
Convert the following binary numbers to
decimal
(a) 111101010010 - 3922
(b) 11011001010101 - 13909
(c) 1011001011010100 - 45780
(d) 10010101 - 149
(e) 1000001101001111 - 33615
38
Higher Computing
Computer Systems
J L Martin
Converting decimal to binary – division
method
Here is an example
of how to convert
the decimal number
69 to a binary:
39
2
2
2
2
2
2
2
2
69
34
17
8
4
2
1
0
R1
R0
R1
R0
R0
R0
R1
giving
1000101
Higher Computing
Computer Systems
J L Martin
Decimal to binary – 2 steps
• Divide decimal number by 2 until
result is zero
• Starting at the bottom, list the
remainders
40
Higher Computing
Computer Systems
J L Martin
Task
• Convert the following decimal
numbers to binary using the division
method
–
–
–
–
41
41
125
96
37
Higher Computing
Computer Systems
J L Martin
Answers
2 41
2 125
2 96
2 37
2 20
R1
2 62
R1
2 48
R0
2 18
R1
2 10
R0
2 31
R0
2 24
R0
2 9
R0
2 5
R0
2 15
R1
2 12
R0
2 4
R1
2 2
R1
2 7
R1
2 6
R0
2 2
R0
2 1
R0
2 3
R1
2 3
R0
2 1
R0
2 0
R1
2 1
R1
2 1
R1
2 0
R1
2 0
R1
2 0
R1
41 = 101001
125 =
1111101
42
96 =
1100000
37 = 100101
Higher Computing
Computer Systems
J L Martin
Decimal to binary – table method – 5
steps
1)Create table with place values (most
significant place should be higher
than decimal numebr)
2)Insert a 1 in the highest place which
is less than decimal number
3)Subtract place value from number
4)Repeat until zero
5)Fill blank columns with zeros
43
Higher Computing
Computer Systems
J L Martin
Table Method
• 41, 125, 96, 37
41-32=9
9-8=1
1-1=0
125-64=61
61-32=29
29-16=13
13-8= 5
5-4=1
1-1=0
44
128
64
32
16
8
4
2
1
1
0
1
0
0
1
1
1
1
1
1
0
1
1
1
0
0
0
0
0
1
0
0
1
0
1
96-64=32
32-32=0
37-32=5
5-4=1
1-1=0
Higher Computing
Computer Systems
J L Martin
Task
• Convert the following numbers to
binary using the table method
–
–
–
–
45
28
53
101
84
Higher Computing
Computer Systems
J L Martin
Answers
•
•
•
•
46
28 - 11100
53 - 110101
101 - 1100101
84 - 1010100
Higher Computing
Computer Systems
J L Martin
Note!
• Question - How do you know if a
number is binary or decimal (e.g. 101)
• Answer – you will be told in the
question.
47
Higher Computing
Computer Systems
J L Martin
Convert the following decimal numbers
to binary using the division method
•
•
•
•
48
41
125
96
37
Higher Computing
Computer Systems
J L Martin
Task 1
Work out the following
Number of bits (n)
Range of numbers
Number of values
Show all working!
49
Higher Computing
Computer Systems
J L Martin
Task 2
• Answer Qs 1-8 from booklet (in
jotter or in a word document at
computer)
• Glossary
• http://web.cs.mun.ca/~michael/c/asci
i-table.html
50
Higher Computing
Computer Systems
J L Martin
Lesson 3
Binary Arithmetic
&
Negative Whole Numbers
51
Higher Computing
Computer Systems
J L Martin
Basic Binary Arithmetic
0
0
_
0
0
1
_
1
1
0
_
1
1
1
__
10
11
10
___
101
11
11
1
___
110
Try these sums:a) 10+110
b) 110 + 1101
c) 1011 + 1111
52
Higher Computing
Computer Systems
J L Martin
Binary Arithmetic - Answers
1 0
1 1 0
1 0 0 0
53
1 1 0
1 0 1 1
1 0 0 0 1
1 0 1 1
1 1 1 1
1 1 0 1 0
Higher Computing
Computer Systems
J L Martin
Negative Integers
• Positive numbers are straightforward
• Difficulty arises when we need to
store negative numbers!
• There are several methods.
54
Higher Computing
Computer Systems
J L Martin
Negative Numbers – Sign and
Magnitude
• Simple! Use the most significant bit
to store the sign
• 1 is –ve
• 0 is +ve
Sign
bit
55
64 32 16
8
4
2
1
0
0
0
0
1
0
0
1
9
1
0
0
0
1
0
0
1
-9
Higher Computing
Computer Systems
J L Martin
Task
• Create a table using signed-bit (4
bits) which shows the range of
numbers from -7 to +7
• E.g.
-7
values in between
56
{
…
…
7
…
…
Higher Computing
Computer Systems
J L Martin
Signed bit - Answer
• A problem arises at zero
• This system creates a
“negative zero” i.e. 1000
• It also causes errors in
arithmetic
57
-7
1111
-6
1110
-5
1101
-4
1100
-3
1011
-2
1010
-1
1001
?
1000
0
0000
1
0001
2
0010
3
0011
4
0100
5
0101
6
0110
7
0111
Higher Computing
Computer Systems
J L Martin
Sign & Magnitude – Errors in
Arithmetic
• In decimal, if you add (+3)+(-3), you get zero
• Try this in signed-bit
0011
1011
____
1110
• Verdict – unsuitable
• Back to the drawing board!
58
Higher Computing
Computer Systems
J L Martin
Twos Complement
Rule – “Flip the bits and add 1”
(remember basic arithmetic)
Decimal
Binary
3
00000011
Now test…
Ignore
59
1
Flip the
bits
11111100
0 0 0 0 0 0 1 1
1 1 1 1 1 1 0 1
0 0 0 0 0 0 0 0
Add 1
11111101
Higher Computing
Computer Systems
J L Martin
Twos Complement
Decimal
Binary
20
00010100
Ignore
60
1
Flip the
bits
11101011
0 0 0 1 0 1 0 0
1 1 1 0 1 1 0 0
0 0 0 0 0 0 0 0
Add 1
11101100
Higher Computing
Computer Systems
J L Martin
Reverse the process
• Twos complement number 1110 1100
• We know it’s negative because the
most significant bit is a 1
• To change to positive – flip the bits
and add 1
• 0001 0011 + 1 = 0001 0100 which is 20
• Therefore 1110 1100 is -20
61
Higher Computing
Computer Systems
J L Martin
Range of values for Twos Complement
• Most significant bit is reserved for
the sign-bit
• Range is therefore –2(n-1) - 2(n-1)-1
• E.g. 8 bits
– -27 to 27-1
– -128 to +127
– 1000 0000 to 0111 1111
62
Higher Computing
Computer Systems
J L Martin
Example continued
0111 1111
=+ 127
128 64
0
1
32
1
16
1
8
1
4
1
2
1
1
1
128 64
1
0
32
0
16
0
8
0
4
0
2
0
1
0
1000 0000
-128
63
Higher Computing
Computer Systems
J L Martin
Summary
• Twos complement representation is
used to store both positive and
negative numbers.
• The leftmost bit is used to store
whether a number is positive or
negative.
•The rule is “Flip the bits and add 1”
64
Binary
Integer
11111101
-3
11111110
-2
11111111
-1
00000000
0
00000001
1
00000010
2
00000011
3
Higher Computing
Computer Systems
J L Martin
Summary
•The number of integers which could be stored in one byte (
8 bits ) is 28 = 256
•The range of integers which could be stored in one byte ( 8
bits ) is -128 to +127
65
Higher Computing
Computer Systems
J L Martin
Advantages of Two’s Complement
• There is only one zero
• Changing from positive-negative and
negative-positive follows the same rule
• Arithmetic is correct
• Note : 1000 000 could be -128 usng two’s
complement or 128 NOT using two’s
complement. Interpret the system from
the question or state your assumption!
66
Higher Computing
Computer Systems
J L Martin
Task
c) Convert the following decimal
numbers to binary using 2’s
complement
i) -15 ii) -20 iii) -32 iv) -63
d) Using 2’s complement solve :i) (-6) + (-8) ii) (-11) + (-21)
67
Higher Computing
Computer Systems
J L Martin
Answers – c)
i)
ii)
iii)
iv)
68
1111 0001
1110 1100
1110 0000
1100 0001
Higher Computing
Computer Systems
J L Martin
Answers d)
d) i)
-6 =
-6
-8
-14
ii) -11 =
-11
-21
-32
69
0000 0110
1111 1001
+1
1111 1010
1111 1000
1111 0010
-8 = 0000 1000
1111 0111
+1
1111 1000
0000 1011
1111 0100
+1
1111 0101
1110 1011
1110 0000
-21 =
0001 0101
1110 1010
+1
1110 1011
Higher Computing
Computer Systems
J L Martin
Lesson 4
Binary Real Numbers and
Fractions
70
Higher Computing
Computer Systems
J L Martin
Useful Fractional Values to remember
71
1/2
0.5
1/4
0.25
1/8
0.125
1/16
0.0625
Higher Computing
Computer Systems
J L Martin
Binary Fractions
• A real number is a decimal number like
12345.6789.
• Binary real numbers are converted to
binary fractions
• Place values to the right are ½, ¼, 1/8,
1/16 etc
8
72
4
2
1
.
1/2 1/4 1/8
Higher Computing
Computer Systems
J L Martin
So…
8
4
3.5
2
1
.
1/2 1/4 1/8
1
1
.
1
12.75
1
1
0
0
.
1
1
9.25
1
0
0
1
.
0
1
• Real numbers are not always stored exactly as not
every fraction can be made up exactly of 1/2 s,
1/4 s, 1/8 s etc. e.g. 1/3 or 1/5.
• This leads to round-off error and this can become
larger when calculations are made with these
inexact values.
73
Higher Computing
Computer Systems
J L Martin
Real Numbers
• Real numbers are stored in a
computer as floating point numbers.
• Used to store very large or very
small numbers on computer
• Similar to standard form in
Maths/Science
74
Higher Computing
Computer Systems
J L Martin
Standard Form Example
• E.g. In decimal base 10, 1234.56
becomes 1.23456 * 103
(the decimal place has been ‘floated’ 3
places to the left)
• The ‘1.23456’ is called the mantissa.
• The ‘3’ is called the exponent.
• Between 1-10
75
Higher Computing
Computer Systems
J L Martin
Note
There are three values involved:mantissa x base exponent
76
Higher Computing
Computer Systems
J L Martin
Storing Large Numbers on Computer
•The computer stores all data in binary. A disadvantage of using
binary is that storing large numbers takes up a lot of memory
space.
•e.g. Let us consider the largest number which we could store in
12 bits:2048
1024
512
256
128
64
32
16
8
4
2
1
1
1
1
1
1
1
1
1
1
1
1
1
•= 4095
•This is a large amount of storage for a relatively small number!
77
Higher Computing
Computer Systems
J L Martin
How the point floats…
59
1
110
101
000
100
011
001
010
111011 x 2
78
Higher Computing
Computer Systems
J L Martin
How the point floats…
14.75
1
000
100
011
001
010
111011 x 2
79
Higher Computing
Computer Systems
J L Martin
The Point can float in either direction
0.0625
1
000
-011
-001
-010
00001x 2
80
Higher Computing
Computer Systems
J L Martin
Summary
Binary is base 2.
Example
decimal number 25 = binary 11001
11001 becomes .11001 x 2101
The decimal point has been ‘floated’ 5 places to the left. Decimal 5 = binary
101
Binary numbers will always use base 2 so we need only store the mantissa
(11001) and the exponent (101)
Now think back to our 12-bit storage space. Supposing we used 8 bits to
store the mantissa and 4 bits to store the exponent. What is the largest
number which we can now store?
81
Higher Computing
Computer Systems
J L Martin
12 bits revisited
128
64
32
16
8
4
2
1
8
4
2
1
1
1
1
1
1
1
1
1
1
1
1
1
Mantissa
Exponent
•
The largest mantissa which can be stored is 11111111 = 255
•
The largest exponent which can be stored is 1111 = 15
•
So we can store .11111111 x 21111
•
Which equals 111111110000000 (float the decimal place 15 places
to the right)
•
Which equals decimal 32640!
82
Higher Computing
Computer Systems
J L Martin
MARE
1.
2.•
•
3.
•
Increasing the size of the storage for
numeric data increases the range of
numbers that can be stored.
Increasing the size of the mantissa
increases the accuracy with which the
real number can be stored because it
allows more digits to be stored.
The range of numbers can be increased
by increasing the size of the exponent.
4. MARE
83
Higher Computing
Computer Systems
J L Martin
Two’s complement Floating Point
• Works the same way as two’s
complement – most significant bit is
used to store the sign bit.
• (Don’t get tied up with this!)
84
Higher Computing
Computer Systems
J L Martin
Range or Accuracy?
• Program designers may have to decide
between accuracy and range
• Accuracy may be favoured in Science,
range may be favoured in Astronomy
• A very common storage allocation is
to use four bytes for the mantissa
and one byte for the exponent
85
Higher Computing
Computer Systems
J L Martin
Other number systems
86
Higher Computing
Computer Systems
J L Martin
Think
• How might a base 16 number system
work?
87
Higher Computing
Computer Systems
J L Martin
Hexadecimal
0123456789ABCDEF
88
Dec
Bin
Hex
0
0000
0x
9
1001
9x
10
1010
Ax
15
1111
Fx
127
0111 1111
7Fx
Higher Computing
Computer Systems
J L Martin
Task
e)Display the following numbers using
floating point notation :i) 1010.110
ii) 010111.01
iii) 100011.1010
e) Display the following numbers using
floating point representation
i) 11010.101
ii) 1011.01
iii) 0111011.101
89
Higher Computing
Computer Systems
J L Martin
Tasks
• Read section on floating point and
then answer questions 9-12 on page
10 of booklet
90
Higher Computing
Computer Systems
J L Martin
Graphics
Bit-Map Graphics
91
Higher Computing
Computer Systems
J L Martin
Bit-Mapped Graphics
• For a graphic drawn in a painting package,
the computer stores it as a twodimensional array of pixels
• The number of pixels that makes up an
image is called the resolution.
92
Higher Computing
Computer Systems
J L Martin
Black and White Graphics
• In a black and white display, each
white pixel is represented by a 0.
• In a black and white display, each
black pixel is represented by a 1.
• Only two values, 1 and 0, need to
be stored as there are only two
colours to be used.
93
Higher Computing
Computer Systems
J L Martin
Colour Graphics
• However, when more than two colours are used we need
more memory to store the colour value for each pixel.
• In an 8 colour display, each white
pixel is represented by a 000.
• In an 8 colour display, each black
pixel is represented by a 001.
• In an 8 colour display, each
yellow pixel is represented by a
011.
94
Higher Computing
Computer Systems
J L Martin
Bit Depth
• The number of bits
used to represent the
colour of the pixels is
called the bit depth.
95
Bit depth
1
2
3
Colours
2
4
8
8
256
16
65536
24
16777216
Higher Computing
Computer Systems
J L Martin
Bit mapped Storage Requirements
An image, 5in by 7in is stored at 600 dpi in 65536 colours.
How much memory would be required to store this image?
Pixels used to store image = 5 x 7 x 600 x 600 = 12600000
65536 colours = 16 bits = 2 bytes
Amount of memory = 12600000 x 2 bytes
= 25200000 bytes
= 24Mb
96
Higher Computing
Computer Systems
J L Martin
File sizes
Things which affect the size of a bitmapped graphic are:1. Number of colours (bit or colour
depth)
2. Number of pixels (resolution)
97
Higher Computing
Computer Systems
J L Martin
Advantages & Disadvantages of Bit
Mapped Graphics
• The advantage of using bit mapped graphics is that you
have more control over the graphic as you are able to go into
detail and edit the graphic pixel by pixel.
• The disadvantage of using bit mapped graphics is that each
picture or graphic takes up a lot of memory as the colour of
each pixel has to be stored.
• Another disadvantage of using bit mapped graphics is that if
you enlarge a bitmap image it becomes ‘blocky’.
98
Higher Computing
Computer Systems
J L Martin
Bitmap file extensions
BMP
JPG
GIF
TIFF
99
Higher Computing
Computer Systems
J L Martin
Vector Graphics
100
Higher Computing
Computer Systems
J L Martin
Vector Graphics
• In a CAD or drawing package, the computer stores
information about an object by its attributes i.e. a
description of how it is to be drawn.
• For a rectangle it might be:
• start x and y position
• length, breadth and angle of
rotation
• thickness and colour of the lines
• colour fill etc.
101
Higher Computing
Computer Systems
J L Martin
Advantages of Vector Graphics
• The advantage of using vector graphics is that you edit
shapes.
•This allows you to scale the graphic easily.
•Vector graphics are resolution independent
•It also means that vector graphics don’t take up a lot of
memory.
102
Higher Computing
Computer Systems
J L Martin
Advantages of Vector Graphics
• The disadvantage of using vector graphics is that you are
limited to using only the shapes that the package offers. This
can mean that only simple graphics can be created.
•Vector graphics can also be slow to load or update as all the
objects need to be recalculated and drawn from the attributes on
file.
103
Higher Computing
Computer Systems
J L Martin
Task
• Read notes on bit-maps & vector
graphics and answer Qs 13 & 14 on
Page 10 of booklet
• Binary test tomorrow – excl graphics.
Bring a calculator.
104
Higher Computing
Computer Systems
J L Martin
Object Oriented Data
105
Higher Computing
Computer Systems
J L Martin
Synthesised Sound
106
Higher Computing
Computer Systems
J L Martin
Synthesised Sound Data (MIDI)
• standard file type for musical files
• an object orientated method of storing and
reproducing sound
• sounds are generated by using short recordings
of the real instruments (samples).
• these samples are stored in memory of the
sound card (called a wave-table).
• stored digitally but can be converted into text
allowing it to be edited by a text editor
• MIDI files contains a maximum of 16 channels,
with each channel playing a different
instrument.
107
Higher Computing
Computer Systems
J L Martin
MIDI – Input hardware and Software
• MIDI editing software (e.g. Anvil) +
computer with WIMP interface
• Computer + MIDI instrument
(keyboard/guitar/drum/wind controller)
108
Higher Computing
Computer Systems
J L Martin
MIDI Software
•
•
•
•
•
•
Cakewalk
Magix
Anvil
Studio Instruments
Cubase
MidiSoft Studio
109
Higher Computing
Computer Systems
J L Martin
Features of MIDI Sequencing
Software
• Piano roll display
– Records played notes on a grid
• Score Display
– Displays musical notes
• Mixing desk
– Enables channels to be combined and
special effects to be applied
110
Higher Computing
Computer Systems
J L Martin
MIDI – Input hardware
• A MIDI keyboard usually looks just like a
standard synthesiser keyboard.
• The musician plays the notes while the
computer software records the notes
played, duration of each note and the
volume etc.
111
Higher Computing
Computer Systems
J L Martin
Processing
• To synthesise an instrument the soundcard
calls on a sample from the wave-table and
manipulates it to produce different notes.
• For a realistic synthesis, several samples
may be used to produce the sound for a
single instrument, Soundcards can also
apply effects such as echo and reverb.
• These effects selected by the MIDI
events are applied by the sound processor
in the sound card.
112
Higher Computing
Computer Systems
J L Martin
MIDI File Format
• A Midi file starts with a header which
contains information such as the tempo
of the tune
• A midi file will contain a sequence of
messages such as
–
–
–
–
–
113
start of a note
channel to use
pitch of the note
volume to play it at
end of a note
Higher Computing
Computer Systems
J L Martin
Advantages of MIDI
• Smaller file size
• All aspects of the music can be edited
(mistakes can be corrected)
• Effects can be applied to individual
instruments
• There is no interference or
background noise from the recording
114
Higher Computing
Computer Systems
J L Martin
Disadvantages of MIDI
• Dependent on soundcard for quality of
sound
• Realistic piano and percussion sounds
have been created, but others, like
guitars, still sound synthetic (even with
an expensive sound card)
• No vocals
• Fewer effects can be applied to the sound
115
Higher Computing
Computer Systems
J L Martin