0% found this document useful (0 votes)
4 views29 pages

Chapter 2

The document outlines the Computer Science 1 course for the 2025/2026 academic year, detailing its objectives, prerequisites, and content structure. It covers fundamental concepts in computer science, including the evolution of computers, information coding systems, and basic programming principles. The course aims to equip students with essential skills for understanding and working with computers and programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views29 pages

Chapter 2

The document outlines the Computer Science 1 course for the 2025/2026 academic year, detailing its objectives, prerequisites, and content structure. It covers fundamental concepts in computer science, including the evolution of computers, information coding systems, and basic programming principles. The course aims to equip students with essential skills for understanding and working with computers and programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Structure and

Applications

2025/2026

Creative Commons Zero:[Link]


Table of contents

I - General objectives 3
II - Prerequisites 4
III - General presentation of the course 5
IV - Chapter 1: Introduction to Computer Science 6
1. Definition of Computer Science ................................................................................6
2. Evolution of information technology and computers .............................................6
2.1. 1- The first generation of computers (vacuum tubes 1945-1955) ...................................................7
2.2. 2- The second generation (transistors 1955-1965)...........................................................................7
2.3. 3- The third generation (integrated circuits 1965-1980) ..................................................................7
2.4. 4- The fourth generation (microprocessors from 1980 to today) ....................................................8

3. Information Coding Systems .....................................................................................8


3.1. Decimal Encoding .............................................................................................................................8
3.2. Binary Encoding ................................................................................................................................9
3.3. Other Coding Systems (Octal and Hexadecimal) .............................................................................9
3.4. Conversion of Numbers from One Coding System to Another......................................................10
3.5. Operations between Binary Numbers ............................................................................................16

4. Computer operating principles ...............................................................................18


4.1. The general structure of a computer ..............................................................................................18
4.2. How does a computer work? ..........................................................................................................24
4.3. The speed of a processor ................................................................................................................25
4.4. Mass storage units ...........................................................................................................................26

5. computer's hardware ..............................................................................................28


5.1. What means Computer’s Hardware ? .............................................................................................28

6. computer's software ................................................................................................28


6.1. What means Computer’s Software? ...............................................................................................28

2
General objectives I

At the end of Computer Science 1 course, the student will be able to: Identify the basic components of a
computer, both in terms of hardware and software.
Describe the general operation of a computer, taking into account the interactions between its
various components.
Understand coding systems and the transformations between these systems.
Grasp the fundamental principles of programming, including variables, conditions, and loops.
Apply the fundamental principles of programming to write simple programs using variables,
conditions, and loops.
Analyze a problem to break it down into simpler tasks, with the aim of facilitating programming.
Analyze and identify errors in an algorithm and propose corrections.

3
Prerequisites II

While Computer Science 1 does not have strict prerequisites, there are several recommended
prerequisites that would be beneficial for students and increase their chances of success:
Basic Mathematical Skills: Having a good understanding of arithmetic and algebra is
recommended, as these concepts form the foundation of many computer science topics.
Computer Proficiency: Familiarity with basic computer operations such as opening and closing
programs, creating and saving files, and using the internet will facilitate navigating the course
material and completing tasks.
Work Ethic: Programming requires time, effort, and perseverance. A strong work ethic and a
determination to learn will help students stay motivated and on track.

4
General presentation of the course III

The Computer Science 1 course aims to provide students with a basic understanding of computers and
their components, as well as computer science in general. It introduces key programming concepts,
such as coding systems, binary operations, and algorithmic principles, and teaches students the
various components of an algorithm and how to use them to solve problems. The ultimate goal is to
provide a strong foundation in computer science for students who wish to pursue this field or acquire
computer skills to navigate a digital world. Students will also discover how computers operate and how
they can be used to enhance efficiency and productivity in various professional and personal contexts.
The concept map of the Computer Science 1 module allows for the visualization of key concepts such
as chapters, series, workload, prerequisites, objectives, and resources, as well as their relationships in a
clear and coherent manner. This course is divided into two chapters:
1. The first chapter introduces the field of computer science and its basic concepts.
2. The second chapter covers algorithms and the necessary concepts for writing algorithms to
solve problems of various types.

5
Chapter 1: Introduction to Computer
Science IV

Computer science is a scientific discipline that aims to solve problems using computers and related
technologies. It focuses on information management, from its storage and processing to analysis.
Through computer science, algorithms and software can be developed to solve complex problems in
fields such as finance, sciences, engineering, medicine, and many more. In this chapter, we will
concentrate on the fundamental concepts of computer science. We will begin by exploring the history of
computing and computers, which will provide us with an understanding of the evolution of this
technology over time. Next, we will delve into the various components that make up a computer, as well
as the different information encoding systems that enable these components to communicate with each
other. Finally, we will address operating systems, which constitute the core of any computer and enable
users to interact with the machine. Through this exploration, we aim to provide you with a solid
understanding of basic computer science and its various facets. Please note that all references that served
as inspiration for the writing of this chapter can be found in the bibliography.

1. Definition of Computer Science

Definition

Computer science is the field that encompasses the design, development, and use of software and
computer hardware for processing and storing digital data. The most important task in computer
science is the writing of computer programs (as illustrated below).

Definition of computer science

2. Evolution of information technology and computers


The history of computing is often divided into four distinct generations, each marking a significant
technological advancement in the development of computers.

6
Chapter 1: Introduction to Computer Science

2.1. 1- The first generation of computers (vacuum tubes 1945-1955)


The early generations of computers relied on fragile glass devices called vacuum tubes. These
computers were bulky and heavy, primarily employed for calculations, data storage, and data
management. Despite their limitations, they marked a pioneering phase in technology, setting the
stage for smaller, more powerful, and versatile computing machines in subsequent generations.

2.2. 2- The second generation (transistors 1955-1965)


The second-generation computers introduced the use of transistors instead of vacuum tubes. This
technology brought significant performance improvements in processing speed while substantially
reducing energy consumption. This advancement led to more compact, reliable, and energy-efficient
computers. It marked a pivotal step towards the development of smaller and more powerful
computing devices, revolutionizing the computing landscape during the 1955-1965 era.

2.3. 3- The third generation (integrated circuits 1965-1980)


This generation of computers was marked by the introduction of integrated circuits. Integrated circuits
are small electronic components that combine multiple types of electronic elements. Computers from
this era were characterized by increased processing speed and enhanced reliability due to the use of
this technology. The transition to integrated circuits represented a significant advancement, enabling
more powerful and dependable computing devices during the 1965-1980 period.

7
Chapter 1: Introduction to Computer Science

2.4. 4- The fourth generation (microprocessors from 1980 to today)


At the end of the 1970s, microprocessors made their debut. This technology offered the advantage of
consolidating all the circuits required for arithmetic, logic, and control calculations onto a single chip.
Computers using this technology were then referred to as microcomputers. This generation paved the
way for even smaller yet more powerful computers, revolutionizing the computing landscape with
enhanced capabilities.

3. Information Coding Systems


In the field of computer science, data is stored and manipulated in the form of binary digits, i.e., 0s and 1s.
To facilitate the handling of this data, various numbering systems have been developed, such as the
decimal system, binary system, octal system, and hexadecimal system.
In this section, we will focus on these four information coding systems and how they are used in
computing. We will first describe the decimal system, which is the most commonly used numbering
system in our daily lives, before moving on to binary, octal, and hexadecimal systems.

3.1. Decimal Encoding


In our daily lives, we use a base-10 numerical system (decimal system) composed of symbols
{0,1,2,3,4,5,6,7,8,9}. This system relies on the position of symbols, with each symbol holding a different
value based on its position within a number. For instance, the digit 2 in the number 253 has a distinct
value compared to that in 523. As illustrated in the figure below, the digit 2 in 253 represents hundreds,
whereas the digit 2 in 523 represents tens. This positional notation system simplifies numerical
representation and calculations.

8
Chapter 1: Introduction to Computer Science

3.2. Binary Encoding


The binary system is fundamental in computer science and digital electronics, as it serves as the
foundation for representing and processing all data and instructions in computers and digital devices.
Similar to what we've seen with decimal encoding, the binary numbering system uses only two
symbols: 0 and 1 to represent binary numbers. The binary system operates by utilizing powers of 2 to
represent numbers. Each binary digit (0 or 1) in a binary number represents a specific power of 2.
Starting from the right and moving left, the first position represents 2 to the power of zero (which is 1),
the second position represents 2 to the power of one (which is 2), the third position represents 2 to the
power of two (which is 4), and so on.
For example, the binary number "1001" represents the decimal number 9 (as shown below).
0 1 2 3
(1001) = 1 ∗ 2 + 0 ∗ 2 + 0 ∗ 2 + 1 ∗ 2 = 1 + 0 + 0 + 8 = 9
2

The table below presents decimal numbers from 0 to 9 written in base 2 (binary):

3.3. Other Coding Systems (Octal and Hexadecimal)


The octal numbering system, in contrast, employs 8 symbols: the digits from 0 to 7, represented
as {0, 1, 2, 3, 4, 5, 6, 7}. This system is used to represent numbers in base 8.
The hexadecimal system utilizes 16 symbols: the digits from 0 to 9 and the letters A, B, C, D, E, F,
denoted as {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}. It is employed to represent numbers in base
16.
Here are examples of numbers in different bases:
Decimal (Base 10): 13
Binary (Base 2): 1101
Octal (Base 8): 15
Hexadecimal (Base 16): D
The table below provides conversions between various bases.

9
Chapter 1: Introduction to Computer Science

3.4. Conversion of Numbers from One Coding System to Another


Information coding systems, such as the decimal, binary, octal, and hexadecimal systems, are used for
storing and manipulating data in computing. To facilitate the conversion of numbers from one system to
another, it's essential to understand the methods of conversion between different numerical bases.
In this section, we will focus on the methods of converting between different numerical bases, which are
crucial for comprehending how data is stored and manipulated in computer systems. By gaining this
understanding, you'll be equipped to work effectively with data in various formats and bases in the field
of computer science.
a) Conversion from Any Base to Decimal

Method

If we want to convert a number expressed in base X to the decimal base (base 10), we need to consider
the different digits of the number and their respective weights. The weight of a digit is determined by
its position in the number, with the rightmost digit having the lowest weight and the leftmost digit
having the highest weight.
To perform the conversion, we multiply each digit by the power of the base X corresponding to its
position and then add up all the results to obtain the decimal value of the number.
It's important to note that this method of conversion can be used to convert numbers from any base to
the decimal base.
The explained rule is illustrated in the figure below, where we want to convert a number that is in base
X and contains the digits a ,...,a ,a ,a to base 10.
n 2 1 0

Conversion of 10100111 to Decimal Example

Begin by multiplying each binary digit by 2 raised to the power of its position (starting from counting
zero for the rightmost position). Then, add up all the products obtained.

10
Chapter 1: Introduction to Computer Science

b) Conversion from Decimal Base to Any Base

Method

To convert a number from any base to the decimal base (base 10), the division method is used:
1. Divide the number by the base of the original number; the result is the quotient, and the
remainder is the first digit of the number in base 10.
2. Repeat the operation using the quotient as the new number to be divided, and continue until
you get a quotient equal to 0. The digits obtained at each step are the digits in base 10.
3. Read the obtained digits from bottom to top; they correspond to digits of increasing weight.
4. Concatenate them to obtain the decimal value of the number.
The process is demonstrated in the figure below.

The figure above illustrates the process of converting a decimal number A into base X using the
successive division method. This involves repeatedly dividing A by X, while noting the remainder of
each division. The obtained remainders are then concatenated in reverse order to provide the final
result of the conversion.

Conversion of a decimal number 167 to binary Example

The figure below demonstrates the application of the rule to convert the decimal number 167 into
binary.

11
Chapter 1: Introduction to Computer Science

c) Conversion from Octal Base to Binary Base

Method

To convert an octal number to binary, follow these steps:


1. Write down the octal number you want to convert. For this example, let's use the octal number
357.
2. Break the octal number into its individual digits: 3, 5, and 7.
3. Convert each octal digit to its 3-bit binary equivalent using a conversion table:
3 in octal = 011 in binary
5 in octal = 101 in binary
7 in octal = 111 in binary
4. Put the binary equivalents together to form the full binary number: 357 in octal = 011 101 111 in
binary.
So in this example, the octal number 357 converted to the binary number 011 101 111. The key is
breaking down each octal digit and finding its corresponding 3-bit binary equivalent.

Convert the octal number 51 to binary Example

To convert the octal number 51 to binary, we replace each octal digit with its binary equivalent: 5 = 101,
1 = 001. This results in the binary number 101001.

d) Conversion from Binary Base to Octal Base

Method

To convert a binary number to octal, follow these steps:


1. Write down the binary number you want to convert. For this example, let's use 10010110.
2. Group the binary digits into sets of 3 bits, starting from the right: 10010110 becomes: 10 010
110
3. Notice the last group on the left side only has 2 bits. We need to pad it with zeros to make a
complete 3-bit group: 010 010 110
4. Replace each 3-bit binary group with its octal equivalent, based on the binary to octal
conversion table.
010 in binary = 2 in octal
010 in binary = 2 in octal
110 in binary = 6 in octal
5. Put the octal equivalents together to form the octal decimal number.

12
Chapter 1: Introduction to Computer Science

6. 10010110 in binary = 226 in octal


So in this example, the binary number 10010110 converts to the octal decimal number 226. The key is
grouping the binary digits into sets of 3 and finding the octal equivalent of each group.

Convert the binary numbers 101001 and 1011011 to octal Example

To convert the binary number 101001 to octal, we group the digits in sets of three: 101 and 001.
This results in octal 51.
To convert the binary number 1011011 to octal, we group the digits in sets of three, starting
from the right: 1-011-011, which gives us the octal number 1-3-3, or 133

e) Conversion from Hexadecimal Base to Binary Base

Method

To convert a hexadecimal number to binary, you need to break down each hexadecimal digit into its
4-bit binary equivalent. Follow these steps:
1. Write down the hexadecimal number you want to convert. For this example, let's use the
hexadecimal number A5C.
2. Break the hexadecimal number into its individual digits: A, 5, and C.
3. Look up the binary equivalent of each hexadecimal digit. Use a conversion table that we have
seen before.
A in hexadecimal = 1010 in binary
5 in hexadecimal = 0101 in binary
C in hexadecimal = 1100 in binary
Put the binary equivalents together to form the full binary number.
A5C in hexadecimal = 1010 0101 1100 in binary
So in this example, the hexadecimal number A5C converts to the binary number 1010 0101 1100. The
key is breaking down each individual hexadecimal digit and finding its corresponding 4-bit binary
equivalent.

Convert the hexadecimal number 1A9 to binary Example

The hexadecimal number 1A9 converts to 0001 1010 1001 in binary, as each hexadecimal digit is
equivalent to a group of four binary digits.

f) Conversion from Binary Base to Hexadecimal Base

Method

To convert a binary number to hexadecimal, follow these steps:


1. Write down the binary number you want to convert. For this example, let's use 110110101.
2. Group the binary digits into sets of 4 bits, starting from the right.
3. 110110101 becomes: 1 1011 0101
4. Notice the last group on the left side only has 1 bit. We need to pad it with zeros to make a
complete 4-bit group: 0001 1011 0101

13
Chapter 1: Introduction to Computer Science

5. Now replace each group with its hexadecimal equivalent:


0001 in binary = 1 in hexadecimal
1011 in binary = B in hexadecimal
0101 in binary = 5 in hexadecimal
6. Put the hexadecimal digits together: 110110101 in binary = 1B5 in hexadecimal
So the binary number 110110101 converts to the hexadecimal number 1B5. When the binary number
doesn't perfectly split into groups of 4, we pad the incomplete group on the left side with zeros to make
it a complete 4-bit group before converting to hexadecimal. This allows us to easily convert any binary
number to hexadecimal.

Convert the binary number 110101001 to hexadecimal Example

To convert the binary number 110101001 to hexadecimal, we can divide it into two groups of four digits
and one group of a single digit: 1-1010-1001. Then, using the binary-to-hexadecimal correspondence,
we obtain the hexadecimal number 1A9.

g) Conversion from Any Base to Any Base ( 1st Method)

Method

To convert a number from base X to base Y, where both bases X and Y are different from 10, you can
follow these steps:
1. Convert from Base X to Base 10:
Use the method we previously discussed to convert the number from base X to base 10.
Here's a brief recap of that method:
Start from the rightmost digit of the number (least significant digit).
Multiply each digit by the base raised to the power of its position, starting from 0 for
the rightmost digit.
Sum up all the results to obtain the decimal equivalent.
2. Convert from Base 10 to Base Y:
Now that you have the decimal equivalent, you can convert it to base Y using the method
that we have seen previously. Here's a brief recap of that method:
Divide the decimal number by the base Y.
Keep track of the remainders at each step.
Continue dividing until the quotient becomes zero.
The remainders, when read from bottom to top, will give you the number in base Y.
So, to convert a number from base X to base Y where both bases are different from 10, you first convert
it to base 10 and then from base 10 to the desired base Y. This method works for any pair of bases X and
Y.

14
Chapter 1: Introduction to Computer Science

h) Conversion from Octal Base to Hexadecimal Base ( 2nd Method)

Method

To convert a number from octal to hexadecimal using binary as an intermediary, you can follow these
steps:
1. Convert the octal number to binary:
Each octal digit (0-7) can be represented as a 3-bit binary equivalent. Convert each octal digit
separately.
2. Group the binary digits in sets of four bits from right to left:
Each group of four binary digits can be directly mapped to a hexadecimal digit (0-15). If the left most
group has fewer than four bits, pad with zeros on the left.
3. Convert each 4-bit group to the corresponding hexadecimal digit:
Once the binary number is grouped, convert each group of four bits into its hexadecimal equivalent.

Example

Convert 754 from octal to hexadecima:


1. Convert octal to binary:
7 (octal) → 111 (binary)
5 (octal) → 101 (binary)
4 (octal) → 100 (binary)
Now, combine these binary values: So, (754) 8 = (111101100) 2
2. Group the binary digits into sets of four bits:
We group the binary number into sets of 4 bits, starting from the right. If the left most group has fewer
than 4 bits, pad it with zeros on the left:
(111101100) 2 =>(0001 1110 1100 )2
[Link] each group of 4 binary digits to hexadecimal:
0001 → 1 (hexadecimal)
1110 → E (hexadecimal)
1100 → C (hexadecimal)
Now, the hexadecimal value is: (0001 1110 1100 )2 = (1EC) 16
So, (754) 8= (1EC) 16

i) Conversion from Hexadecimal Base to Octal Base ( 2nd Method)

Method

To convert a number from hexadecimal to octal using binary as an intermediary, follow these steps:
1. Convert the hexadecimal number to binary:
Each hexadecimal digit (0-15) can be represented as a 4-bit binary equivalent. Convert each
hexadecimal digit to its corresponding 4-bit binary form.

15
Chapter 1: Introduction to Computer Science

2. Group the binary digits in sets of three bits from right to left:
Each group of three binary digits can be directly mapped to an octal digit (0-7). If the leftmost group
has fewer than three bits, pad with zeros on the left.
3. Convert each 3-bit group to the corresponding octal digit:
Once the binary number is grouped into sets of three, convert each group into its octal equivalent.

Example

Convert 1EC from hexadecimal to octal:


1. Convert hexadecimal to binary:
1 (hexadecimal) → 0001 (binary)
E (hexadecimal)→ 1110 (binary)
C (hexadecimal) → 1100 (binary)
Now, combine these binary values: So, (1EC) 8 = (111101100) 2
2. Group the binary digits into sets of three bits:
We group the binary number into sets of 3 bits, starting from the right. If the left most group has fewer
than 3 bits, pad it with zeros on the left:
(111101100) 2 =>(111 101 100 )2
[Link] each group of 3 binary digits to octal:
111 → 7 (octal)
101 → 5 (octal)
100→ 4 (octal)
Now, the octal value is: (111 101 100 )2 = (754) 8
So, (1EC) 16 = (754) 8

3.5. Operations between Binary Numbers


In addition to methods of conversion between different numerical bases, it's also important to
understand how to perform basic arithmetic operations with binary numbers. In this section, we will
explore basic arithmetic operations in binary, including addition, subtraction, multiplication, and
division. Understanding these operations is crucial for efficiently manipulating binary data in computing.
a) Binary Addition

Method

Binary addition works similarly to decimal addition, but in this case, we only use the binary digits 0 and
1. To add two binary numbers, we use the carry-over method.
The carry-over method works as follows: we add the binary digits from right to left, just as we would
add decimal digits. If the sum of the digits is 0 or 1, there is no carry. However, if the sum of the digits is
2 (10 in binary) or more, a carry is generated, and the resulting digit is written as the remainder of that
sum.

Add 1111 (15 in decimal) to 111 (7 in decimal) Example

To add 1111 (15 in decimal) to 111 (7 in decimal), we perform bit-by-bit addition, starting from the right
and moving to the left.

16
Chapter 1: Introduction to Computer Science

b) Binary Subtraction

Method

Binary subtraction uses the same process as decimal subtraction, except it is done with only 0s and 1s.
We start by writing the two binary numbers one above the other, with the number being subtracted on
the bottom.
Then we subtract each column starting from the right, just like in decimal subtraction. When
subtracting a 0, nothing changes. But when subtracting a 1, we have to "borrow" from the next column
to the left.

Subtraction of 1000 (8 in decimal) and 111 (7 in decimal) Example

To subtract 1000 (8 in decimal) and 111 (7 in decimal), we perform bit-by-bit subtraction, starting from
the right and moving to the left.

c) Binary Multiplication

Method

Binary multiplication uses the same process as decimal multiplication, but only with 0s and 1s. We use
the shift-and-add method:
1. Write the two binary numbers to multiply one above the other, with the multiplicand on top and
multiplier below.
2. Start from the rightmost column of the multiplier.
3. If the bit is 1, write down the multiplicand as is. If it is 0, write down zeros.
4. For subsequent bits, shift everything you have written so far by one column to the left. Then if
the bit is 1, add a copy of the multiplicand. If it is 0, add zeros.
So binary multiplication uses the shift-and-add method, shifting previous results left and selectively
adding the multiplicand based on the multiplier bits.

Multiply 1111 (15 in decimal) by 10 (2 in decimal) Example

To multiply 1111 (15 in decimal) by 10 (2 in decimal), we perform the multiplication as shown in the
figure below.

17
Chapter 1: Introduction to Computer Science

d) Binary Division

Method

Binary division uses the same process as decimal division, but only with 0s and 1s. We use the
subtraction-and-shift method:
1. Write the dividend on top and divisor below, aligned on the right.
2. Check if the divisor goes into the 2 rightmost bits of the dividend. If yes, subtract the divisor and
write a 1 above for the quotient bit. If no, write a 0.
3. Shift the divisor and partial remainder left by 1 column. Bring down the next digit from the
dividend.
4. Repeat steps 2 and 3 until there are no more digits left in the dividend.
So binary division uses subtraction and shifting to "chop down" the dividend bit by bit until nothing is
left.

Division of 10101 (21 in decimal) by 100 (4 in decimal) Example

To divide 10101 (21 in decimal) by 100 (4 in decimal), we follow the steps shown in the figure below.

4. Computer operating principles


4.1. The general structure of a computer
a) What is a computer ?
Computers are integral to our daily lives, but how do they truly operate? In this section, we will explore
the general structure of a computer, its essential components, and their functioning. We will also delve
into the speed of the processor and the various mass storage units used in computers. This section
aims to provide a comprehensive understanding of computer operation, emphasizing the key elements
required for its proper functioning.

18
Chapter 1: Introduction to Computer Science

Definition

A computer is an electronic device that can perform various tasks by executing a set of instructions or
programs. It processes data, performs calculations, stores and retrieves information, and
communicates with other devices. Computers come in various forms, from the standard desktop
(personal computers (PCs)) to movable devices like laptops, tablets, smartphones and more, and they
are widely used for a wide range of applications in business, education, entertainment, research, and
many other fields. The basic principles of how a computer operates are generally the same whatever its
purpose is.

Fundamental

The figure presented below provides an overview of the general structure of a computer and its main
components, which are essential for the proper functioning of the computer. It comprises three
fundamental components: the processor (CPU or central processing unit), the main memory, and
input/output devices. The processor is located at the center of the structure, with the other
components interacting with it. Indeed, the processor serves as the computer's brain, responsible for
executing instructions and coordinating the operations of all other components.

b) Central Processing Unit (CPU)


"Central Processing Unit" (CPU) refers to the primary hardware component of a computer that carries
out instructions and performs calculations in a computer program. It is often considered the "brain" of
the computer because it executes most of the actual computations and controls the other hardware
components (such as input and output data (I/O)).
Certainly, the Central Processing Unit (CPU) is a complex electronic component , composed of several
internal components that work together to execute instructions and perform calculations. Here are
some of the key internal components of a CPU:
Arithmetic Logic Unit (ALU): The ALU is responsible for performing arithmetic and logical
operations. It can perform addition, subtraction, multiplication, division, and logical operations
like AND, OR, and NOT. The ALU's results are used for data processing.

19
Chapter 1: Introduction to Computer Science

Control Unit: The Control Unit manages and coordinates the operations of various CPU
components. It fetches instructions from memory, decodes them, and controls the execution of
those instructions. It ensures that instructions are executed in the correct sequence.
Registers: Registers are small, high-speed storage locations within the CPU that are used for
temporary data storage during processing. The CPU has various types of registers, including the
program counter (PC), instruction register (IR), and general-purpose registers for data storage
and manipulation.
Cache Memory: Modern CPUs often have multiple levels of cache memory. These caches store
frequently used data and instructions to reduce the time it takes to access them from slower
main memory (RAM). L1, L2, and L3 caches are common in many CPUs.
Clock Generator: The clock generator produces clock signals that synchronize the various
operations of the CPU. Clock speed, measured in gigahertz (GHz), determines how many cycles
of instructions the CPU can execute per second.
Bus Interface Unit: This unit manages the flow of data between the CPU and other parts of the
computer, such as RAM and peripheral devices. It interfaces with the system bus and the data
bus.
FPU (Floating-Point Unit): Some CPUs have a dedicated FPU for handling floating-point
arithmetic operations, which are common in scientific and engineering calculations.
Microcode Control Unit: In some CPUs, microcode is used to control the execution of complex
instructions. The microcode control unit interprets higher-level instructions into
microinstructions that the CPU can execute.
Pipeline: Many modern CPUs use pipelining, where multiple instructions are in different stages
of execution simultaneously. This enhances CPU throughput and overall performance.
Execution Units: Some CPUs have multiple execution units for handling different types of
instructions simultaneously, such as integer operations, floating-point operations, and vector
operations.
These are some of the primary components within a CPU. Their design and organization can vary
among different CPU architectures, but their collective function is to execute instructions and perform
the essential processing tasks of a computer.

Image 1

c) The main memory

Definition

Main memory, also known as MC, is an essential component of a computer that is used to store data
and programs for quick and easy access. There are two types of main memory:
1. RAM stands for "Random Access Memory." It is a type of computer memory that is used for the
temporary storage of data that the computer's central processing unit (CPU) is actively working
on. RAM is volatile memory, meaning that its contents are lost when the computer is powered off
or restarted.

20
Chapter 1: Introduction to Computer Science

RAM is a critical component in a computer because it provides fast and easily accessible storage
for programs and data that are currently in use. When you open a program or file, it is loaded
into RAM, which allows the CPU to quickly read and write data from and to this memory,
significantly speeding up the computer's performance compared to accessing data from slower
storage devices like hard drives or solid-state drives.
RAM is a type of memory in a computer that enables fast and temporary data storage for active
programs and processes, contributing to the computer's overall speed and responsiveness (in
the left of the figure).
2. ROM stands for "Read-Only Memory." It is a type of computer memory that stores data that
cannot be easily modified or overwritten by normal computer processes. Unlike RAM (Random
Access Memory), which is volatile and temporary, the data stored in ROM is typically non-volatile
and permanent.
Here are some key characteristics of ROM:
1. Non-Volatile: Data stored in ROM remains intact even when the computer is powered off
or restarted. This permanence is useful for storing essential software and firmware that
must be retained even when there is no electrical power.
1. Read-Only: As the name implies, data in ROM is generally read-only, meaning it cannot be
easily written to or modified by standard computer operations. This makes it suitable for
storing firmware, BIOS (Basic Input/Output System), and other critical instructions that
should not be altered.
1. Boot Instructions: ROM is often used to store the initial boot instructions that a computer
needs to start up. When you turn on a computer, it typically reads these instructions from
ROM to initiate the boot process.
1. Embedded Systems: ROM is commonly used in embedded systems, such as in
microcontrollers, to store the software and firmware needed for the operation of devices
like appliances, smartphones, and specialized industrial equipment.
1. Variants: There are different types of ROM, including Mask ROM (permanently
programmed during manufacturing), PROM (Programmable ROM, which can be written to
once), EPROM (Erasable Programmable ROM, which can be reprogrammed with UV light),
and EEPROM (Electrically Erasable Programmable ROM, which can be electrically
rewritten).
ROM is a type of computer memory that stores data that is read-only and generally permanent,
making it suitable for storing critical software, firmware, and boot instructions in a computer
system (in the right of the figure).
Main memory, especially RAM, plays a critical role in the overall performance of a computer because it
provides fast and temporary storage for actively running programs and data, allowing the CPU to
access them quickly for processing.

Image 2

21
Chapter 1: Introduction to Computer Science

d) Input/Output devices

Definition

Input/Output (I/O) devices are hardware components that allow a computer to interact with the
outside world, either by receiving data from external sources (inputs) or by sending data to external
devices (outputs). These devices facilitate communication and data transfer between the computer
and its users, as well as with other devices or systems.

Extra

Computer devices can be categorized into three main types: input devices, output devices, and storage
devices.
Input Devices: These devices are used to collect data for the computer. Examples include characters
entered using a keyboard, actions performed with a mouse, or documents scanned using a scanner.
Output Devices: Output devices are used to convey information to the user. This includes displaying
data on a screen, printing documents on paper, or transmitting audio through speakers.
Storage Devices: Storage devices are used to store data permanently, ensuring it remains available
each time the computer is turned on. These devices can include hard drives, solid-state drives, and
external drives, among others.
This categorization helps us understand the various roles and functions of computer devices in
gathering, presenting, and preserving data within the computer system.

Image 3

22
Chapter 1: Introduction to Computer Science

Image 4

Storage devices come in various types, each with its own characteristics and use cases. Here are some
main kinds of storage devices:
Hard Disk Drives (HDDs): These are traditional mechanical storage devices that use spinning
disks (platters) to store data. They offer relatively high capacity but are slower compared to
solid-state drives.
Solid-State Drives (SSDs): SSDs use NAND flash memory to store data. They are faster, more
durable, and more power-efficient than HDDs. SSDs are commonly used for both personal and
enterprise storage.
External Drives: These are portable storage devices that can connect to a computer via USB,
Thunderbolt, or other interfaces. They can be HDDs or SSDs and are used for backup, data
transfer, and additional storage.
USB Flash Drives: Also known as thumb drives or memory sticks, these are small, portable flash
memory devices used for data storage and transfer. They connect to a computer's USB port.
Memory Cards: These small, removable flash memory cards are commonly used in cameras,
smartphones, and other portable devices to store photos, videos, and data.
CDs and DVDs: Optical storage media like CDs (Compact Discs) and DVDs (Digital Versatile Discs)
are used for distributing software, music, movies, and data. They are read-only or read-write,
depending on the type.
Cloud Storage: This isn't a physical storage device but rather a service that allows users to store
data remotely on servers maintained by cloud service providers. Examples include Google Drive,
Dropbox, and Amazon S3.

23
Chapter 1: Introduction to Computer Science

The choice of storage device depends on factors such as capacity requirements, speed, durability, and
portability, as well as the specific use case. Many people and organizations use a combination of these
storage types to meet their diverse storage needs.

Image 5

Image 6

4.2. How does a computer work?

Fundamental

A computer works by executing a series of instructions in a systematic and logical manner. The process
involves several key components and stages:
Input: Information is entered into the computer through input devices such as keyboards, mice,
touchscreens, or scanners. This input can be in the form of text, numbers, images, or other data.
Processing: The central processing unit (CPU) of the computer is responsible for processing the
input data. It executes instructions stored in the computer's memory, performing calculations,
logical operations, and data manipulations.
Memory: The computer's memory, including RAM (Random Access Memory), temporarily stores
data and program instructions that the CPU needs to access quickly during processing. RAM is
volatile, meaning its contents are lost when the computer is powered off.
Storage: Data that needs to be retained beyond the computer's current session is stored on non-
volatile storage devices, such as hard disk drives (HDDs) or solid-state drives (SSDs). These
devices provide long-term storage for programs, documents, and other data.
Output: The processed data is sent to output devices, such as monitors, printers, speakers, or
storage media, to make the results of the computation available to the user or for further use.

24
Chapter 1: Introduction to Computer Science

In summary, a computer operates by taking input, processing it through its CPU and memory, storing
data as needed, producing output for the user, and managing these operations through a combination
of hardware and software components. The precise functioning of a computer depends on its
architecture and the specific tasks it's designed to perform.

How does a computer work?

How does a computer work?

4.3. The speed of a processor


The speed of a processor, often referred to as its "clock speed" or "clock frequency," is a measure of
how quickly the processor can execute instructions. It is typically measured in Hertz (Hz) or more
commonly in gigahertz (GHz), which is equal to one billion Hertz.
A processor's speed is determined by the frequency at which its internal clock generates electrical
pulses, which regulate the timing of instructions and operations. Higher clock speeds generally mean
that the processor can execute instructions more quickly, leading to better overall performance.
However, it's important to note that clock speed is just one factor influencing a processor's
performance. Modern processors are designed with multiple cores, which allow them to perform
multiple tasks simultaneously. Additionally, factors like the architecture, cache size, and the efficiency
of the processor's microarchitecture also play a significant role in determining overall performance.
In summary, the speed of a processor, often measured in gigahertz (GHz), indicates how quickly it can
execute instructions, but it is not the sole determinant of a processor's performance. Other factors and
features should also be considered when assessing a processor's capabilities.

Note

1 Hz (hertz): It signifies one operation per second.


Kilohertz (KHz): It signifies 1,000 operations per second.

25
Chapter 1: Introduction to Computer Science

Megahertz (MHz): It signifies 1,000,000 operations per second.


Gigahertz (GHz): It signifies 1,000,000,000 operations per second.
Terahertz (THz): It signifies 1,000,000,000,000 operations per second.

Image 7

Example

How to convert Gigahertz to MHz and KHz?


2 GHz= 2*103 MHz = 2* 103 * 103 KHz

2 GHz= 2* 103 * 103 * 103 Hz


So: 2 GHz= 2* 109 Hz

4.4. Mass storage units


Mass Storage Units refer to devices or technologies used for the storage capacity of hard drives, USB
drives, memory cards etc. These units are designed to store significant amounts of information, making
them suitable for applications where substantial storage capacity is required. As we have seen earlier,
the most basic storage unit is the bit, which can take values of 0 or 1. There is also the byte, which is
equivalent to 8 bits. The difference between the two lies in their size: a bit represents a part of a byte,
while a byte represents 8 bits."

Example

Answer the following questions:

26
Chapter 1: Introduction to Computer Science

When dealing with mass storage units and data sizes, you'll often encounter the following units:
1 Byte = 8 bits = 2 3 bits

1 Kilo Byte (KB) = 210 Byte

1 Mega Byte (MB) = 210 KB


1 Giga Byte (GB) = 210 MB
1 Tera Byte (TB) = 210 GB

Mass storage units

Example

10 MB = 10 * 210 * 210 = 10 * 220 Byte


2,5 KB = 2,5 * 2-10 * 2-10 = 2,5 * 2 -20 GB

8 GB = 23 * 2-10 = 2-7 TB

27
Chapter 1: Introduction to Computer Science

5. computer's hardware
5.1. What means Computer’s Hardware ?
Computer hardware refers to the physical components of a computer system, including the central
processing unit (CPU), memory, storage devices, input and output devices, and all other tangible parts
that make up the computer. These components work together to process data and execute instructions
in a computer.

Some Hardware devices

Reminder

Computer devices (Hardware) fall into three main types:


Input Devices: Collect data for the computer, e.g., keyboard, mouse, scanner.
Output Devices: Display information for users, e.g., screen, printer, speakers.
Storage Devices: Store data permanently, e.g., hard drives, SSDs, external drives.
This classification clarifies the roles of these devices in gathering, presenting, and preserving data in
the computer system.
The details are explained in the previous section (Input/Output devices)

6. computer's software
6.1. What means Computer’s Software?
Computer software encompasses a set of programs and instructions that enable a computer's
hardware to perform various tasks and functions, controlling and coordinating its operations. It's the
digital component that tells the physical computer what to do. Here are some common kinds of
computer software:

Operating system (OS) Definition

An operating system (OS) is system software that manages computer hardware and provides services
for software applications. It acts as an intermediary between users and the computer hardware,
facilitating the execution of programs and the management of hardware resources.

28
Chapter 1: Introduction to Computer Science

Application software Definition

Application software, often called "apps," refers to programs and software designed for specific tasks or
applications, such as word processing, spreadsheet analysis, web browsing, or gaming. These software
applications enable users to perform various functions on computers and devices.

Programming languages Definition

Programming languages are formal systems used to communicate instructions to computers and
create software. They have specific syntax and rules for writing code that performs various tasks, from
web development to data analysis.

29

You might also like