0% found this document useful (0 votes)
77 views94 pages

Unit 1 - Fundamentals of Computers

Uploaded by

dushime rene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views94 pages

Unit 1 - Fundamentals of Computers

Uploaded by

dushime rene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 94

Unit 1.

Fundamentals of Computers

Computer
Programming TURINUMUKIZA MAURICE
Some questions?
2

 What is a computer?
 What is computer science ? Is it the same as
computer programming?
 What are the parts of computer science
 What are examples of computer science
subareas?
 Isn’t it sufficient for most people just to
use computers, rather than have a
deeper understanding of computers
and computer science?

Computer Definition
3

It is a high speed electronic device


which is capable of performing logical
and arithmetical operations. it
accepts data as an input from the user,
processes and gives desirable output.
Data & Information
4

Data:
 is the raw material that we would input into
an ICT device, such as figures, small facts and
numbers that, on their own, have little value
or meaning.

Information
 is processed data. That is data that has
been reorganized so that it now contains
some meaning.
Features of computer
5

Most of people know that a computer is fast


calculator . But it is much more than that , some
of features that make a computer so important
are its:
 Speed : The first feature of computer is speed .

It is a very fast device which can perform any


type of task in fraction of seconds. When
performing a particular task for hours together,
it can maintain the same speed till the end of it
 Accuracy : The word accuracy means

exactness of result . Computers can do the


calculations without errors and very accurately
Features of computer
6
(cont’d)
 Versatility: A computer can perform almost
any type of arithmetical and logical operations.
 Automation :A computer can perform a
particular work continuous for hours together
without any user ( human ) intervention.
 Diligence :A computer does not suffer from
human trait or tiredness or board . If 3 million
calculation has to be performed , it will perform
the 3rd millionth calculation with the same
speed and accuracy as the first one .
Computer Block Diagram
7
Hardware and Software
8

The physical devices that a computer is


made of are referred to as the computer’s
hardware. The programs that run on a
computer are referred to as software
HARDWARE
9

 The term hardware refers to all of the


physical devices, or components, that a
computer is made of. A computer is not
one single device, but a system of
devices that all work together.
 A typical computer system consists of the
following major components:
 The central processing unit (CPU)
 Main memory
 Secondary storage devices
 Input devices

Hardware(Cont’d)
10
The CPU
11

 When a computer is performing the tasks


that a program tells it to do, we say that
the computer is running or executing
the program.
 The central processing unit, or CPU, is the
part of a computer that actually runs
programs.
 The CPU is the most important component
in a computer because without it, the
computer could not run software
The CPU (cont’d)
12

It is regarded as the brain of the computer .


The major structural components of CPU
are:
 Control Unit[CU]

 Arithmetical And Logical Unit[ALU]

 Memory Unit [MU]


The CPU (cont’d)
13

Control Unit

Control unit device directs and coordinates


the activities of the entire computer which
includes controlling the input/output devices
or units , the operation of ALU and the transfer
data to main memory . An important function
of CU is program execution , fetching an
instruction from memory , decoding it and
sending it to an appropriate place in the
computer to get it executed.
The CPU (cont’d)
14

Arithmetical And Logical Unit


The arithmetic logical operation unit performs
arithmetic operation, the operands are
brought to ALU from the memory . In ALU the
required operation is done and the result is
sent back to memory for storage ALU . All
these happens under the control unit . ALU
also perform comparison which are called
logical operation, these occurs when the
operation are connected with logical
operation .
Main Memory
15

 You can think of main memory as the


computer’s work area.
 This is where the computer stores a
program while the program is running,
as well as the data that the program is
working with.
 Main memory is commonly known as
random-access memory, or RAM. It is
called this because the CPU is able to
quickly access data stored at any random
location in RAM.
Secondary Storage
16
Devices
 Secondary storage is a type of memory that
can hold data for long periods of time, even
when there is no power to the computer.
 Programs are normally stored in secondary
memory and loaded into main memory
as needed.
 The most common type of secondary storage
device is the disk drive.
Input Devices
17

 Input is any data the computer collects from


people and from other devices.
 The component that collects the data and
sends it to the computer is called an input
device.
 Common input devices are the keyboard,
mouse, scanner, microphone, and digital
camera.
 Disk drives and optical drives can also be
considered input devices because programs
and data are retrieved from them and
Output Devices
18

 Output is any data the computer


produces for people or for other devices.
 It might be a sales report, a list of names, or a
graphic image.
 Common output devices are video
displays and printers.
 Disk drives and CD recorders can also be
considered output devices because the
system sends data to them in order to be
saved
SOFTWARE
19

 If a computer is to function, software is not


optional. Everything that a computer
does, from the time you turn the power
switch on until you shut the system down, is
under the control of software.
 There are two general categories of
software:
 System software
 Application software.
System Software
20

 The programs that control and manage


the basic operations of a computer are
generally referred to as system software.
 System includes :
 Operating Systems
 Utility Programs
 Software Development Tools (Language
translator )
Application Software
21

 Programs that make a computer useful


for everyday tasks are known as
application software. These are the
programs that people normally spend most
of their time running on their computers.
 Examples of application software:
 spreadsheet programs
 email programs
 web browsers
 game programs.
22
Language Translator
23

A software that convert source codes into


machines code vice-versa are called
language translator.
 Interpreter- A interpreter is an program
written in machine level language whose
function is to translate the high level language
program into the machine level language. An
interpreter first reads each lines of the
program and convert them from source code.
If it find the line error free it executes and then
the process continues till the end of the
program. i.e. It will check the program line
Language Translator(cont’d)
24

 Compiler - It is a program whose function is to


translate the high level language into machine
level program. Its usually completes the whole
program from first to last line before
attempting to link and run the program. i.e.
compiler will check a program at a time and
display all the errors.

 Assembler - A assembler is program written in


assembly level language whose functions is to
translate the assembly level program into
machine level language
Operating System
25

 A set of computer programs that manage the


hardware and software resources of a computer
system.
 At the foundation of all system software, an operating
system performs basic tasks such as controlling and
allocating memory, prioritizing system requests,
controlling input and output devices, facilitating
networking, and managing file systems.
 Most operating systems have a command line
interpreter as a basic user interface, but they may
also provide a graphical user interface (GUI) for ease
of operation. The operating system forms a platform
for other system software and for application software
Operating System (cont’d)
26
Operating System (cont’d)
27

Operating System Functions


 Process Management – Every program running on a
computer is a process. In general, a CPU can only run one
process at a time. The operating system will monitor
requested processes and execute them in a pre-designed
order often switching between them very quickly in a way
called multi-tasking.
 Memory Management – The operating system’s memory
manager coordinates the various types of memory use by
tracking which one is available at any given time. It will also
monitor which type of memory can be allocated or de-
allocated and how to move data between the memories.
 Disk and File Systems – The way an operating system
reads different kinds of file system as well as file storage.
Some operating systems read file names as case sensitive,
Operating System (cont’d)
28

Operating System Functions (cont’d)


Security – All operating systems come with some type of
security already built in. Because access to a computer
and its often privileged information should be restricted to
only authorize users, this aspect of an operating system
might actually be its most important function.

Networking – In the Internet age, networking capabilities


of operating systems are very important. Networking
capabilities can be either with an outside computer as in
accessing the Internet or computer to computer as in a
large mainframe operation. The operating system will
coordinate all of this below the surface without the user
even being aware it is happening.
Operating System (cont’d)
29
Classification of Operating System

 SINGLE USER OPERATING SYSTEM - A single user operating


system will permit one application program or one task to be run at a
time where the processor (CPU) of a computer does one job at a time
it is called a single user operating system. Ex- MS-DOS.

 MULTI-USER OPERATING SYSTEM - A multi-user operating system


will permit numbers of users to work on the computer system at the
same time. Ex- Linux, Unix.

 GRAPHICAL USER INTERPHASE (GUI) OPERATING SYSTEM - A GUI


is
uses icons or small images to represent program features instead of
typing or interring the command. This enjoinment is responsible for
interacting with users through icons or pictures. Ex- Windows
History of Computer
30

The discovery of numbers, which is considered


as the greatest achievement of mankind led
to the development of all kinds of
calculating device . Today we can’t imagine
a work without numbers , it took thousands of
years to get the present system of numbers .
The stone age man used pebbles for counting
people or animals , stone was replaced by
sticks on the rope
The Abacus
31

The earliest and the simplest device that was


used for calculations was the ABACUS ,
simple abacus has been in use since 3000
B.C. Abacus was first developed in china and
later its use spread to all parts of the world.
Napier’s “logs” and
32
“bones”
John Napier, the inventor of logarithms, also
invented this aid to calculation known as
'Napier's Bones' in 1617. The use of
logarithms enabled him to transform
multiplication and division problems of
addition and subtraction.
Pascal Adding Machine
33

The first mechanical adding machine was


invented by BLAISE PASCAL in 1642.
Jacquard’s loom
34

Joseph Jacquard initiated


actual development in the
early 19th century .
Jacquard was a textile
manufacturer he invented
automated loom in 1804 .
He used punched card to
produce complex cloth
pattern with automated
loom.
Charles Babbage
35

Charles Babbage , a nineteenth century


professor at Cambridge university is
considered to be father of modern digital
computer . He designed his “different engine”
in 1822 and his “analytical engine” in 1833
Hollerith’s machine
36

In 1855 , Herman
Hollerith , developed a
machine run on the
electricity for the first
time for calculating and
recording data . It was
capable of reading both
numbers and letters ,
processing and giving
out letters and
numbers in designed
Generations of Computer
37

 The term generation refers to major


development in electronic data
processing .
 Computer technology has been aimed at
making smaller cheaper and efficient
computers.
 The development of computer has been
very rapidly in last fifty years .
 It has been in five distinct stages . Each
of these stage is called generation
First generation (1946-
38
1955)
The first generation
computer is based on
the Vacuum Tube
technology .
First generation(cont’d)
39

In the first generation some important


computers that were designed are as follows:
 ENIAC (electronic numerical and

calculator ): In 1946, Mauchly and Eckert


completed the first large scale electronic
digital computer ENIAC . The ENIAC was
programmed by connecting wires between
units of the computer and setting switches
at the 50 feet . It was used for , atomic
energy calculation and random numbers
studies
First generation(cont’d)
40

 EDSAC : After ENIAC was turned off ,


another computer EDSAC ( electronic
delay storage automatic calculator)
came in 1943. EDSAC was first computer to
operate on the stored program concept .
It started operating only in 1951 . ENIAC,
EDSAC and other computer which were
developed in 1940’s were experimental
basis.

 UNIVAC : UNIVAC ( universal automatic


First generation(cont’d)
41

Drawback:
First generation computer based on vacuum tubes
created several problems:
 It generates too much heat .

 It consumed lots of electricity.

 Its size was large , unreliable and required constant

maintenance
 The computer programming language was in binary

digit (0,1) which have a special meaning that can be


understood by computer .
 It was very difficult to write program in machine

language , moreover most program contained errors


and the knowledge was restricted to few people
Second generation (1956-1965)
42

Major innovation was the solid


state device – transistor by
three scientist J.BARDEEN , H.W
BRATTIAN and W.SHOCKLEY in
1947.
A transistor is made of a semi

conductor material whose basic


part is silicon. The size of
transistor is only 1/200th of
the size of vacuum tube
Require much less power and

produce less heat .

Ex : IBM 7094,NCR 304, IBM


1620, ALTA’S etc.
Third generation (1966-75)
43

 Integrated circuit technology was


introduced around 1965. It is the
combination of numbers of transistors
and other electronic components fused
together on a single crystal.
 Mass storage device were called
auxiliary or secondary storage device
i.e. magnetic tape , disk , etc.
 Multi-programming software in which
more than one can be present in
computer memory simultaneously .
High level language like basic
COBOL, FORTAN , etc. were
developed .
 A new computer industry called
software industry was born. Ex: IBM -
360, ICL-1900,PDP-8, IBM-370/168 , etc
Fourth generation (1976-1985)
44

 A new technology Micro-


processors were introduced
. A microprocessor chip
(approx 1/4”*2” in size)
contain an entire central
processing units on single
chip . Large Scale
Integration (L.S.I) and very
large scale integration
(V.L.S.I) technology were
used in fourth generation .
 Size and cost reduced .
 Desktop came into the
market .
Fifth generation (1986 onwards)
45

 Ultra large scale technology (U.L.S.I) were


introduced Developed very small but
extremely fast and powerful computers
which is known as ROBOTS .
 Size were very much reduced . Small in size
and easy to carry out .
 Ex: mainframe , super computer ,
ROBOTS .
HOW COMPUTERS STORE
46
DATA?
All data that is stored in a computer is
converted to sequences of 0s and 1s

 A computer’s memory is divided into tiny


storage locations known as bytes.
 One byte is only enough memory to store a
letter of the alphabet or a small number.
 In order to do anything meaningful, a
computer has to have lots of bytes. Most
computers today have millions, or even
billions, of bytes of memory
How Computers Store Data?(Cont’d)
47

 Each byte is divided into eight smaller


storage locations known as bits. The term
bit stands for binary digit
 Computer scientists usually think of bits as
tiny switches that can be either on or
off. Bits aren’t actual “switches
 bits are tiny electrical components that
can hold either a positive or a negative
charge
How Computers Store Data?(Cont’d)
48

 Computer scientists think of a positive


charge as a switch in the on position, and a
negative charge as a switch in the off
position
How Computers Store Data?(Cont’d)
49

 When a piece of data is stored in a byte, the


computer sets the eight bits to an on/off
pattern that represents the data.
Storing Numbers
50

 In the binary numbering system (or


binary, as it is usually called) all numeric
values are written as sequences of 0s and
1s.
 Example :
Storing Numbers(Cont’d)
51

 The position of each digit in a binary number


has a value assigned to it. Starting with the
rightmost digit and moving left, the position
values are 20 , 21 , 22 , 23, and so forth, as
shown in the following figure:
Storing Numbers(Cont’d)
52

 The next figure shows the same diagram


with the position values calculated. Starting
with the rightmost digit and moving left, the
position values are 1, 2, 4, 8, and so forth:
Storing Numbers(Cont’d)
53

 To determine the value of a binary number


you simply add up the position values of
all the 1s.
 For example, in the binary number 10011101,
the position values of the 1s are 1, 4, 8, 16,
and 128. The sum of all of these position
values is 157. So, the value of the binary
number 10011101 is 157
Storing Numbers(Cont’d)
54

 The next figure shows how you can picture


the number 157 stored in a byte of memory,
Each 1 is represented by a bit in the on
position, and each 0 is represented by a bit in
the off position. :
Storing Numbers(Cont’d)
55

 When all of the bits in a byte are set to 0


(turned off), then the value of the byte is
0.
 When all of the bits in a byte are set to 1
(turned on), then the byte holds the
largest value that can be stored in it.
 The largest value that can be stored in a byte is
1+2 4+8+ 16+32+64+128 =255. This limit
exists because there are only eight bits in a
byte
Storing Numbers(Cont’d)
56

What if you need to store a number larger


than 255?
 The answer is simple: use more than one

byte.
 For example, suppose we put two bytes

together. That gives us 16 bits. The position


values of those 16 bits would be
and so forth, up through
Storing Numbers(Cont’d)
57

 As shown in the next Figure, the maximum


value that can be stored in two bytes is
65,535. If you need to store a number
larger than this, then more bytes are
necessary
Storing Numbers(Cont’d)
58
Storing Characters
59

 Any piece of data that is stored in a


computer’s memory must be stored as a
binary number. That includes characters, such as
letters and punctuation marks.
 When a character is stored in memory, it is first
converted to a numeric code. The numeric
code is then stored in memory as a binary
number.
 different coding schemes have been developed to
represent characters in computer memory.
 the most important of these coding schemes is ASCII,
which stands for the American Standard Code for
Information Interchange
Storing
60
Characters(Cont’d)
 ASCII is a set of 128 numeric codes that
represent the English letters, various
punctuation marks, and other characters.
 For example, the ASCII code for the
uppercase letter A is 65. When you type an
uppercase A on your computer keyboard, the
number 65 is stored in memory (as a binary
number, of course).
Storing
61
Characters(Cont’d)
 The ASCII character set was developed in
the early 1960s, and was eventually
adopted by most all computer
manufacturers.
 ASCII is limited however, because it defines
codes for only 128 characters.
 To remedy this, the Unicode character set
was developed in the early 1990s. Today,
Unicode is quickly becoming the standard
character set used in the computer industry.
Other Types of Data
62

 Computers are often referred to as digital


devices. The term digital can be used to
describe anything that uses binary numbers.
 Digital data is data that is stored in binary,
and a digital device is any device that
works with binary data.
Other Types of
63
Data(Cont’d)

 Ex: consider the pictures that you take with


your digital camera. These images are
composed of tiny dots of color known
as pixels. (The term pixel stands for picture
element.)
Other Types of
64
Data(Cont’d)
 As shown in the next figure, each pixel in an
image is converted to a numeric code
that represents the pixel’s color. The
numeric code is stored in memory as a
binary number
Bytes, Kilobytes, Megabytes, and
More
65

 A page of text could take a few thousand


bytes to store.
 Images files might take tens of
thousands, hundreds of thousands,
or even more bytes.
 Music files can take millions of bytes.
 Movie files can take billions.
 There are databases that consist of
trillions or quadrillions of bytes of
data.
Bytes, Kilobytes, Megabytes, and
More(Cont’d)
66

Computer science has special terminology


and notation for large numbers of bytes, as
shown in the following figure:
Bytes, Kilobytes, Megabytes, and
More(Cont’d)
67

 In the context of computer memory, the


usual definition of kilobytes, megabytes,
etc. is a power of two. For example, a
kilobyte is bytes, not a
thousand.
 In some other situations, however, a kilobyte
is defined to be exactly a thousand bytes.
 So, for example, if we do a calculation and find a
file takes 6,536 bytes, then you can say this is
approximately 6.5 KB, unless the problem
statement says otherwise.
Use of computers
68

 There are the different ways that people use computers.


 In school, students use computers for tasks such as writing
papers, searching for articles, sending email, and
participating in online classes.
 At work, people use computers to analyze data, make
presentations, conduct business transactions, communicate
with customers and coworkers, control machines in
manufacturing facilities, and do many other things.
 At home, people use computers for tasks such as paying
bills, shopping online, communicating with friends and
family, and playing computer games. And don’t forget
that cell phones, iPods, BlackBerries, car navigation
systems, and many other devices are computers too.
Use of
69
computers(Cont’d)
 The uses of computers are almost limitless
in our everyday lives.
 Computers can do such a wide variety of things

because they can be programmed


 Thismeans that computers are not designed to do
just one job, but to do any job that their programs tell
them to do
What is a program?
70

 A program is a set of instructions that a


computer follows to perform a task.
 Examples:
 Microsoft Word is a word processing program
that allows you to create, edit, and print
documents with your computer.
 Adobe Photoshop is an image editing program
that allows you to work with graphic images
 Programs are commonly referred to as
software.
 Software is essential to a computer because it
What is a program?
71
(Cont’d)
 A computer program can also be defined as a
sequence of instructions written using a
Computer Programming Language to
perform a specified task by the computer.
 A computer program is also called a
computer software, which can range from
two lines to millions of lines of
instructions.
Who is a programmer?
72

 All of the software that we use to make


our computers useful is created by
individuals working as programmers or
software developers.
 A programmer, or software developer, is
a person with the training and skills
necessary to design, create, and
test computer programs
 Someone who can write computer
programs or in other words, someone
who can do computer programming is
What is computer programming?
(Cont’d)
73

 There are hundreds of programming


languages, which can be used to write
computer programs and following are a few
of them:
 Java
 C
 C++
 Python
 PHP
 Perl
 Ruby, etc…
What is computer
74
programming?
 The act of writing computer programs is called
computer programming.
 Programmers use programming languages to
develop software programs, for computers to
execute.
 Computer programming is also called program
coding.
 Programming helps us talk to a computer; Computer
speak what is called machine language (0s and
1s);Humans speak human language which is text
 Programming helps translate between human
language and machine language
What is computer programming?
(Cont’d)
75

 Based on computer programming language


expertise, we can name a computer
programmers as follows:
 C Programmer
 C++ Programmer
 Java Programmer
 Python Programmer
 PHP Programmer
 Perl Programmer
 Ruby Programmer
How a Program Works?
76

A computer’s CPU can only understand


instructions that are written in machine
language. Because people find it very
difficult to write entire programs in
machine language, other programming
languages have been invented
 The CPU is an electronic device that is

designed to do specific things.


 In particular, the CPU is designed to perform
operations such as the following:
How a Program Works?
77
(Cont’d)
 Reading a piece of data from main memory
 Adding two numbers

 Subtracting one number from another number

 Multiplying two numbers

 Dividing one number by another number

 Moving a piece of data from one memory

location to another
 Determining whether one value is equal to

another value
How a Program Works?
78
(Cont’d)
A program is copied into main memory and then
executed
How a Program Works?
79
(Cont’d)
When a CPU executes the instructions in a program,
it is engaged in a process that is known as the
fetch-decode-execute cycle.
 Fetch A program is a long sequence of machine
language instructions. The first step of the cycle is to
fetch, or read, the next instruction from memory into
the CPU.
 Decode A machine language instruction is a binary
number that represents a command that tells the CPU
to perform an operation. In this step the CPU decodes
the instruction that was just fetched from memory, to
determine which operation it should perform.
 Execute The last step in the cycle is to execute, or
How a Program Works?
80
(Cont’d)
From Machine Language to
Assembly Language
81

 Computers can only execute programs that


are written in machine language
 it is impractical for people to write
programs in machine language. For this
reason, assembly language was created
in the early days of computing as an
alternative to machine language
 Instead of using binary numbers for
instructions, assembly language uses short
words that are known as mnemonics
From Machine Language to Assembly
Language(Cont’d)
82

 For example in assembly language, the


mnemonic:
 add typically means to add numbers
 mul typically means to multiply numbers,
 mov typically means to move a value to a
location in memory.

Note:
 There are many different versions of

assembly language
 Each brand of CPU typically has its own

assembly language
From Machine Language to Assembly
Language(Cont’d)
83

 As The CPU only understands machine


language, so a special program known as
an assembler is used to translate an
assembly language program to a machine
language program.
High-Level Languages
84

 Although assembly language makes it


unnecessary to write binary machine language
instructions, it is not without difficulties.
 Assembly language is primarily a direct substitute
for machine language, and like machine
language, it requires that you know a lot
about the CPU. Assembly language also
requires that you write a large number of
instructions for even the simplest program.
 Because assembly language is so close in nature
to machine language, it is referred to as a
low-level language.
High-Level
85
Languages(Cont’d)
 In the 1950s, a new generation of
programming languages known as high-
level languages began to appear.
 A high-level language allows you to create
powerful and complex programs without
knowing how the CPU works, and
without writing large numbers of low-
level instructions
 Most high-level languages use words that are
easy to understand
High-Level
86
Languages(Cont’d)
 For example, if a programmer were using
COBOL (which was one of the early
languages created in the 1950s), he or she
would write the following instruction to
display the message Hello world on the
computer screen:
DISPLAY "Hello world“
 Since the 1950s, thousands of high-level
languages have been created
Several of the more well-known
languages
87
Several of the more well-known
languages(Cont’d)
88
What is computer
89
science?
 Definition 1:
A branch of science that deals with the
theory of computation or the design of
computers.

Definition 2:
The study of computers, how they work, and
how to make use of them.
What is computer
90
science?(cont’d)
 Definition 3:
The study of computers, including both
hardware and software design.
 Definition 4:

Computer science (abbreviated CS or


CompSci) is the scientific and practical
approach to computation and its
applications.
What is computer
91
science?(cont’d)
Not easy to define what is a computer
science!
 many subfields of computer science are

interdisciplinary.
 For example, robotics draws not only on
computer science, but also on other fields
such as electrical engineering and mechanical
engineering
 computer science is a rapidly evolving
area, and so what constitutes computer
science continues to change
Is computer programming the same
as computer science?
92

 In fact, when people think of mathematics


they often think of arithmetic. However,
mathematics is much broader than
arithmetic. So, computer science as well is
much broader than computer
programming.

 While computer programming is an important


part of computer science, it is not the same as
computer science
Others examples of computer
science subareas
93

 Computer graphics
 Networking
 Databases, etc
94

End

You might also like