Computer Science Year 1
SECTION
1 COMPUTER
SYSTEMS A – DATA
REPRESENTATION
AND COMPUTER
STRUCTURE
1
,SECTION 1 COMPUTER SYSTEMS A – DATA REPRESENTATION AND COMPUTER STRUCTURE
Computer Architecture and Organisation
Data Storage and Manipulation
INTRODUCTION
Inside today’s computers, all information is encoded (represented) in the form of 0s
and 1s data. These digits are called bits, which are short for binary digits. Bits are the
basic building blocks of computers (just like letters are the building blocks for words),
telling the computers what to do and how to represent data. Patterns of bits combine
to represent text, numbers, images and sound. This topic is fundamental to computer
science because, at the end of the day, computers are machines that manipulate digital
signals, which are either on or off, either 1 or 0. So, regardless of whether you are
programming, doing machine learning, just using a computer or engaging in more
advanced topics like robotics, you are also ultimately manipulating bits.
At the end of this section, you should be able to:
• Describe information as bit patterns.
• Apply knowledge of browser cache to solve runtime issues (e.g. opening browsers).
• Describe the functions of the parts of the CPU: Arithmetic and Logic Unit (ALU), Control
Unit (CU) and registers.
• Understand and explain the control bus, address bus, data bus and the internal clock,
Machine Cycle, Fetch-Decode-Execute-Store Cycle, instruction set for a CPU and
describe embedded systems.
Key Ideas
• A bit is the smallest unit of data.
• 8 bits make a byte (8 bits = 1 byte).
• Different types of information (numbers, text, images, etc.) are encoded into binary
in different ways. This means the raw data/binary representation needs to be decoded
according to its type to make sense as useful information.
• Boolean logic is a type of algebra in which results are calculated as either True or False.
• Buses are used to connect these components, allowing data and signals to pass between
them.
• The buses that form the system bus play a key role in the machine cycle, because it is
they who ferry around the necessary addresses, data and control signals.
2
,SECTION 1 COMPUTER SYSTEMS A – DATA REPRESENTATION AND COMPUTER STRUCTURE
HOW DATA IS REPRESENTED IN A COMPUTER
SYSTEM
Data as Bit Pattern Representations
A bit is the smallest unit of data in computing or the digital world. A bit can only be
in one of two ‘binary’ states: ‘0’ or ‘1. The ‘0’ often signifies ‘Off’ or ‘False’ and the ‘1’
signifies ‘On’ or ‘True’ as in Figure 1.1.
Fun fact: Did you know that the word binary comes from the late Latin word ‘bini’ for
‘two together’, and before computers and bits were invented, it meant ‘dual’ or ‘pair’,
which is quite fitting since it now means two things that are opposite (‘On’ and ‘Off’
/1 and 0).
Fig 1.1 Switch illustrating the two binary states
Eight contiguous bits make one byte (8 bits = 1 byte).
A series of 0s and 1s is known as a bit pattern.
Representing data as bit patterns involves using sequences of 0s and 1s (bits) to encode
different types of data. For example, a wall socket switch, which can be ‘On’ or ‘Off’
could be represented by one bit (0 or 1).
Bits can often be found in the real world as labels for switches indicating which
direction/state is ‘On’ (1) and which is ‘Off’ (0). For example, see the switch of the
extension cable shown in Figure 1.2.
3
, SECTION 1 COMPUTER SYSTEMS A – DATA REPRESENTATION AND COMPUTER STRUCTURE
Fig 1.2 Extension cable with switch labelled with bits
We will learn how the following types of data are represented in binary (as bits): Integers
(numbers), Text, Images, Audio, Videos, Files, and Data for Transmission. We will
discuss each in turn below.
1. Integer Representation
At the basic level, you were taught how to convert an integer (whole number)
from one base to another.
When encoding numbers in binary, we are converting from base-10 (decimal) to
base-2 (binary). In binary/base-2, the place values for each digit go up in 2s, going
from right to left.
For example, the first five place values are:
Fig 1.3 Binary representation
a. Decimal to Binary
The process of converting decimal numbers to binary (base-2) notation is shown
through two examples. Figure 1.4 converts 13 to binary and Figure 1.5 converts 25
to binary.
4
SECTION
1 COMPUTER
SYSTEMS A – DATA
REPRESENTATION
AND COMPUTER
STRUCTURE
1
,SECTION 1 COMPUTER SYSTEMS A – DATA REPRESENTATION AND COMPUTER STRUCTURE
Computer Architecture and Organisation
Data Storage and Manipulation
INTRODUCTION
Inside today’s computers, all information is encoded (represented) in the form of 0s
and 1s data. These digits are called bits, which are short for binary digits. Bits are the
basic building blocks of computers (just like letters are the building blocks for words),
telling the computers what to do and how to represent data. Patterns of bits combine
to represent text, numbers, images and sound. This topic is fundamental to computer
science because, at the end of the day, computers are machines that manipulate digital
signals, which are either on or off, either 1 or 0. So, regardless of whether you are
programming, doing machine learning, just using a computer or engaging in more
advanced topics like robotics, you are also ultimately manipulating bits.
At the end of this section, you should be able to:
• Describe information as bit patterns.
• Apply knowledge of browser cache to solve runtime issues (e.g. opening browsers).
• Describe the functions of the parts of the CPU: Arithmetic and Logic Unit (ALU), Control
Unit (CU) and registers.
• Understand and explain the control bus, address bus, data bus and the internal clock,
Machine Cycle, Fetch-Decode-Execute-Store Cycle, instruction set for a CPU and
describe embedded systems.
Key Ideas
• A bit is the smallest unit of data.
• 8 bits make a byte (8 bits = 1 byte).
• Different types of information (numbers, text, images, etc.) are encoded into binary
in different ways. This means the raw data/binary representation needs to be decoded
according to its type to make sense as useful information.
• Boolean logic is a type of algebra in which results are calculated as either True or False.
• Buses are used to connect these components, allowing data and signals to pass between
them.
• The buses that form the system bus play a key role in the machine cycle, because it is
they who ferry around the necessary addresses, data and control signals.
2
,SECTION 1 COMPUTER SYSTEMS A – DATA REPRESENTATION AND COMPUTER STRUCTURE
HOW DATA IS REPRESENTED IN A COMPUTER
SYSTEM
Data as Bit Pattern Representations
A bit is the smallest unit of data in computing or the digital world. A bit can only be
in one of two ‘binary’ states: ‘0’ or ‘1. The ‘0’ often signifies ‘Off’ or ‘False’ and the ‘1’
signifies ‘On’ or ‘True’ as in Figure 1.1.
Fun fact: Did you know that the word binary comes from the late Latin word ‘bini’ for
‘two together’, and before computers and bits were invented, it meant ‘dual’ or ‘pair’,
which is quite fitting since it now means two things that are opposite (‘On’ and ‘Off’
/1 and 0).
Fig 1.1 Switch illustrating the two binary states
Eight contiguous bits make one byte (8 bits = 1 byte).
A series of 0s and 1s is known as a bit pattern.
Representing data as bit patterns involves using sequences of 0s and 1s (bits) to encode
different types of data. For example, a wall socket switch, which can be ‘On’ or ‘Off’
could be represented by one bit (0 or 1).
Bits can often be found in the real world as labels for switches indicating which
direction/state is ‘On’ (1) and which is ‘Off’ (0). For example, see the switch of the
extension cable shown in Figure 1.2.
3
, SECTION 1 COMPUTER SYSTEMS A – DATA REPRESENTATION AND COMPUTER STRUCTURE
Fig 1.2 Extension cable with switch labelled with bits
We will learn how the following types of data are represented in binary (as bits): Integers
(numbers), Text, Images, Audio, Videos, Files, and Data for Transmission. We will
discuss each in turn below.
1. Integer Representation
At the basic level, you were taught how to convert an integer (whole number)
from one base to another.
When encoding numbers in binary, we are converting from base-10 (decimal) to
base-2 (binary). In binary/base-2, the place values for each digit go up in 2s, going
from right to left.
For example, the first five place values are:
Fig 1.3 Binary representation
a. Decimal to Binary
The process of converting decimal numbers to binary (base-2) notation is shown
through two examples. Figure 1.4 converts 13 to binary and Figure 1.5 converts 25
to binary.
4