Note: some of the topics require you to join the Google Classroom used with the current year 10.
Join with the code: a44zs32
Also called base 10 number system.
This is the number system based on ten digits:
0 1 2 3 4 5 6 7 8 9
The value of each digit in a denary number depends on its weight. The weights are based on the powers of 10.
For example, 746 can be expressed as:
Also called base 2 number system.
This number system is based on 2 digits called bits (binary digits):
0 1
Computer circuits represent data according to two states: ON and OFF. The state ON is represented by 1 and the state OFF by 0.
Binary numbers are used to represent any data stored within a computer system.
The value of each digit in a figure depends upon its weight. The weights are based on powers of 2.
Hexadecimal is a base 16 number system.
This number system is based on 16 digits:
0 1 2 3 4 5 6 7 8 9 A B C D E F
Hexadecimal is easier for humans to understand than binary, as it is a shorter representation of the binary
Hexadecimal is used to represent colours in RGB (red, green, blue) notation which is used in HTML to build webpages.
Syntax:
#RRGGBB
The R, G, B letters represent the colours red, green and blue, and they are represented by hexadecimal numbers
Example
the code #00FF00 represents the colour green.
the code #faac00 represents a shade of orange (notice that there's no combination of blue in this RGB colour)
If you want to play with RGB colours, visit this webpage:
A MAC address is a number that uniquely identifies a Network Interface Card (NIC). The MAC address is rarely changed so that a particular device can always be identified no matter where it is.
An example of a MAC address is: 00-0a-83-b1-c0-8e
See more about MAC addresses in Unit 3 - Hardware
ASCII is the code that computers use to represent letters, numbers and symbols.
For example, the hexadecimal code for the letter M is 4D.
Assembly language is a low level programming language.
Example of assembly language:
STO FFA4
See more about Assembly language in Unit 4 - Software
Debug means to find errors in a computer program and eliminate them.
Since it is much easier to work with hexadecimal numbers rather than binary, hexadecimal is often used when developing new software or when trying to trace errors in programs. The contents of part of the computer memory can hold the key to help solve many problems. When the memory contents are output to a printer or monitor, this is known as a "memory dump".
A programmer can look at each of the hexadecimal codes and determine where the error lies. The value on the far left shows the memory location so that it is possible to find out exactly where in memory the fault occurs. It's a very powerful fault-tracing tool, but requires considerable knowledge of computer architecture in order to interpret the results.
You should learn how to add two positive 8-bit binary integers
Study the lesson 1.1.2 Binary addition and overflow from the year 10 Google Classroom, Chapter 1 - Data representation, classwork section. The code to join is a44zs32
You should:
Understand the concept of overflow and why it occurs in binary addition
• An overflow error will occur if the value is greater than 255 in an 8-bit register
• A computer or a device has a predefined limit that it can represent or store, for example 16-bit . An overflow error occurs when a value outside this limit needs to be returned.
Study the lesson 1.1.2 Binary addition and overflow from the year 10 Google Classroom, Chapter 1 - Data representation, classwork section. The code to join is a44zs32
Two’s complement is used to represent positive and negative 8-bit binary integers
In decimal we represent negative 24 like this: -24
Unfortunately in binary we can't use the sign -. Remember, we can only use 0s and 1s.
You should know how to:
1. First, you convert the denary number (ignoring the negative symbol) to binary
2. Add zeros in front until you get 8 bits
3. You must negate the binary number by inverting the bits and adding 1.
Convert the negative two's complement 8-bit integer to positive by inverting the bits and adding one.
1. Convert the negative two's complement 8-bit integer to positive by inverting the bits and adding one.
2. Then, convert the result to denary.
3. Add the minus (-) sign to the number you found in step 2.
Study the lesson 1.1.5 Logical shifts from the year 10 Google Classroom, Chapter 1 - Data representation, classwork section. The code to join is a44zs32
A bit shift moves each digit in a number's binary representation left or right.
These are the main types of shifts:
Logical Left Shifts
When shifting left, the most-significant bit is lost, and a 0 bit is inserted on the other end.
The left shift operator is usually written as "<<".
0010 << 1 → 0100
0010 << 2 → 1000
A single left shift multiplies a binary number by 2:
0010 << 1 → 0100
0010 is 2
0100 is 4
Logical Right Shifts
When shifting right with a logical right shift, the least-significant bit is lost and a 0 is inserted on the other end.
1011 >>> 1 → 0101
1011 >>> 3 → 0001
For positive numbers, a single logical right shift divides a number by 2, throwing out any remainders.
0101 >>> 1 → 0010
0101 is 5
0010 is 2
Compression means to reduce the size of a file.
Decompress means that a compressed file is going back to its original state (to the state before it was compressed).
Why do we compress files?
For example, if we want to send a big file through the internet, we would need a lot of bandwidth. Using compression less bandwidth is required (because the file is now smaller than the original).
Also, a compressed file needs less storage space.
A compressed file needs shorter transmission time.
There are two compression techniques:
When we compress a file using lossless compression we reduce the size of the file without losing any data.
This means that when we decompress the file, we get the original file.
Common lossless compression techniques are:
keyword encoding
run-length encoding
Keyword encoding
This technique replaces frequently used words with a single character.
Example:
Let´s encode the following paragraph:
The human body is composed of many independent systems, such as the circulatory system, the respiratory system, and the reproductive system. Not only must all systems work independently, but they must interact and cooperate as well. Overall health is a function of the well-being of separate systems, as well as how these separate systems work in concert.
The following list has been proposed to use with the above paragraph.
Word Symbol
as ˆ (means that we'll replace all the "as" words in the paragraph above with a "^")
the - (means that we'll replace all the "the" words in the paragraph above with a "-")
and + (means that we'll replace all the "and" words in the paragraph above with a "+")
that $ (means that we'll replace all the "that" words in the paragraph above with a "$")
must & (means that we'll replace all the "must" words in the paragraph above with a "&")
well % (means that we'll replace all the "well" words in the paragraph above with a "%")
these # (means that we'll replace all the "these" words in the paragraph above with a "#")
The compressed paragraph is:
The human body is composed of many independent systems, suchˆ - circulatory system, - respiratory system, + - reproductive system. Not only & each system work independently, but they & interact + cooperate ˆ %. Overall health is a function of - %-being of separate systems, ˆ % ˆ how # separate systems work in concert.
There are a total of 352 characters in the original paragraph, including spaces and punctuation. The compressed paragraph contains 317 characters, resulting in a savings of 35 characters.
Run-length encoding
It deletes all the repeated consecutive data.
For example, the string "aaaaabbb" would be compressed using run-length encoding this way:
5a3b
Run-length encoding also works with images:
When we compress a file using lossy compression we reduce the size of the file but in the process of compression we lose some data.
Lossy compression is typically used for images and sound where a little bit of loss in resolution is often undetectable, or at least acceptable.
– bit ............................ 0, 1
– nibble ...................... 4 bits
– byte ......................... 8 bits
– kibibyte (KiB) ......... 2^10 bytes = 1024 bytes
– mebibyte (MiB) ...... 2^10 KiB = 1024 KiB
– gibibyte (GiB) ......... 2^10 MiB = 1024 MiB
– tebibyte (TiB) ......... 2^10 GiB = 1024 GiB
– pebibyte (PiB) ........ 2^10 TiB = 1024 TiB
– exbibyte (EiB) ........ 2^10 PiB = 1024 PiB
Exercises
Alice has 600 MB of data. Bob has 2000 MB of data. Will it all fit on Alice's 4 GB thumb drive?
Alice has 100 small images, each of which is 500 KB. How much space do they take up overall in MB?
When any key on a keyboard is pressed, it needs to be converted into a binary number so that it can be processed by the computer and the typed character can appear on the screen.
A code where each number represents a character is used to convert text into binary. One code we can use for this is called ASCII (American Standard Code for Information Interchange). The ASCII code takes each character on the keyboard and assigns it a binary number.
Take a look at the ASCII code on your CS classroom.
ASCII code can only store 256 characters, which is enough for most words in English but not enough for other languages. If you want to use accents in European languages or larger alphabets such as Cyrillic (the Russian alphabet) and Chinese Mandarin then more characters are needed. Therefore another code, called Unicode, was created. This meant that computers could be used by people using different languages.
To learn more about Unicode, read this page.
An image is a series of pixels that are converted to binary, which is processed by a computer.
The terms you should be familiar with are:
colour depth (aka bit depth): is the number of bits per pixel. These bits represent the colour in a pixel.
resolution: the number of pixels in an image
The file size and quality of the image increases as the resolution and colour depth increase.
Some examples of image file formats are: jpg, png
The terms that you should be familiar with are:
sound: wave of air that interacts with our eardrum
sample: a sound wave is sampled for sound to be converted to binary, which is processed by a computer. A sample is this binary value
sound sampling: the amplitude of a sound wave taken at different points in time.
sample rate (or, sampling rate): is the number of samples taken in a second
sample resolution: is the number of bits per sample
The accuracy of the recording and the file size increases as the sample rate and resolution increase.
Some examples of sound file formats are: wav, mp3
Knowledge check
Check your knowledge by solving the following quizzes: