0% found this document useful (0 votes)
25 views

Cours Computer Science 1

Uploaded by

alexenbuz
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)
25 views

Cours Computer Science 1

Uploaded by

alexenbuz
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
You are on page 1/ 24

People's Democratic Republic of Algeria

Ministry of Higher Education and Scientific Research


UUniversity of Algiers 1 Benyoucef Benkhedda
Faculty of Sciences
Department of Materials Science

Bachelor's Degree Course 1 (Semester 1).

Computer Science 1

Field: Material Sciences.

Email: a.boudjidj@univ-alger.dz Teacher: Mr. A.BOUDJIDJ


Course: computer science 1

Part 1: Office Automation & Web Technology


Part 2: Introduction to Algorithms
Objectives

This course is intended for first-year students specializing in material Sciences. The main objective of this

module is to learn the basic concepts of computer science (presenting the main units of a computer and

explaining their functioning as well as the principles of their use) which will be presented in Part 1: Office

Automation & Web Technology, and understanding the concept of algorithms, learning the methods of its

construction (Algorithmics) which will be presented in Part 2: Introduction to Algorithmics.


Part 1 of the course:
The first chapter is dedicated to an introduction to the module through a brief history of the evolution of
computing, the definition of the different types of computers that exist to this day, and we will end with
numbering systems.

In the second chapter, computer components will be detailed. Specifically, we will identify and define the role of
each of these components. This chapter will be concluded by explaining how a computer works according to the
principles of the Von Neumann machine.

Chapter 3 focuses on Operating Systems, or how to make computer components usable for the user. We will also
introduce some known types of OS.

Chapter 4 is dedicated to computer networks, wired networks: communication architectures, different


topologies, as well as the types of these networks according to the covered dimension are explained. As well as
the Internet and the Web.
Chapter 1 :Introduction to computer science

1- Introduction
2- A Brief Historical Overview of Calculating Machines
2.1. Abacus
2.2. Slide rule
2.3. First mechanical calculators
2.4. First programmable machines
2.5. Generations of Computers
3- Definitions
3.1 Computer science
3.2 Computer

4- Types of computers

4.1 Mainframe computer


4.2 Personal computers
4.3 PC tablets
4.4 Media center
Chapter 1 :Introduction to computer science

5- Numeral systems

5.1 Representation of a number in a numeral (numbering) system

5.2 Conversion from base 2 to base 10.

5.3 Conversion from base 10 to 2

5.4 Coding Fixed-point numbers

5.5 Converting a decimal real number to binary

5.6 Binary arithmetic

6- Vocabulary and computing units

7- Coding

7.1 Alphanumeric codes


1- Introduction

For centuries, humans have created and used various means and tools of calculation to improve the speed and accuracy of numerical
calculations. However, it was in the 20th century after World War II that a great technological advance was made in the field of
electronics, paving the way for the creation of programmable electronic machines (later called computers) and the birth of computer
science.
Computer science is currently undergoing an extremely rapid evolution, due to the miniaturization and reduction of production costs
of electronic components and the intensive development of programs and software for various applications. It can be seen that
computer science is now everywhere. In a few years, this technique has established itself in all areas without exception
(administration, industry, economy, medicine, games and leisure, in households, ...).

1
2- A Brief Historical Overview of Calculating Machines

Exploring the evolution of computing, we will center our attention on significant dates commonly mentioned in the context of
human-made calculating instruments.

2.1 Abacus
The abacus, invented in China a few centuries before Christ, was the first mechanical calculating instrument. It consists of a
rectangular frame with rods on which beads slide. It is used to perform calculations: addition, subtraction, multiplication, division.

Figure 1: Abacus
2
2- A Brief Historical Overview of Calculating Machines

2.2 Slide rule


In 1625, following the invention of logarithms, William Oughtred developed the slide rule. It was used by many engineers until the
appearance of electronic calculators in the mid-1970s. It allows for basic arithmetic operations, multiplication and division, to be
performed by a simple longitudinal movement of graduated scales, but not addition. It can also be used to perform more complex
operations, such as calculating square or cubic roots, logarithmic or trigonometric calculations.

Figure 2 :Slide rule

3
2- A Brief Historical Overview of Calculating Machines

2.3 First mechanical calculators


In 1642, Blaise Pascal invented the first mechanical calculator (using gears and teeth wheels) that was only capable of performing
additions and subtractions.
In 1673, Gottfried Leibniz improved the principle to make it capable of performing multiplications, divisions and even square roots.
(first mechanical calculators with 4 functions)

2.4 First programmable machines


- In 1801, Joseph-Marie Jacquard invented a system for programming a loom using a series of punched cards.
- In 1833, Charles Babbage imagined and attempted to build a programmable analytical machine (with a calculation unit, memory,
register, and input of data by punched card). Although his theory was correct, the lack of precise mechanical parts and public funding
prevented the construction of this machine.

4
2- A Brief Historical Overview of Calculating Machines

2.5 Generations of Computers


The computers have been classified into generations based on the technologies used for storage and processing of information
(memory and processors). The following table presents this classification as follows.

Generation Period Technologies Used


1 1938-1945 Electromechanical relays
2 1945-1956 Vacuum tubes
3 1956-1963 Transistors
4 1963-1971 Integrated circuits
5 1971- Present Microprocessors

5
3- Definitions

3.1 Computer Science


Definition of Computer science proposed by the French Academy in 1966: is the science of rational processing, particularly by automatic
machines, of information considered as the support of human knowledge and communication in technical, economic, and social fields.
It allows for the manipulation, management, organization, and storage of information. It is a field in perpetual evolution, due to the
progress of electronics and the evolution of software and programming techniques, A computer system consists of two parts:
hardware: the computer and its peripherals
software: a set of programs and data (stored on the hard drive)

3.2 Computer
A computer is an automatic information processing machine (in binary form) under the control of recorded programs. It can:
Acquire and store information,
Perform data processing received as input,
And output it in another form. Different types of data processed include texts, images, sounds, numbers, etc

6
4- Types of computers

4.1 Mainframe computer


En Mainframes are computers with high computing power, huge input-
output capacities, and a high level of reliability. They are used in large
companies to perform heavy calculations or process large amounts of
data. Mainframes are usually used in centralized architectures, of which
they are the core.

Figure 3: Mainframe IBM


4.2 Personal computers
Desktop computers, consisting of a chassis containing a motherboard
and allowing for the connection of various peripherals such as the
monitor.
Laptops or notebooks, consisting of a case with a foldable screen, a
keyboard, and a large number of built-in peripherals.
Figure 4: Laptop and desktop computer

7
4- Types of computers
4.3 PC tablets
Consists of a case incorporating a touch screen as well as a number of built-in peripherals..
4.4 Media center
Is a hardware and software system providing the following multimedia services:
• Reading multimedia files (image, sound, video);
• Broadcasting of these files;
• Listening to and recording radio or television broadcasts;
Digital, satellite, analog television;
Smartphone or intelligent phone: is an advanced mobile phone with the functions of a personal digital assistant, a digital camera,
and a laptop computer. Data entry is usually done through a touch screen or, less commonly, a keyboard or stylus

Smartphones
PC tablet Media center

Figure 5: Other types of computers


8
5- Numeral systems
In 1847, the mathematician George Boole invented the binary system.
In 1867, Charles Sanders Peirce found similarities between the binary system and an electric circuit switch.
In 1936, the American Claude Shannon proposed a union between binary numbers and electrical circuits, building upon the work of
Boole and others. Georges Stibitz and Samuel Williams designed a complex calculator based on the binary system.
In 1939, the ABC (Atanasoff Berry Computer), the first electronic computer, was created. It uses the binary system.

The binary system represents the language of computers today, and is the basis used in computing for the representation of
information at the machine level.
• A numbering system is a set of rules for representing numbers using signs or digits. The following are the main numbering
systems used:
- The binary numbering system exclusively uses the two digits 0 and 1 (which are then called "bits" - binary digits).
- The octal numbering system uses the eight digits 0, 1, 2, 3, 4, 5, 6, 7.
- The decimal numbering system is the most well-known, using the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
- The hexadecimal numbering system uses the sixteen digits0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Base in numbring system
The base in a numbering system is the number of elements used by the system. The base "n" uses "n" digits ranging from 0 to n-1: {0,
1, 2...n-1}. Examples:
Base 2 uses two digits {0,1}.
Base 10 uses ten digits {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.

9
5- Numeral systems

5.1 Representation of a number in a numeral (numbering) system


The numbers are presented in the form:
𝑵 = 𝒂𝒏−𝟏 𝒂𝒏−𝟐 𝒂𝒏−𝟑 ⋯ 𝒂𝟎 𝒃 With: 𝑏 : is the base of the numeral system.
𝑎𝑖 : the system symbole for, i=0,…, i=n-1 with 𝑎𝑖 < b

Exemple
• 𝑁1 = 18079 10 , where 𝑁1 is a number represented in the decimal system (𝑏=10) and [ 𝑎4 =1, 𝑎3 =8, 𝑎2 =0, 𝑎1 =7, 𝑎0 =9 ], the values
𝑎𝑖 < 𝑏.
• 𝑁2 = 1011001 2 , where 𝑁2 is a number represented in the Binaire system (𝑏=2) and [𝑎6 =1, 𝑎5 =0 𝑎4 =1, 𝑎3 =1, 𝑎2 =0, 𝑎1 =0, 𝑎0 =1
], the values 𝑎𝑖 < 𝑏.
• 𝑁3 = 756 8 , where 𝑁3 is a number represented in the Octal system (𝑏=8) and [𝑎2 =7, 𝑎1 =5, 𝑎0 =6 ], the values 𝑎𝑖 < 𝑏.
• 𝑁4 = 𝐴𝐵129 16 , where 𝑁4 is a number represented in the Hexadécimal system (𝑏=16) and [𝑎4 =A, 𝑎3 =B, 𝑎2 =1, 𝑎1 =2, 𝑎0 =9 ], the
values 𝑎𝑖 < 𝑏.
In a numeral system with base b, the general formula for representing a number N is as follows:

(𝑵) 𝒃 = σ𝒏𝒊=𝟎 𝒂𝒊 𝒃𝒊 = 𝒂𝒏 𝒃𝒏 + 𝒂𝒏−𝟏 𝒃𝒏−𝟏 + ⋯ + 𝒂𝟏 𝒃𝟏 + 𝒂𝟎


10
5- Numeral systems
5. 2 Conversion from base 10 to 2
To convert a number expressed in Decimal (base 10), to binary number (base 2) we have a method by successive divisions by B and
retaining the remainder each time until a quotient lower than the base B is obtained, in this case the number is written from left to right
starting with the last quotient going to the first remainder.
Exemples
From B=10 to B=2
Example X= 115 10
X= ? 2
X= 1110011 2

Result = 0, so Stop

X= 115 10 = 1110011 2

11
5- Numeral systems

5.3 Conversion from base 2 to base 10.

To pass from numeral system to another, we will apply the general formula

(𝑵) 𝒃 = σ𝒏𝒊=𝟎 𝒂𝒊 𝒃𝒊 = 𝒂𝒏 𝒃𝒏 + 𝒂𝒏−𝟏 𝒃𝒏−𝟏 + ⋯ + 𝒂𝟏 𝒃𝟏 + 𝒂𝟎 (*)


where
𝒊 represents the weight of the digits 𝒂𝒊

We consider the following number : N= 1011 2 , the number N is written in binary b=2

𝒂𝟑 𝒂𝟐 𝒂𝟏 𝒂𝟎
1 0 1 1

3 2 1 O 𝒊 Weight of numbers

So to write N in Decimal (b=10) we will apply the formula (*) as follows:


𝑁 = 1 ∗ 23 + 0 ∗ 22 + 1 ∗ 21 + 1 ∗ 20
𝑁 = 8 + 0 + 2 + 1 = 11
N= 1011 2 = 11 10
12
5- Numeral systems
5.4 Coding Fixed-point numbers

A decimal number is made up of an integer part and a fractional part after the decimal point. we must manipulate values which have a
non-zero fractional part (example real number), we always use the same numbering system (the same formula *), adding the negative
powers. In base B, this number X is written as follows:

𝒏
(𝑿) 𝑩 =෍ 𝒂𝒊 𝑩𝒊 = 𝒂𝒏 𝑩𝒏 + 𝒂𝒏−𝟏 𝑩𝒏−𝟏 + ⋯ + 𝒂𝟏 𝑩𝟏 + 𝒂𝟎 , 𝒃𝟏 𝑩−𝟏 + ⋯ + 𝒃𝒎 𝑩−𝒎
𝒊=𝟎

Exemples
• 128,75 = 𝟏 ∗ 𝟏𝟎𝟐 +𝟐 ∗ 𝟏𝟎𝟏 +𝟖 ∗ 𝟏𝟎𝟎 + 𝟕 ∗ 𝟏𝟎−𝟏 + 𝟓 ∗ 𝟏𝟎−𝟐
• 145,32 = 𝟏 ∗ 𝟏𝟎𝟐 +𝟒 ∗ 𝟏𝟎𝟏 +𝟓 ∗ 𝟏𝟎𝟎 + 𝟑 ∗ 𝟏𝟎−𝟏 + 𝟐 ∗ 𝟏𝟎−𝟐
Similarly for binary numbers, for example the number (111,011)
111,011 = 𝟏 ∗ 𝟐𝟐 +𝟏 ∗ 𝟐𝟏 +𝟏 ∗ 𝟐𝟎 + 𝟎 ∗ 𝟐−𝟏 + 𝟏 ∗ 𝟐−𝟐 +𝟏 ∗ 𝟐−𝟑
𝟏 𝟏 𝟏
= 𝟏 ∗ 𝟒 + 𝟏 ∗ 𝟐 + 𝟏 ∗ 𝟏 + 𝟎 ∗ 𝟐 + 𝟏 ∗ 𝟒 +𝟏 ∗ 𝟖

= 4 + 2 + 1 + 0 + 0,25 + 0,125
= 7,375 13
5- Numeral systems

5. 5 Converting a decimal real number to binary

For the whole part we use the division method as in the previous examples,
For the fractional part, we multiply it by 2, we note the integer part obtained and we start the operation again with the new
fractional part of the result, we stop when the fractional part becomes zero or when the desired precision is reached,
the sequence of integer parts obtained in the order of their calculation represents the fractional part in binary

Example: convert number 15,6875 to binary


• the whole part is 15 so : (𝟏𝟓)𝟏𝟎 = (𝟏𝟏𝟏𝟏)𝟐
• the fractional part 0,6875 so: (0,6875)𝟏𝟎 = (? )𝟐
• 0,6875∗2 = 𝟏, 𝟑𝟕𝟓 = 𝟏 + 𝟎, 𝟑𝟕𝟓 So : (𝟏𝟓,6875)𝟏𝟎 = (𝟏𝟏𝟏𝟏, 1011)𝟐
• 𝟎, 𝟑𝟕𝟓∗2 = 𝟎, 𝟕𝟓 = 𝟎 + 𝟎, 𝟕𝟓
• 𝟎, 𝟕𝟓∗2 = 𝟏, 𝟓 = 𝟏 + 𝟎, 𝟓 1011
• 𝟎, 𝟓∗2 = 𝟏 = 𝟏 + 𝟎

14
5- Numeral systems
5.6 Binary arithmetic • Multiplication
Example Example
• Addition
The addition table:
0+0=0
0+1=1
1+0=1
1 + 1 = 10 ,

• Substraction Division
The subtraction table: Example : 101100 / 100 (44/4=11)
0-0=0
0 - 1 = 1 and deduction of 1 Example 1001 11
1-0=1
1-1=0
11 11
0011
11
00

15
6- Vocabulary and computing units

Bit Units of Calculation

A bit is the smallest unit of binary information (a physical object ❖ Byte: 1 byte = 8 bits 1
with two states represents one bit). It is the basic element for the ❖ Kilobyte (KB): 1 kilobyte (KB) = 1024 (210 ) bytes
representation of information.
❖ Megabyte (MB): 1 megabyte (MB) = 1024 KB = (210 ) KB
Instruction ❖ Gigabyte (GB): 1 gigabyte (GB) = 1024 MB = (210 ) MB
A line of text containing an operation code and one or more
references to operands. ❖ Terabyte (TB): 1 terabyte (TB) = 1024 GB = (210 )GB
Byte
A byte is the primary unit of calculation for computer storage The representation of binary numbers
capacity. An octet is an information unit composed of 8 bits. The possible values to be represented are equal to 2 to
1 byte = 8 bits. the power of the number of bits, for example:
Word • 1 bit : 21 = 2 possible values, 0 or 1
A word is a group of bits considered as a single indivisible unit. The • 2 bits : 22 = 4 possible values, 00,01,10 or 11
size of a word is often used to classify processors (8 bits, 16 bits, 32 ⋮
8
• 8 bits : 2 = 256 possible values.
bits, 64 bits, etc.). A processor is faster if it can process longer
words.
16
7- Coding

• In literature, coding is the transformation of a clear message into a coded message. Coding is an operation that consists of
assigning a symbol or a sequence of abstract symbols or numbers to all characters (digits, letters, symbols, etc.), which is the case
for computers (association of a character with a number). Generally, coding is the transition from one representation of data to
another representation known by the machine. Character encoding allows for the creation, manipulation, and transfer of
heterogeneous objects (text, image, sound, etc.) via computer tools.
• Natural Binary Code
• This is the code in which a number is expressed in binary system. As we have seen previously, it is the simplest code and follows
the standard rules of positive number arithmetic.
• DCB Code “Decimal Coded Binary”
In the DCB code, 4 bits are used to code the digits of the decimal system according to their binary equivalent.
• Gray Code
The Gray code or the reflected binary code is a 5-bit code. This code is not weighted and cannot be used for arithmetic operations.

17
7- Coding
7.1 Alphanumeric Codes
The ASCII code (American Standard Code for Information Interchange)

is used for computer exchanges. Coded in 7 bits, it allows for the


encoding of 128 characters, including:
✓ The 26 letters of the Latin alphabet (in upper and lower case)
✓ The numbers
✓ Punctuation symbols including spaces
✓ Pairs of parentheses, brackets and braces
✓ A number of control signals.
All these correspondences are set by the American National Standards
Institutes.
ASCII code encoded on 8 bits
This is an extension of the extended ASCII code. It allows for the
encoding of characters in 8 bits, or 256 possible characters.
UNICODE (16 bits):
It allows for the encoding of characters in 16 bits and can represent characters belonging to several languages
(Arabic, Japanese, Korean, etc.): 65536 characters.

18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy