Section 1: Theory of Computer Science
This section should be used for revision for Paper 1 of the 0478 Computer Science Course.
Description of Paper 1:
Paper 1: Theory 1 hour 45 minutes
This written paper contains short-answer and structured
questions. There is no choice of questions.
No calculators are permitted in this paper.
75 marks
Externally assessed.
Description of Paper 1:
Paper 1: Theory 1 hour 45 minutes
This written paper contains short-answer and structured
questions. There is no choice of questions.
No calculators are permitted in this paper.
75 marks
Externally assessed.
1.1 Data Representation
1.1.1 Binary Systems
All computer systems use electronic circuits which exist only in two states; 0 and 1. The Binary System is a method of representing numbers that counts by using combinations of only zeros and ones. Since the computer can only recognize two states, on or off, Binary simplifies information processing. There has to always be two symbols for a processing system to have the ability to understand the data it's given and the binary system is the smallest and simplest numbering system that can be used and understood by a digital device.
How to convert denary to binary and inverse:
To convert denary numbers to binary numbers, it's most effective to use an example, but here is a short explanation: "Divide the number by 2 and if there is a remainder (has to be 1) then interpret this value as the next value of the binary number from the last digit. If there is no remainder to the division by 2, then the value is 0. Continue this process until the next result of the division is 0. You got your binary number!"
Example:
98 to Binary
98/2 = 49 rem. 0 Hence, the Binary number is: 1100010
49/2 = 24 rem. 1
24/2 = 12 rem. 0
12/2 = 6 rem. 0
6/2 = 3 rem. 0
3/2 = 1 rem. 1
1/2 = 0 rem. 1
To convert binary to denary, it takes a bit more work but the concept is very easy: "Associate each value of the binary number with the next value of the power of 2, starting from the right with 2^0. Multiply both of the values which are at the same position and add up all of the results."
Example:
1011100 to Denary
1 0 1 1 1 0 0
2^6 2^5 2^4 2^3 2^2 2^1 2^0
=========================
64 + 0 + 16 + 8 + 4 + 0 + 0 = 92 1011100 in Denary is 92
What is a Byte and how is it used to measure memory size?
By definition, a Bit is a short term for Binary DigIT. It is the smallest unit of data that can be stored by a computer. Each bit can be represented only with a 1 or 0.
A Byte is a group of bits usually grouped in 8. Example: 11001001, 00110001 etc...
Every Letter that you type into your keyboard takes up one byte of storage because each letter represents a binary digit stored in 8 single bits.
Bytes are the standard measurement unit for storage for all computing devices. For example, storage capacity on a CD is measured in bytes, RAM size is measured in bytes and so on.
Uses of Binary in computer Registers for a given application
(Section to complete)
How to convert denary to binary and inverse:
To convert denary numbers to binary numbers, it's most effective to use an example, but here is a short explanation: "Divide the number by 2 and if there is a remainder (has to be 1) then interpret this value as the next value of the binary number from the last digit. If there is no remainder to the division by 2, then the value is 0. Continue this process until the next result of the division is 0. You got your binary number!"
Example:
98 to Binary
98/2 = 49 rem. 0 Hence, the Binary number is: 1100010
49/2 = 24 rem. 1
24/2 = 12 rem. 0
12/2 = 6 rem. 0
6/2 = 3 rem. 0
3/2 = 1 rem. 1
1/2 = 0 rem. 1
To convert binary to denary, it takes a bit more work but the concept is very easy: "Associate each value of the binary number with the next value of the power of 2, starting from the right with 2^0. Multiply both of the values which are at the same position and add up all of the results."
Example:
1011100 to Denary
1 0 1 1 1 0 0
2^6 2^5 2^4 2^3 2^2 2^1 2^0
=========================
64 + 0 + 16 + 8 + 4 + 0 + 0 = 92 1011100 in Denary is 92
What is a Byte and how is it used to measure memory size?
By definition, a Bit is a short term for Binary DigIT. It is the smallest unit of data that can be stored by a computer. Each bit can be represented only with a 1 or 0.
A Byte is a group of bits usually grouped in 8. Example: 11001001, 00110001 etc...
Every Letter that you type into your keyboard takes up one byte of storage because each letter represents a binary digit stored in 8 single bits.
Bytes are the standard measurement unit for storage for all computing devices. For example, storage capacity on a CD is measured in bytes, RAM size is measured in bytes and so on.
Uses of Binary in computer Registers for a given application
(Section to complete)
1.1.2 Hexadecimal
Hexadecimal is an alternative way to store information in a computer using the base-16 notation, unlike binary which uses base-2 notation (2^0,2^1...). Hex digits are represented using numbers and letters. Here is a table showing each decimal value and their hex equivalent:
_______________________________________________________________________
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
-----------------------------------------------------------------------------------------------------------------------
0 1 2 3 4 5 6 7 8 9 A B C D E F |
-----------------------------------------------------------------------------------------------------------------------
The numbers 10 to 15 are represented with letters A to F. Because there are 16 values, it is called a base-16 number system. Hexadecimal is widely used in computing because it is a much shorter way of representing a byte of data. If we were to represent a byte of data in binary, it would require 8 digits, e.g. 11111111. However, that same byte of data could be represented in just two digits e.g. FF - much more compact and user friendly than a binary number. Hexadecimal is used for memory addressing, low-level programming languages and for referencing colours and much more.
How to convert denary to hexadecimal:
To convert den to hex, you will have to divide your number by the next lower power of 16 of that denary number. The number of times that power fits into the value dictates the last value of the hex number. Then, you divide the remainder of that operation by the next lower power of 16. Compose the hex value until the remainder is less than 16.
Example:
Convert 482 to Hex
So, the next lower power of 16 is 256.
482/256 = 1 rem. 16 --> 1
226/16 = 14 rem. 2 --> E ----> 482 in hex is 1E2
2 = 2 --> 2
_______________________________________________________________________
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
-----------------------------------------------------------------------------------------------------------------------
0 1 2 3 4 5 6 7 8 9 A B C D E F |
-----------------------------------------------------------------------------------------------------------------------
The numbers 10 to 15 are represented with letters A to F. Because there are 16 values, it is called a base-16 number system. Hexadecimal is widely used in computing because it is a much shorter way of representing a byte of data. If we were to represent a byte of data in binary, it would require 8 digits, e.g. 11111111. However, that same byte of data could be represented in just two digits e.g. FF - much more compact and user friendly than a binary number. Hexadecimal is used for memory addressing, low-level programming languages and for referencing colours and much more.
How to convert denary to hexadecimal:
To convert den to hex, you will have to divide your number by the next lower power of 16 of that denary number. The number of times that power fits into the value dictates the last value of the hex number. Then, you divide the remainder of that operation by the next lower power of 16. Compose the hex value until the remainder is less than 16.
Example:
Convert 482 to Hex
So, the next lower power of 16 is 256.
482/256 = 1 rem. 16 --> 1
226/16 = 14 rem. 2 --> E ----> 482 in hex is 1E2
2 = 2 --> 2