Chapter 2
Chapter 2
Applications
2025/2026
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
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.
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).
6
Chapter 1: Introduction to Computer Science
7
Chapter 1: Introduction to Computer Science
8
Chapter 1: Introduction to Computer Science
The table below presents decimal numbers from 0 to 9 written in base 2 (binary):
9
Chapter 1: Introduction to Computer Science
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
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
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.
The figure below demonstrates the application of the rule to convert the decimal number 167 into
binary.
11
Chapter 1: Introduction to Computer Science
Method
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.
Method
12
Chapter 1: Introduction to Computer Science
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
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.
The hexadecimal number 1A9 converts to 0001 1010 1001 in binary, as each hexadecimal digit is
equivalent to a group of four binary digits.
Method
13
Chapter 1: Introduction to Computer Science
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.
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
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
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
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.
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.
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.
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.
To divide 10101 (21 in decimal) by 100 (4 in decimal), we follow the steps shown in the figure below.
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.
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
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
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.
Note
25
Chapter 1: Introduction to Computer Science
Image 7
Example
Example
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
Example
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.
Reminder
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:
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, 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 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