University of 20 August 1955 Skikda
Department of Technology
Module: computer science 01
Level: 1 LMD ST
Chapter 01
Introduction to
Computer Science
University year: 2023/2024
2 Chapter 01: Introduction to Computer Science
1/ Brief history of computer
1) Pre-generation (before 1945)
Pascaline
Invented by Blaise Pascal in 1642.
It was its limitation to addition and subtraction.
It is too expensive.
Leibniz Machine
Invented by Gottfried Wilhelm Leibniz in 1672.
The machine that can add, subtract, multiply and divide automatically.
Charles Babbage Machine
Gottfried
Invented in 1822 by Charles Babbage referred as a “Father of Computer”.
It is the first mechanical computer.
The history of computer is considered with the generations of a computer from first generation to fifth
generation.
2) First generation (1946- 1958)
ENIAC (Electronic Numerical Integrator and Computer). Developed in 1946 by John Presper Eckert
and John W. Mauchl.
It was the first electronic general-purpose computer.
[Link] [Link] 1 ST SKIKDA 2023/2024
3 Chapter 01: Introduction to Computer Science
The first computers used vacuum tubes for circuitry and magnetic drums for memory.
Vacuum tube
EDVAC (Electronic Discrete Variable Automatic Computer ), the First Stored Program
Computer
Designed by Von Neumann in 1952.
It has a memory to hold both a stored program as well as data.
3) Second generation (1959 -1964)
John Bardeen, William Shockley and Walter Brattain designed the transistor.
One transistor replaced the equivalent of 40 vacuum tubes.
The invention of transistor made it possible to make computers smaller, faster.
transistor
4) Third generation (1956 -1970)
In 1958 Jack kilby invented the Integrated Circuit (IC).
Computers for the first time became accessible to a mass audience because they were smaller
and cheaper than their predecessors.
Integrated Circuit
[Link] [Link] 1 ST SKIKDA 2023/2024
4 Chapter 01: Introduction to Computer Science
5) Fourth generation (1971-Present):
In 1971 Intel invented the first microprocessor.
The microprocessor brought the fourth generation of computers, as thousands of integrated
circuits were built onto a single silicon chip.
As these small computers became more powerful, they could be linked together to form
networks, which eventually led to the development of the Internet.
Fourth generation computers also saw the development of GUIs, the mouse and handheld
devices.
6) Fifth generation (Present-Future):
Based on Artificial Intelligence (AI): The study of computer systems that attempt to model
and apply the intelligence of the human mind.
There are now several applications based AI such as ChatGPT, Chatbots, self-driving…
2 / Computer system:
Computer hardware and software need each other, and neither of them can work independently.
Without them, computers would be of no use.
A computer system consists of two parts:
1) hardware part
2) Software part
1) Hardware part :
Definition of computer: Computer is a machine that manipulates data according to
a list of instructions.
Major types of computers:
Desktop Computer
Personal Computer
Laptop(NoteBook)
Smartphone
Tablet
WorkStation
SuperComputer
[Link] [Link] 1 ST SKIKDA 2023/2024
5 Chapter 01: Introduction to Computer Science
Computer Components:
Motherboard: A motherboard is a circuit board inside computers that stores electrical components
and helps them communicate.
Figure: Major Motherboard Components
CPU (Central Processing Unit):
The CPU is the brain of a computer, containing all the circuitry needed to process input, store
data, and output results.
Inside a CPU there are thousands of microscopic transistors
Without a CPU, we could not run programs on a computer.
Modern computers have the ability to support more than one core inside the main chip.
For example, there are dual-core CPUs, meaning there are two CPUs on the same chip and can
run two instructions at the same time.
Memory Card: There are two basic types of computer memory
[Link] [Link] 1 ST SKIKDA 2023/2024
6 Chapter 01: Introduction to Computer Science
Primary memory:
1) RAM = Random Access Memory
RAM is a type of computer memory that is used to temporarily store data that the
computer is currently using or processing.
RAM is volatile memory, which means that the data stored in it is lost when the power
is turned off.
RAM is typically used to store the operating system, application programs, and data
that the computer is currently using.
1) ROM = Read Only Memory :
ROM is used to permanently store data that does not need to be modified.
ROM is non-volatile memory, which means that the data stored in it is retained even
when the power is turned off.
ROM is typically used to store the computer’s BIOS (basic input/output system), which
contains the instructions for booting the computer.
Secondary memory
[Link] [Link] 1 ST SKIKDA 2023/2024
7 Chapter 01: Introduction to Computer Science
Different types of computer Ports:
Expansion Card Computer:
USB Card Sound Card Graphics Card
Wireless Card TV Card Network Card
2) Software part: The software in a computer system is any program, script, or application
running on it.
Classification of different type of software: The two main classifications of software
that all programs fit under are:
System software
Application software
[Link] [Link] 1 ST SKIKDA 2023/2024
8 Chapter 01: Introduction to Computer Science
System software:
The system software is an intermediator or a middle layer between the user and the hardware.
To make most hardware run we need to use software (driver).
An Operating System (OS) is a collection of software that manages computer hardware
resources and provides common services for computer programs. The operating system is the
most important type of system software in a computer system.
Examples of Operating Systems:
Windows (Vista,7,8,10,11 for PC)
Linux (Open source OS for Workstations like: Red Hat, Suse, Fedora, Ubuntu…)
macOS (Macintosh), used for Apple’s personal computers and workstations (MacBook,
iMac).
Android (Google’s Operating System for smartphones/tablets/smart watches)
iOS (Apple’s OS for iPhone, iPad, and iPod Touch).
Application software:
Software designed to help the user to perform specific tasks.
Examples of application software :
Microsoft office (Word, Excel, PowerPoint…)
Antivirus (Avast, Kaspersky…)
Facebook, Whatsapp, Twitter, Telegram…..
Games
Programming languages ( java, C, Pascal, Matlab, Python…..)
[Link] [Link] 1 ST SKIKDA 2023/2024
9 Chapter 01: Introduction to Computer Science
3/Information encoding in computer:
Introduction:
Computers can handle all types of data, including numbers, text, photos, audio, and video files.
As we all know, computers do not understand all types of data.
Solution: we use encoding to convert these into binary language.
Computer understands only binary language which uses 0 and 1 to represent any data.
Definition of information encoding: is the process of converting information from one
form to another so that it can be easily stored, processed, and transmitted.
Process of information encoding: The process of information encoding involves several
steps, depending on the context and the type of data being encoded.
1) The information will be expressed by a series of numbers.
2) Each number is encoded in binary form.
3) Each binary element is physically represented.
Data Storage Units: Data storage units are measures used to quantify the amount of digital
information a storage device can hold. Here are the most common data storage units, listed from
smallest to largest:
Unit of Data Equivalence
1 byte 8 bits
1 Kilobyte (KB) 1024 bytes
1 megabyte(MB) 1024 Kilobytes
1 gigabyte(GB) 1024 megabytes
1 Terabyte(GB) 1024 gigabytes
Number System
A number system is a method to represent (write) numbers.
Every number system has a set of unique characters or literals.
The count of these literals is called the radix or base of the number system.
The four different number systems used in the context of computer are shown in Figure.
[Link] [Link] 1 ST SKIKDA 2023/2024
10 Chapter 01: Introduction to Computer Science
Decimal number system is most commonly used by humans,
but digital systems understand binary numbers;
whereas Octal and hexadecimal number systems are used to simplify the binary representation
for us to understand.
Conversion between Number Systems: Now, we learn how to convert a number from
one number system to another number system for better understanding of the number representation in
computers.
1) Conversion from Decimal to other Number Systems:
To convert a decimal number to any other number system (binary, octal or hexadecimal), use the steps
given below:
1) Step 1: Divide the given number by the base value (b) of the number system in which it is to
be converted
2) Step 2: Note the remainder
3) Step 3: Keep on dividing the quotient by the base value and note the remainder till the quotient
is zero
4) Step 4: Write the noted remainders in the reverse order (from bottom to top)
A. Decimal to Binary Conversion:
[Link] [Link] 1 ST SKIKDA 2023/2024
11 Chapter 01: Introduction to Computer Science
B. Decimal to Octal Conversion :
C. Decimal to Hexadecimal Conversion
2) Conversion from other Number Systems to Decimal Number System
We can use the following steps to convert the given number:
Step 1: Write the position number for each alphanumeric symbol in the given number
Step 2: Get positional value for each symbol by raising its position number to the base value b symbol in
the given number
Step 3: Multiply each digit with the respective positional value to get a decimal value
Step 4: Add all these decimal values to get the equivalent decimal number
[Link] [Link] 1 ST SKIKDA 2023/2024
12 Chapter 01: Introduction to Computer Science
A. Binary number to decimal number
B. Octal number to decimal number
D. Hexadecimal number to decimal number
[Link] [Link] 1 ST SKIKDA 2023/2024
13 Chapter 01: Introduction to Computer Science
3) Conversion from Binary Number to Octal/Hexadecimal Number and Vice-Versa:
A binary number is converted to octal or hexadecimal number by making groups of 3 and 4 bits,
respectively, and replacing each group by its equivalent octal/ hexadecimal digit.
A. Binary Number to Octal Number :
B. Octal Number to Binary Number :
C. Binary Number to Hexadecimal Number
[Link] [Link] 1 ST SKIKDA 2023/2024
14 Chapter 01: Introduction to Computer Science
D. Hexadecimal Number to Binary Number
4) Conversion of a Number with Fractional Part :
In this section, we will learn about conversion of numbers with a fractional part.
A. Decimal Number with Fractional Part to Binary Number :
We can use the following steps to convert the fractional part of a decimal number to Binary number:
Step 1: Repeatedly multiply the fractional part by the base value 2 till the fractional part becomes 0.
Step 2: Use integer part from top to bottom to get equivalent number in that number system.
If the fractional part does not become 0 in successive multiplication, then stop the process when
getting the required number of bits.
In some cases, fractional part may start repeating, then stop further calculation.
Example 01: (4,25)10 = (???? )2
integer part(4) fractional part(0,25)
(4)10 = 0,25*2 = 0,5 = 0 + 0,5
(100)2 0,5*2 = 1,0 = 1 + 0,0
(4,25)10 = (100,01 )2
Example 02: (5,8)10 = (???? )2
Integer Part(5) Fractional Part(0,8)
(5)10 = (101)2 0,8*2 = 1,6 = 1+ 0,6
0,6*2 = 1,2 = 1+ 0,2
0,2*2 = 0,4 = 0+ 0,4
0,4*2 = 0,8 = 0+ 0,8
(5,8)10 = (101,1100 )2
[Link] [Link] 1 ST SKIKDA 2023/2024
15 Chapter 01: Introduction to Computer Science
B. Binary Number with Fractional Part to Decimal Number:
We can use the following steps to convert Binary Number with Fractional Part to Decimal Number:
Step 01: Compute positional value of each digit in the given number using its base value (2).
Step 02: Add the product of positional value and the digit to get the equivalent decimal number with
fractional part.
Example:
Binary Arithmetic:
1/ Binary Addition :
Binary addition works similarly to standard arithmetic but uses only two values, 0 and 1.
It follows set rules where 0+0 equals 0, 1+0 equals 1, 0+1 equals 1, and 1+1 equals 10 where
10 in binary is equivalent to 2 in decimal. (0 with carrying over 1 to the next bit, similar to
carrying in decimal addition).
Examples :
2/ Binary Subtraction
This operation is similar to the basic arithmetic subtraction performed on decimal numbers in
Maths.
Hence, when we subtract 1 from 0, we need to borrow 1 from the next higher order digit.
[Link] [Link] 1 ST SKIKDA 2023/2024
16 Chapter 01: Introduction to Computer Science
Examples:
3 / Binary Division
The process of binary division is performed on binary numbers and it is pretty similar to the
division of decimal numbers.
The base of the binary number system is 2. It uses only two digits (0 and 1) when performing
the division of binary numbers.
The binary division procedure involves both binary multiplication and binary subtraction.
Examples:
4/ Binary Multiplication
Binary multiplication is similar to the multiplication of decimal numbers.
We have a multiplier and a multiplicand. The result of multiplication results in a product. Since
only binary digits are involved in binary multiplication, we get to multiply only 0s and 1s.
Example:
[Link] [Link] 1 ST SKIKDA 2023/2024
17 Chapter 01: Introduction to Computer Science
Character Encoding
Encoding is the method or process of converting a series of characters, letters, numbers,
punctuation, and symbols into a special or unique format for transmission or storage in
computers.
Data is represented in computers using ASCII, ISCII, Unicode (UTF8, UTF16, UTF32)
encoding schemes.
UNICODE has been developed to incorporate all the characters of every written language of the
world.
ASCII Code:
ASCII (American Standard Code for Information Interchange)
ASCII was developed in 1960 for standardizing the character representation.
ASCII use 8 bits to represent characters.
But ASCII is able to encode character set of English language only.
Example:
character Decimal value Binary value
" 34 00100010
b 98 01100010
B 66 01000010
K 75 01001011
O 79 01001111
Example Encoding of data entered using keyboard
O = 79 = 01001111 K= 75= 01001011
[Link] [Link] 1 ST SKIKDA 2023/2024
18 Chapter 01: Introduction to Computer Science
Image Encoding:
The image is described point by point.
The points of an image are called pixels (picture elements).
Each pixel is described by a number indicating its color. The image is therefore represented by
a series of numbers.
The encoding of the image is done by successively writing the bits corresponding to each pixel.
Total of pixels = total pixels in line * total pixels in column
Pixel
Color Encoding
Each box in the table contains a value that represents the color of the associated pixel. Depending on
the number of colors allowed, the value is stored on a number of bits.
Color type bits per pixel
Black and white 1 bit
16 colors 4 bits
256 colors 8 bits
true color:16 million colors 24 bits
1. Encoding images with Black and White:
Each pixel is represented with a 1 bit (black=1, white=0)
[Link] [Link] 1 ST SKIKDA 2023/2024
19 Chapter 01: Introduction to Computer Science
2. Grayscale Images Encoding
If there are 256 levels of gray for pixels, we can represent each pixel using 8 bits.
11111111 = white , 00000000 = black
3. Encoding images with 256 colors:
Each pixel is represented with an 8-bit value that is an index into a palette of 256 colors.
[Link] [Link] 1 ST SKIKDA 2023/2024
20 Chapter 01: Introduction to Computer Science
4. Encoding images with RGB color:
Colors are represented as mixtures of red (R), green (G), and blue (B).
Each pixel is represented using three 8 bit values, one for each color component.
This representation allows for = 16,777,216 different colors.
This representation is also called “true color”.
(R,G,B)=(255,0,0) Red
(R,G,B)=(0, 255,0) Green
(R,G,B)=(0,0, 255) Blue
[Link] [Link] 1 ST SKIKDA 2023/2024