Please enable JavaScript.
Coggle requires JavaScript to display documents.
Topic 3 - Fundamentals of data representation (Binary Arithmetic (Binary…
Topic 3 - Fundamentals of data representation
Number Bases
Units of Information
A Bit = 1 or 0
A Byte = 8 bits
A Kilobyte = 1000 bytes
Megabyte = 1,000 Kilobytes or 1,000,000 bytes
Terabyte = 1,000 gigabytes or 1,000,000,000,000 bytes
Gigabyte = 1,000 megabytes or 1,000,000,000 bytes
Binary Addition
How to do it
Example 2:
When adding if its 1 + 0 = 1. However if its 1+1 = 0 but then another 1 will carry over.
Example 1:
Converting Decimal to Binary
Target 255 = 11111111
Largest number = 255
Target 150 = 10010110
Number of values = 256 this is because 0 is represented as a value.
Target 87 = 01010111
Converting Binary to Decimal
11001011 = 203
11010111 = 215
00111111 = 63
Character Encoding
Every word that you type is made up of symbols or characters. When you press a key on the keyboard a number is generated that represents the symbol for that key. This is called character code. A complete collection of these codes is called a character set.
Every button on the keyboard has a code. This includes letters, numbers, punctuation and non-printing operators and modifiers (shift, alt,Ctrl).
ASCII
ASCII is a character set,. It uses 7 bits to encode characters into binary, this is known as character code. Character codes are grouped and will run in sequence. ASCII "A is 65" etc. The number of different characters that can be represented in ASCII is 18. ASCII is limited
Unicode
Unicode was introduced as an alternative to ASCII. It uses 16 bits. There are 65,536 combinations. The reason why it was introduced was to enable the representation of greater number of characters/languages and to improve the portability of documents across systems.
Advantages of Unicode over ASCII
Can represent a wider range of characters.
Can represent different languages
Can represent characters used in scientific/mathematical/technical/ specialist documents.
Disadvantages of Unicode over ASCII
Requires more storage space
Unicode uses more characters to represent letters.
Longer transmission time.
Number Bases 2
They have different values.
Number Bases 3
Computers use binary to store all data. If it is stores or processed it will be done with binary.
A bit pattern (00 01 00 11) could be used to represent different data.
It could be a number, audio, visual or text.
Hexadecimal - making binary "easier" to represent.
Hexadecimal 0-9 A-F (a =10, b = 11 etc.)
Hexadecimal is easier for humans to read than binary
Hexadecimal is easier to convert than denary.
Numbers are displaced in a more compact way in hexadecimal than binary.
Converting between number bases
We have covered this section any time where you have converted numbers from one base to another. You will need to be able to do this for the exam. There will not be a calculator.
Binary 0110 = denary 6
Denary 255 = binary 11 11 11 11
Hex F = denary 15
Hex 1A = denary 26
Binary Arithmetic
Binary Shifting
Shifting the following byte two places to the left.
00001111
00111100
Top number = 15
After the shift it becomes 60
Shift to the right - this is the same as dividing by a number. Everyplace to the right you are dividing by 2.
Shift to the left is multiplication everyplace to the left x 2.
Binary shifts can be used to perform simple multiplication/division by powers of 2.
Representing Images
Pi
cture
El
ement - A pixel is a single point in a graphical point. A pixel is the smallest addressable element in an image.
VDU's - Visual Display Unit display the images by dividing the area of the screen up into thousands / millions of pixels. They would be arranged into rows or columns.
Image size is calculated by multiplying height by width.
Colour depth is the number of bits used to represent each pixel.
The more bits used the more colours there are. This would lead to a larger file size.
File size - increasing the resolution and/or increase the colour depth which makes the file size bigger.
Representing Sound
Sample rate is the number of samples made in a second. Usually measured in hertz (1 hertz = 1 sample per second)
Sample resolution is the number of bits used to represent a sample.
Sound is sampled at 5 kHz (5000 Hz) and the sample resolution is 16 bits.
There are 5000 samples per second each sample is 2 byte (16 bits).
1 second of sound will be 5000 x 2 = 10,000 bytes.
File size of a sound file: Sample rate (Hz) x length of clip (seconds) x resolution (bits)
Example: Calculate the file size in bits for a two minute sound recording that has used a sample rate of 1000 Hertz (Hz) and a sample resolution of 5 bits. (3 marks)
Answer: 1000 x 5 x 120
600,000 bits. Must include in units.
To Calculate the approximate file size of BITMAP image you will need to know:
Number of pixels (Height x Width)
Colour Depth (Width x Height x Depth)
Byte = divide by 8
Kilobytes divide by 1000.
Data Compression
Data Compression is the process of reducing the quantity of bits required in order to represent a piece of information.
Run Length Encoding (RLE)
This is the process of using frequency/ data pairs to reduce the amount of data stored.
Take original data, compress using RLE, store data.
Run Length Encoding - Will not lose quality of data, but in some cases can increase the amount of data.
It's lossless, can lead to larger file size.
The first number is how many of the next number there is.
Huffman Coding
Huffman coding is a way of compressing the data.
Using the word abracadabra we can look at the frequency of each letter.
We now assign a binary assignment to each letter.