INTRODUCTION TO
COMPUTERS SYSTEMS
Hardware & Software
What Is A Computer?
A computer is an electronic device, operating
under the control of instructions (software)
stored in its own memory unit, that can
accept data (input), manipulate data
(process), and produce information (output)
from the processing. Generally, the term is
used to describe a collection of devices that
function together as a system.
The computer
Devices that comprise a computer system
Monitor Speaker
(output) (output) System unit
(processor, memory…)
Printer
(output)
Storage devices
(CD-RW, Floppy,
Hard disk, zip,…)
Mouse
(input)
Scanner Keyboard
(input) (input)
Content
• Hardware • Network
• Information storage Protocols
RAM, ROM Packets
HD, DVD • Programming
• Display Algorithm
Images Pseudocode
Characters (fonts) Flowchart
• File system/type • Languages
Encryption • Source code
Compression Example
Internally
The connections
What Are The Primary
Components Of A Computer ?
Input devices.
Central Processing Unit
(containing the control
unit and the
arithmetic/logic unit).
Memory.
Output devices.
Storage devices.
The Central processing Unit
The central processing unit (CPU) contains
electronic circuits that cause processing to
occur. The CPU interprets instructions to the
computer, performs the logical and arithmetic
processing operations, and causes the input
and output operations to occur. It is
considered the “brain” of the computer.
Processor
• What is the central processing unit
(CPU)?
Processor
Interpretsand carries
Control
Control Arithmetic
Arithmetic
out basic instructions Unit
Unit Logic
Logic Unit
Unit (ALU)
(ALU)
that operate a computer
Instructions
Control unit directs and Data
coordinates operations in Information
computer
Arithmetic logic unit Input Output
Devices
Data Memory Information
Devices
(ALU) performs
arithmetic, comparison,
Instructions
and logical operations Data
Information
Also called the processor
Storage
Devices
Input Devices
Keyboard.
Mouse.
Microphones.
Touch Screens.
Scanners…etc.
The Keyboard
The most commonly used input device is the
keyboard on which data is entered by
manually keying in or typing certain keys. A
keyboard typically has 101 or 105 keys.
Information storage
• 1 bit • bit (1 or 0)
• 8 bits • byte (octet) (28)
• 16 bits • word (216)
• 32 bits • double (232)
• 64 bits • long double (264)
Encoding information on a fixed element of length n with a
base b gives bn non-redundant possibilities
Information coding
• Binary • How to count
128 64 32 16 8 4 2 1
0 or 1
1 0 1 1 0 1 0 1
• Octal
0-7 • 128+32+16+4+1=
• Hexadécimal 181 (décimal)
265 (octal)
0-9 … A-F
B5 (hexadécimal)
• Décimal
0-9 • Signed vs unsigned
0 to 255
-127 to +127
Operations on bits
• Booleans: • Example tables
0 = false = no AND 0 1
0 0 0
1 = true = yes
1 0 1
• Operators:
OR 0 1
AND 0 0 1
OR 1 1 1
XOR XOR 0 1
NOT 0 0 1
1 1 0
RAM/ROM
Memory mapping
Address Values
1 0 1 1 1 0 0 1
• Size reminder:
0000
0 0 0 0 1 1 1 1 • Kilobyte Kb 210 ~103
0001
0002 1 1 1 0 0 0 1 1 • Megabyte Mb 220 ~106
.. • Gigabyte Gb 230 ~109
.. • Terabyte Tb 240 ~1012
..
• Petabyte Pb 250 ~1015
• …
..
FFFF 0 0 1 0 0 1 0 0
Storage Devices
Auxiliary storage devices are used to store
data when they are not being used in
memory. The most common types of auxiliary
storage used on personal computers are
floppy disks, hard disks and CD-ROM drives.
Hard disks drives.
HD/DVD
track
sector
head
Display
QuickTime™ et un
décompresseur TIFF (non compressé)
sont requis pour visionner cette image.
• Screen pixel or dots
• Fonts
• Color coding: 32 bits
• 1 pixel = 3 bytes of color (RGB)+1 Bitmap
byte alpha channel (transparency) Vectors
• 1600x1200x4bytes=7,5 Mb!
TrueType, OpenType,
PostScript
Keyboard/Mouse
• Each key (or combination • The mouse movements
of keys) of the keyboard 1 to 4 bytes (vertical &
sends a code to the horizontal)
computer. • Buttons
• The code is interpreted and Clicked, pressed, rolled
converted to the
corresponding ASCII or buttons
Unicode number.
The Mouse
Is a pointing device which is used to control
the movement of a mouse pointer on the
screen to make selections from the screen. A
mouse has one to five buttons. The bottom of
the mouse is flat and contains a mechanism
that detects movement of the mouse.
Memory
Memory also called Random Access Memory
or RAM (temporary memory) is the main
memory of the computer. It consists of
electronic components that store data
including numbers, letters of the alphabet,
graphics and sound. Any information stored in
RAM is lost when the computer is turned off.
Read Only Memory or ROM is memory that is
etched on a chip that has start-up directions
for your computer. It is permanent memory.
Amount Of RAM In Computers
The amount of memory in computers is
typically measured in kilobytes or megabytes.
One kilobyte (K or KB) equals approximately
1,000 memory locations and one megabyte
(M or MB) equals approximately one million
locations A memory location, or byte, usually
stores one character.
Therefore, a computer with 8 MB of memory
can store approximately 8 million characters.
One megabyte can hold approximately 500
pages of text information.
Output Devices
Output devices make the information
resulting from the processing available for
use. The two output devices more commonly
used are the printer and the computer
screen.
The printer produces a hard copy of your
output, and the computer screen produces a
soft copy of your output.
Floppy Disks
A floppy disk is a portable, inexpensive
storage medium that consists of a thin,
circular, flexible plastic disk with a magnetic
coating enclosed in a square-shaped plastic
shell.
Structure Of Floppy Disks
Initially Floppy disks were 8-inches wide, they then
shrank to 5.25 inches, and today the most widely
used folly disks are 3.5 inches wide and can typically
store 1.44 megabytes of data.
A folly disk is a magnetic disk, which means that it
used magnetic patterns to store data.
Data in floppy disks can be read from and written to.
Formatting is the process of preparing a disk for
reading and writing.
A track is a narrow recording band that forms a full
circle on the surface of the disk.
The disk’s storage locations are divided into pie-
shaped sections called sectors.
A sectors is capable of holding 512 bytes of data.
A typical floppy stores data on both sides and has 80
tracks on each side with 18 sectors per track.
Hard Disks
Another form of auxiliary storage is a hard disk. A
hard disk consists of one or more rigid metal plates
coated with a metal oxide material that allows data
to be magnetically recorded on the surface of the
platters.
The hard disk platters spin at a high rate of speed,
typically 5400 to 7200 revolutions per minute (RPM).
Storage capacites of hard disks for personal
computers range from 10 GB to 120 GB (one billion
bytes are called a gigabyte).
Compact Discs
A compact disk (CD), also called an optical disc, is a
flat round, portable storage medium that is usually
4.75 inch in diameter.
A CD-ROM (read only memory), is a compact disc
that used the same laser technology as audio CDs for
recording music. In addition it can contain other
types of data such as text, graphics, and video.
The capacity of a CD-ROM is 650 MB of data.
Computer hardware & software
Computer Software
Computer software is the key to
productive use of computers.
Software can be categorized into
two types:
Operating system software
Application software.
What Does A Computer Do?
Computers can perform four general operations, which
comprise the information processing cycle.
Input
Process
Output
Storage
Data and Information
All computer processing requires data, which is a collection of raw facts,
figures and symbols, such as numbers, words, images, video and sound,
given to the computer during the input phase.
Computers manipulate data to create information. Information is data
that is organized, meaningful, and useful.
During the output Phase, the information that has been created is put
into some form, such as a printed report.
The information can also be put in computer storage for future use.
Why Is A Computer So Powerful?
The ability to perform the information
processing cycle with amazing speed.
Reliability (low failure rate).
Accuracy.
Ability to store huge amounts of data and
information.
Ability to communicate with other computers.
How Does a Computer Know
what to do?
It must be given a detailed list of instructions,
called a compute program or software,
that tells it exactly what to do.
Before processing a specific job, the
computer program corresponding to that job
must be stored in memory.
Once the program is stored in memory the
compute can start the operation by executing
the program instructions one after the other.
Operating System Software
Operating system software tells the computer
how to perform the functions of loading,
storing and executing an application and how
to transfer data.
Today, many computers use an operating
system that has a graphical user interface
(GUI) that provides visual clues such as icon
symbols to help the user. Microsoft
Windows 98 is a widely used graphical
operating system. DOS (Disk Operating
System) is an older but still widely used
operating system that is text-based.
Application Software
Application Software consists of programs
that tell a computer how to produce
information. Some of the more commonly
used packages are:
Word processing
Electronic spreadsheet
Database
Presentation graphics
Word Processing
Word Processing software is used to create and print
documents. A key advantage of word processing
software is that users easily can make changes in
documents.
Electronic Spreadsheets
Electronic spreadsheet software allows the user to
add, subtract, and perform user-defined calculations
on rows and columns of numbers. These numbers
can be changed and the spreadsheet quickly
recalculates the new results.
Database Software
Allows the user to enter, retrieve, and update data in
an organized and efficient manner, with flexible
inquiry and reporting capabilities.
Presentation Graphics
Presentation graphic software allows the user to
create documents called slides to be used in making
the presentations. Using special projection devices,
the slides display as they appear on the computer
screen.
ASCII & Unicode
• ASCII 7/8 bits
• Unicode •
UTF-8/16/32 bits
ISO-8859 (Latin)
• od -c od -h
Software layers
Files Data (.doc, .mp3)
Software Word, scripts, mail, web browser…
User Interface Quartz CLI, X-Windows Windows
Operating System MacOSX Linux Windows
ROM Firmware BIOS
Hardware CPU, RAM, HD, DVD
File systems
• Method the OS uses to store information
Storage unit, directories, subdirectories (Windows,
VMS)
Single arborescence (Linux, MacOSX, all Unix)
• What exactly is a file?
a piece of information (text, graphic, data, music
program, script)
it is identified by a name and an logical address (or
path)
other informations: date, size, type, creator,
ownership, physical address…
File system organisation
Disk 1 Disk 2 Disk 2
C: D: /
DOCS PROGS CONFIG DATA Directories /usr /home
Disk 1
WORD EXCEL EXPT1 EXPT2 Subdirectories local phil john
bin lib
emacs X11
Windows Unix
Path
• The path is the logical address used by
the system or the user to locate a file.
• Example:
/bd_du_Palais/35/etage/4/appart/12/Dupont_ Jean.txt
suffix
filename
path
File types
• Executable • Special cases in Unix
.exe STDIN
.app STDOUT
Unix requires « x » STDERR
• Data
Text (.txt)
Music (.mp3)
Image (.jpg, .gif)
Movie (.mpg, .mov)
Binary (.bin)
Encryption / compression
• Compression
Reducing the size of files
E.g., .mp3, .gz, .jpg, .zip
• Encryption
Protecting your privacy
E.g., .pgp
• Packing
Grouping the files
E.g., .tar
Networks
• Direct
USB 11Mb-480Mb
Ethernet 10Mb-1Gb
• Wired
Modem 56Kb
ADSL 600Kb-8Mb
LAN 10Mb-10Gb
• Wireless
Bluetooth 1Mb-20Mb
WIFI (AirPort) 11Mb-54Mb
Network (ethernet or wireless)
• Computer talk to each • Handshaking
other via network • Transmission
protocols • Ackowledgement
ip, tcp, http, ftp, …
• TCP/IP • DNS
Domain Name Server
transmission control
protocol/internet protocol • URL
Universal Resource
Locator
• IP addess
192.42.197.51
DNS reminder
2 Root DNS 3
*.org
5 4
Local DNS Primary DNS
dns.anywhere.net www.expasy.org
1 6
www.expasy.org ??
Client query Target server
client.anywhere.net 129.194.8.64
Packets
The data travels within
units called packets
Packet breakout
Usual TCP/IP payload per packet: 512 bytes
Introduction to programming
What is a program?
• How to cook?
• The algorithm
• Are you a programmer?
Pseudocode
• This is the pseudocode for a game of Monopoly
Flowcharts
Flowcharts details
Languages
• Low level (processor dependent)
Machine code, assembler
• High level: structured, procedural
Fortran, C, Pascal…
• High level: object oriented
C++, Java, C#, Perl, Objective-C…
• Virtual machines
Java, C#…
• Scripting
Perl, Python, JavaScript…
Source code -> Object code
• Compiler+linker • Compiler+linker
Fortran, C, Pascal, C++… Fast to execute, but slow
to debug
• Interpreter • Interpreter
Basic, Perl… Slow to execute, but fast
to debug (no need to
recompile)
• Intermediate • Intermediate
Java Slow…
Source code
• Instructions • Data structures
Statement, blocks Variable
Affectation List
Operators Array
Loops Hash
Tests Pointers
Subroutines Objects
Comments
Source code (2)
• Statement, blocks • Variable
One or more A region in memory
instructions for the that can be modified
processor
Exists in different
• Affectation types
Change to a variable Scalar, char, numeric,
• Operator boolean
affect one or more List, array
variable Hash
+ * - / AND OR NOT… Combination->data
structure
Source code (3)
• Loops • Pointers
Allow the computer to Reference to region in
repeat blocks memory (address)
• Tests • Objects
Decide what to do
Combination of data
• Subroutines and code
Programs frequently
called (functions)
• Comments
The most important
lines of the source
code…
Example: a text to treat
« Noon rings out. A wasp, making an ominous sound, a sound akin to a klaxon or a
tocsin, flits about. Augustus, who has had a bad night, sits up blinking and purblind. Oh
what was that word (is his thought) that ran through my brain all night, that idiotic word
that, hard as I'd try to pun it down, was always just an inch or two out of my grasp - fowl
or foul or Vow or Voyal? - a word in a quizz which, by association, brought into play an
incongruous mass and magma of nouns, idioms, slogans and sayings, a confusing,
amorphous outpouring which I sought in vain to control or turn off but which wound
around my mind a whirlwind of a cord, a whiplash of a cord, a cord that would split again
and again, would knit again and again, of words without communication or any possibility
of combination, words without pronunciation, signification or transcription but out of
which, notwithstanding, was brought forth a flux, a continuous, compact and lucid flow: an
intuition, a vacillating frisson of illumination as if caught in a flash of lightning or in a mist
abruptly rising to unshroud an obvious sign - but a sign, alas, that would last an instant
only to vanish for good. »
Result…
a=97 n=91
b=15 o=104 Do you see any problem??
c=26 p=15
d=35 q=1
f=23 r=43
g=32 s=59
h=44 t=77
Try with this:
i=90 u=52
j=1 v=4 « The quick brown fox, jumps
k=5 w=31 over the lazy dog. »
l=33 x=2
m=17 y=13
z=2
Flowchart
Source code example
#!/usr/bin/perl -w # essential line of all perl scripts
$filename = "avoid.txt"; # affect « avoid.txt » to the variable $filename
# open the file, or exit
open(FILE, $filename) || die "Cannot open file ‘$filename’\n\n";
@text = <FILE>; # add each line of the file to an array
close FILE;
foreach $line (@text) { # read one line from the array into $line and repeat for each line
@table = split(//,$line); # read each character of the line in an array
while ($char=pop(@table)) { # read one character of the array 'table' and repeat for all
$char =~ s/[^a-z]//; # keep only the alphabetical character a to z
if ($char) { # check if the character exists and execute the block
$count{$char}++; # if yes, increment by one the hash 'count'
}
}
}
# print each character and its number of occurence one per line
foreach $c (keys %count) {
print "$c=$count{$c}\n";
}
exit; # quit the program
Tips
• Think about your • Test the code
problem For all the possible
• Create a flowchart functions or cases (if
possible)
• Create the Give it to users as a
pseudocode beta (if not possibe)
• Verify the memory Sell it (if you work for
used by your Microsoft©… ;-)
variables • Debug
• Write the code
END
THANKYOU
STAY SAFE