Upload
seemaparveen
View
216
Download
0
Embed Size (px)
Citation preview
7/31/2019 Computer Systems Data Representation 1221644513950568 9
1/46
Higher Computing
Mr Arthur
7/31/2019 Computer Systems Data Representation 1221644513950568 9
2/46
Course Outline
3 Main Units Computer Systems = 40 hours
Software Development = 40 hours
Artificial Intelligence = 40 hours Assessment
3 End of Unit Assessments (NABS)
Practical Coursework Tasks (/60 or 30%)
Written Exam (/140 or 70%)
7/31/2019 Computer Systems Data Representation 1221644513950568 9
3/46
Computer Systems
5 units in the Computer Systems Section
1. Data Representation = 6 hours
2. Computer Structure = 7 hours
3. Peripherals = 5 hours4. Networking = 9 hours
5. Computer Software = 9 hours
7/31/2019 Computer Systems Data Representation 1221644513950568 9
4/46
Aims of Lesson 1
1. How are numbers, text and imagesrepresented inside the computer system?
2. Discussing the 2 state computer system
3. Converting positive whole numbers to binaryand vice versa
4. Playing Binary Bingo
7/31/2019 Computer Systems Data Representation 1221644513950568 9
5/46
Data Representation
100 billionswitches per sq. cm
http://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://www.r-type.org/static/cdrom.htmhttp://www.r-type.org/static/cdrom.htmhttp://www.r-type.org/static/cdrom.htmhttp://www.r-type.org/static/cdrom.htmhttp://www.r-type.org/static/cdrom.htmhttp://www.r-type.org/static/cdrom.htmhttp://www.r-type.org/static/cdrom.htmhttp://www.r-type.org/static/cdrom.htmhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://media.digikey.com/photos/On%2520Semi%2520Photos/488-TO-92-3.jpg&imgrefurl=http://parts.digikey.kr/1/4/index307.html&h=640&w=640&sz=45&hl=en&start=41&um=1&usg=__grIhdA13IHHMn_8yGyBG8sZnZKU=&tbnid=nSexdcXa3-o3YM:&tbnh=137&tbnw=137&prev=/images%3Fq%3D3%2Bpin%2Btransistor%26start%3D40%26ndsp%3D20%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DNhttp://images.google.com/imgres?imgurl=http://www.johnlewis.com/jl_assets/product/230231660.jpg&imgrefurl=http://ebeina.blogspot.com/2008/01/oh-dear-switch.html&h=298&w=298&sz=11&hl=en&start=5&um=1&usg=__WG2QbHHcPdWywprJ97HJFt1Wg_A=&tbnid=UCwBYIfmXHuL0M:&tbnh=116&tbnw=116&prev=/images%3Fq%3Dimage%2Blight%2Bswitch%26um%3D1%26hl%3Den%26sa%3DN7/31/2019 Computer Systems Data Representation 1221644513950568 9
6/46
Data Storage
Numbers, Text, andImages are all storedas a series of 1s and 0s
inside the computersystem.
These series of 1s and0s are made up of
pulses of electricityfrom 1 volt to 5 volts
http://images.google.co.uk/imgres?imgurl=http://www.suzukituning.com/General/VialleLPi/Pictures/image036.gif&imgrefurl=http://www.suzukituning.com/General/VialleLPi/Vialle%2520LPi%2520Technical%2520Manual.htm&h=555&w=511&sz=4&hl=en&start=14&tbnid=0Fvbd0_pPuJ7JM:&tbnh=133&tbnw=122&prev=/images%3Fq%3Delectrical%2Bpulse%26gbv%3D2%26hl%3Den7/31/2019 Computer Systems Data Representation 1221644513950568 9
7/46
Decimal Counting System
When we represent numbers we use the decimalcounting system, for example
123,000
100,000 10,000 1,000 100 10 1
1 2 3 0 0 0
Since the computer is 2 state, the binary counting
system goes up by the power 2, rather than 10 i.e256 128 64 32 16 8 4 2 1
7/31/2019 Computer Systems Data Representation 1221644513950568 9
8/46
How Positive Whole Numbers areStored
34
128 64 32 16 8 4 2 1
0 0 1 0 0 0 1 0
= 32 + 2
134
128 64 32 16 8 4 2 1
1 0 0 0 0 1 1 0
= 128 + 4 + 2
7/31/2019 Computer Systems Data Representation 1221644513950568 9
9/46
Binary back to Decimal
1011 0011
128 64 32 16 8 4 2 1
1 0 1 1 0 0 1 1
= 128 + 32 + 16 + 2 + 1
=179
7/31/2019 Computer Systems Data Representation 1221644513950568 9
10/46
Binary to Decimal
1. What is the decimalrepresentation of thefollowing 8 bits using
2s complement(a) 0001 0110
(b) 1000 1100
(c) 0111 0011
2. What is the 8 bitrepresentation of thefollowing decimal
numbers(a) 174
(b) 121
(c) 71
7/31/2019 Computer Systems Data Representation 1221644513950568 9
11/46
Binary Bingo
42
81
21
16
121
73
101 75
127
13
209
32
56
175
192
186 176
121
7/31/2019 Computer Systems Data Representation 1221644513950568 9
12/46
Data Storage
1 or 0 = 1 bit
8 bits = 1 byte
1024 bytes = 1 kilobyte
1024 kilobytes = 1 megabyte
1024 megabytes = 1 gigabyte
7/31/2019 Computer Systems Data Representation 1221644513950568 9
13/46
Aims of Lesson 2
1. Representation of negative whole numbers
2. The 2s complement system
7/31/2019 Computer Systems Data Representation 1221644513950568 9
14/46
Representing NegativeNumbers
The signed bit method
0000 0001 = 1
0000 0000 = 01000 0001 = -1
1000 0010 = -2
1000 0011 = -31000 0100 = -4
7/31/2019 Computer Systems Data Representation 1221644513950568 9
15/46
Representing NegativeNumbers
There is a problem with this method??
Using 8 bits you can only store the decimalnumbers from
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 1
= 64 +32+16+8+4+2+1 = -127
128 64 32 16 8 4 2 10 1 1 1 1 1 1 1
=64+32+16+8+4+2+1=127
Rather than -255 to 255
7/31/2019 Computer Systems Data Representation 1221644513950568 9
16/46
2s Complement
What is the 8 bit twos complement representation ofthe decimal number -101
101
128 64 32 16 8 4 2 10 1 1 0 0 1 0 1
Invert numbers
1 0 0 1 1 0 1 0
+1-101
1 0 0 1 1 0 1 1
7/31/2019 Computer Systems Data Representation 1221644513950568 9
17/46
Negative Whole Numbers
What is the decimal representation of thefollowing 8 bits using 2s complement
1 0 1 0 1 1 1 1
You invert every number0 1 0 1 0 0 0 0
Then add 1
0 1 0 1 0 0 0 1
128 64 32 16 8 4 2 1
64+16+1
-81
7/31/2019 Computer Systems Data Representation 1221644513950568 9
18/46
2s Complement Questions
1. What is the decimalrepresentation of thefollowing 8 bits using
2s complement(a) 1000 1011
(b) 1100 1100
(c) 1001 0111
(d) 1110 1100
2. What is the 8 bit twos
complementrepresentation of the
following decimalnumbers
(a) -45
(b) -121
(c) -176
(d) -71
7/31/2019 Computer Systems Data Representation 1221644513950568 9
19/46
Aims of Lesson 3
1. So far we have looked at representingpositive and negative whole numbers usingbinary
2. We are now going to look at therepresentation of non whole numbers usingthe floating point system
7/31/2019 Computer Systems Data Representation 1221644513950568 9
20/46
Representing Non WholeNumbers
How do we represent the number 128.75 inbinary?
128 + 0.5 + 0.25 = 128.75
128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625
1 0 0 0 0 0 0 0 1 1 0 0
7/31/2019 Computer Systems Data Representation 1221644513950568 9
21/46
Mantissa and Exponent
Mantissa
Exponent
8
8 4 2 1
1 0 0 0
128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625
1 0 0 0 0 0 0 0 1 1 0 0
1 0 0 0 0 0 0 0 1 1 0 0
7/31/2019 Computer Systems Data Representation 1221644513950568 9
22/46
Mantissa
Exponent
6
8 4 2 10 1 1 0
1 0 0 1 1 0 0 0 1 0
1 0 0 1 1 0 0 0 1 0
How do we represent the number 38.125 usingfloating point
32 16 8 4 2 1 0.5 0.25 0.125 0.0625
7/31/2019 Computer Systems Data Representation 1221644513950568 9
23/46
Representing Non WholeNumbers
Mantissa relates to the precision of thenumber you can represent i.e 34.44454321
Exponent relates to the range of the number
1111 = 151111 1111 = 255
8 4 2 1 0.5 0.25 0.125 0.075 0.0375 0.01875 0.009375
7/31/2019 Computer Systems Data Representation 1221644513950568 9
24/46
What is the decimal number if the Mantissa is
10010011 and the exponent is 0101
Exponent
8 4 2 1
0 1 0 1
= 5
Mantissa
1 0 0 1 0 0 1 1
Mantissa and Exponent
16 8 4 2 1 0.5 0.25 0.125
16 + 2 + 0.25 + 0.125 =18.375
7/31/2019 Computer Systems Data Representation 1221644513950568 9
25/46
Aims of Lesson 4
1. So far we have looked at representingpositive and negative whole numbers usingbinary
2. We have also looked at representing nonwhole numbers using floating point.
3. Today we are going to practice convertingstorage capacities from bit, byte, kilobyte,
megabyte, gigabyte, terabyte4. Discuss how text is represented in a
computer system
7/31/2019 Computer Systems Data Representation 1221644513950568 9
26/46
Storage Capacities
0 or 1 = 1 bit
8 bits = 1 byte
1024 bytes = 1 Kilobyte
1024 Kilobytes = 1 Megabyte
1024 Megabytes = 1 Gigabyte
1024 Gigabytes = 1 Terabyte
7/31/2019 Computer Systems Data Representation 1221644513950568 9
27/46
Storage Conversions
I have a 2 Gigabyte IPOD Classic. How many512Kb songs can I store on the IPOD?
Convert 2Gb to Kb
2 X 1024 = 2048Mb
2048 X 1024 = 2,097,152Kb
512Kb 4096 Songs
7/31/2019 Computer Systems Data Representation 1221644513950568 9
28/46
Storage Conversion Questions
1. I have a memory card for a Digital Camerawith a capacity of 4Gb. How many 460Kbimages can I store on the memory card?
2. Mr Haggarty has recently been working as aDJ at weekends. He has bought an externalhard disk to back up songs. How many 4Mb
songs would he be able to fit on the 80Gbhard disk?
7/31/2019 Computer Systems Data Representation 1221644513950568 9
29/46
Solutions
4Gb X 1024 = 4096Mb
4096 X 1024 =4,194,304Kb
460Kb
= 9118 images
80Gb X 1024 =81920Mb
4Mb
= 20,480 songs
7/31/2019 Computer Systems Data Representation 1221644513950568 9
30/46
How is Text Represented
ASCII
Each key on the keyboardis converted into a binarycode using 7 bits
Using 7 bits i.e 2 = 128characters can berepresented
Character Set
A list of all the characterswhich the computer canprocess
Control Characters
Codes 0 to 31 are nonprintable characters
7
Character Binary Decimal
tab 000 1001 9
return 000 1101 13
space 010 0000 32
! 010 0001 33
010 0010 34
1 011 0001 49
A 100 0001 65
a 110 0001 97
7/31/2019 Computer Systems Data Representation 1221644513950568 9
31/46
How is Text Represented
Unicode (Universal Code) Each key on the keyboard is converted into a binary code
using 16 bits
Using 16 bits i.e 2 = 65,536 characters can be
represented Can represent Latin, Roman, Japanese characters
Advantages More characters can be represented
Disadvantages Takes up more than twice as much space for each
character
16
7/31/2019 Computer Systems Data Representation 1221644513950568 9
32/46
Aims of Lesson 5
Last Lessons
Representing positivewhole numbers as binary
Representing negative
whole numbers using 2scomplement
Non whole numbers usingmantissa and exponent
Storage calculations
Looked at how text isrepresented using ASCIIand Unicode
Todays Lesson
1. Discuss graphicrepresentation
2. Calculate storage
capacities of colour Bit Mapgraphics
3. Bit Map v Vector
7/31/2019 Computer Systems Data Representation 1221644513950568 9
33/46
BIT Map GraphicsSCREEN MEMORY
PIXEL
MEMORY REQUIRED
8 BITS X 8 BITS = 64 BITS
= 8 BYTES
Bit Map = the graphic is made upfrom a series of pixels
7/31/2019 Computer Systems Data Representation 1221644513950568 9
34/46
Graphics Resolution
The smaller the size ofthe pixels, the finer thedetail of the image
800 x 600 pixels lowerquality than 1024 x 768
As the number of pixelsincreases so does the
storage space required
Pixel Patternusing 8x8 grid
Pixel Patternusing 16x16 grid
7/31/2019 Computer Systems Data Representation 1221644513950568 9
35/46
7/31/2019 Computer Systems Data Representation 1221644513950568 9
36/46
Bit Map V Vector Graphics
Bit Map Graphic
Bit map packages paintpictures by changing thecolour of the pixels
Known as Paint Packages When shapes overlap, the
one on top rubs out theother
When you save a file the
whole screen is saved
The resolution of the imageis fixed when you create theimage
Vector Graphic
Work by drawing objects onthe screen
Known as Draw Packages
When shapes overlap theyremain as separate objects
Only the object attributesare stored taking up muchless space
Resolution Independent
7/31/2019 Computer Systems Data Representation 1221644513950568 9
37/46
Aims of Lesson 6
Last Lessons Representing positive whole
numbers as binary Representing negative
whole numbers using 2scomplement
Non whole numbers usingmantissa and exponent
Storage calculations Looked at how text is
represented using ASCIIand Unicode
Discuss graphicrepresentation
Calculate storage capacitiesof colour Bit Map graphics
Bit Map v Vector
Todays Lesson1. Discuss true colour
Todays Tasks1. Complete Data
Representation Questions
2. Read chapter in the book
Bit D th 1 bit
7/31/2019 Computer Systems Data Representation 1221644513950568 9
38/46
True Colour
Bit Depth (Colour Depth) The number of bits used to represent colours in the
graphic 1 bit = black or white 2 bits = 4 colours 3 bits = 8 colours 8 bits = 256 colours 24 bits = 16,777,216 colours this is true colour
True Colour 24 bits
8 bits for red 8 bits for blue 8 bits for green
Bit Depth = 1 bit
Human eye cannot
distinguish betweenadjacent shades ofgrey when looking atmore than 200shades betweenblack and white
Bit Depth = 2 bit
http://images.google.com/imgres?imgurl=http://www.photoshopessentials.com/images/essentials/16-bit/6-colors.gif&imgrefurl=http://www.photoshopessentials.com/essentials/16-bit/&h=304&w=362&sz=8&hl=en&start=4&um=1&usg=__SVbFEA3WVuyrG2BWXiQ3LNxSLXQ=&tbnid=3lkFOTzTp1tB6M:&tbnh=102&tbnw=121&prev=/images%3Fq%3Dred%2Bgreen%2Bblue%26um%3D1%26hl%3Den7/31/2019 Computer Systems Data Representation 1221644513950568 9
39/46
Bit DepthsBit Depth = 2 bits
01
10
11
00
7/31/2019 Computer Systems Data Representation 1221644513950568 9
40/46
Solutions
Question 1
2 inches X 90 = 180 pixels
2 inches X 90 = 180 pixels
180 X 180 = 32,400 pixels
in total 256 colours = 2 power 8
32,400 X 8 = 259,200 bits
259,200/8 = 32,400 bytes
32,400 / 1024 = 31.6Kb
Question 2
5 inches X 200 = 1000pixels
3 inches X 200 = 600 pixels
1000 X 600 = 600,000pixels in total
128 colours = 2 power 7
600,000 X 7 = 4,200,000bits
4,200,000/8 = 525,000bytes
525,000 / 1024 = 512.7Kb
Ai f L 7
7/31/2019 Computer Systems Data Representation 1221644513950568 9
41/46
Aims of Lesson 7
Last Lessons Representing positive whole
numbers as binary Representing negative
whole numbers using 2scomplement
Non whole numbers usingmantissa and exponent
Storage calculations Looked at how text is
represented using ASCIIand Unicode
Discuss graphicrepresentation
Calculate storage capacitiesof colour Bit Map graphics
Bit Map v Vector True Colour
Todays Lesson1. Data Compression
Todays Tasks1. Complete Compression task2. Issue Scholar logins
3. Complete DataRepresentation QuestionsSheet
4. Read chapter in the book
7/31/2019 Computer Systems Data Representation 1221644513950568 9
42/46
Compression
Data compressionmeans reducing thesize of a file in order to
save backing storagespace.
2 types of compression
Lossless compression
Lossy compression
7/31/2019 Computer Systems Data Representation 1221644513950568 9
43/46
Lossless Compression
Lossless means thatnone of the originaldata is lost
One method of losslesscompression involvescounting repeatingpixels
COLOUR = 10011000 11100000 e.g. 16 bits
NUMBER OF THE SAME PIXELS = 32
100000
STORAGE REQUIRED = 16 BITS + 6 BITS =22 BITS
7/31/2019 Computer Systems Data Representation 1221644513950568 9
44/46
Lossy Compression
Lossy compression involvessacrificing some of the datain order to reduce the filesize
Deliberately losing some
types of information that oureyes and brains usuallyignore
Lossy is only suitable if theloss of data will not causethe file to become useless
JPEG is a file format thatuses lossy compression toreduce file sizes
D R i L i
7/31/2019 Computer Systems Data Representation 1221644513950568 9
45/46
Data Representation Learning
Aims
1. Representation of positive numbers in binary up to32 bits
2. Conversion from binary to decimal and vice versa3. Representation of negative numbers using 2s
complement4. Representation of non whole numbers using
floating point with mantissa and exponent5. Conversion to and from bit, byte, kilobyte,
megabyte, gigabyte, terabyte
D R i L i
7/31/2019 Computer Systems Data Representation 1221644513950568 9
46/46
Data Representation Learning
Aims
6. Unicode and its advantages over ASCII
7. Description of the bit map method of graphicsrepresentation
8. Description of the relationship between bit depthand the number of colours represented up to 24 bitdepth
9. Vector graphics
10. Relationship between bit depth and file size