ASCII
Computers have to be able to represent letters and symbols as well as numbers. Simply, the idea is to give each character a number, as a code and store the codes and their meanings in a table.
A common code is ASCII - the American Standard Code for Information Interchange.
This uses seven bits to store characters. Seven bits is enough to code 128 different characters.
Symbol | Binary |
A | 100 0001 |
B | 100 0010 |
C | 100 0011 |
D | 100 0100 |
E | 100 0101 |
F | 100 0110 |
Using this information write a definition of ASCII in your exercise books. You do need to know what it stands for and how many bits it uses.
ACTIVITY
Activity 1
Use the table of ASCII binary codes to decode these letters
ASCII Binary Code | Decimal | Character |
110 1000 | 104 | h |
110 0101 |
| |
110 1100 | ||
110 1100 | ||
110 1111 |
Activity 2
Use the table of ASCII binary codes to decode this:
Character | Decimal Value | ASCII Binary Code |
H |
| |
o | ||
l | ||
a | ||
n | ||
d |
Character | Decimal Value | ASCII Binary Code |
P |
| |
a | ||
r | ||
k |
Activity 3
Copy and complete the questions below.
Question | Answer |
What is the ASCII code for a blank space? | 32 - 00100000 |
Why is it important to have a code for a blank space? | Otherwise the computer would not recognise where one word finishes and the next begins. |
Write your name in ASCII. | |
Write a word of your choice in binary in your book.Swap with the person next to you and see if you can decode each others word. | |
Unicode
Unicode is an alternative character set and encoding system. It uses 16 bits to encode each character and is therefore able to represent far more characters than ASCII (over 65,000).
Write this definition of Unicode in your exercise books.
ACTIVITY
Bitmap Images
Images can be represented using a grid of squares called pixels. Each pixel can be uniquely identified by its position in the grid (x/y coordinates) and each pixel is a single colour.
Write this definition of a Bitmap Image in your exercise book.
ACTIVITY
http://learncomputing.org/bitmap.php
Interactive Activity
Colour Depth
A binary code is used to represent the colour of a pixel. The number of bits used to store each pixel’s colour is known as the colour depth. The greater the colour depth, the more colours can be represented.
The number of colours that can be represented can be calculated using 2depth. For example a colour depth of 1 bit can represent 2 colours.
2no. of bits
Therefore 3 bits = 23
Write this definition of Colour Depth in your exercise book.
ACTIVITY
Activity 4
Copy and complete the colour depth table below.
Colour depth | Number of colours | Range |
1 bit (think 21) | 2 | 0 – 1 |
2 bit (think 22) |
| |
3 bits (think 23) | 8 | 0-7 |
4 bits | 16 |
|
8 bits |
| |
16 bits | ||
24 bits | ||
32 bits | ||
1-Bit Images
This image has only two colours, black and white and therefore has a colour depth of 1 bit.
1, 0, 0, 0, 1
1, 1, 1, 1, 0
1, 0, 0, 0, 0
0, 1, 1, 1, 0
0, 1, 1, 1, 0
1, 0, 0, 0, 0
1 = white
0 = black
Activity 5
Copy and complete the grid below to reveal what character this code produces.
Binary code |
| ||||
00000 | |||||
01111 | |||||
00000 | |||||
11110 | |||||
00000 | |||||
Use a ruler.
1 = white
0 = black
Activity 6
Produce the binary code to produce the letter ‘G’ in the grid below.
Binary code |
| ||||
1 = white
0 = black
Use a ruler.
How could his be stored more efficiently?
This image has only two colours, black and white.
1, 3, 1
4, 1
1, 4
0, 1, 3, 1
0, 1, 3, 1
1, 4
The first number always represents white.
Complete the Image Representation worksheet using this method.
ACTIVITY
Resolution and File Size
The resolution or pixel density of an image is the number of pixels per inch (PPI). Generally speaking the higher the resolution the higher the quality of the image.
You can calculate the amount of storage space required to save an image using a formula.
(height x resolution) x (width x resolution) x colour depth
8
Calculate the file size of an image with
- dimensions of 2 inches x 3 inches- resolution (also called pixel density) of 200 PPI - colour depth of 4 bits.
ACTIVITY
120,000 bytes
ANSWER
(2 * 200) * (3*200) * 4 / 8
METHOD
RESOLUTION
FILE SIZE
FORMULA
Activity 7
Calculate the file size of an image with dimensions of 3 inches x 4 inches, a pixel density (also known as resolution) of 300 pixels per inch and a colour depth of 8 bits. Give your answer in bytes.
Hint: File size formula is (height x resolution) x (depth x resolution) x colour depth / 8
(3 * 300) * (4*300) * 8 / 8
METHOD
1,080,000 bytes
ANSWER
Activity 8
Calculate the file size of an image with dimensions of 5 inches x 7 inches, a pixel density of 400 pixels per inch and a colour depth of 3 bits. Give your answer in bytes.
(5 * 400) * (7*400) * 3 / 8
METHOD
Hint: File size formula is (height x resolution) x (depth x resolution) x colour depth / 8
2,100,000 bytes
ANSWER
Материалы на данной страницы взяты из открытых источников либо размещены пользователем в соответствии с договором-офертой сайта. Вы можете сообщить о нарушении.