Académique Documents
Professionnel Documents
Culture Documents
N.B : Computer's performance generally measured in FLOPS (Floating-point Operations Per Second)
or in MIPS (Millions of Instructions Per Second)
Classification by Size
- Supercomputers
* Largest computers ever
* Very Expensive
* Can occupy more than 1 cooled room
* Used for High-level Performance Computing
(compared to general-purpose computers)
* Used to perform intense Numerical Calculations
* Used in Computational Science, Scientific Research & for solving
Complex Scientific and Engineering problems (i.e. Cryptanalysis)
* 1960 – Present
* Performance measured using FLOPS or TEPS (Traversed Edges Per Second)
As of 2017, can perform up to a hundred quadrillions of FLOPS,
measured in P(eta)FLOPS
As of November 2017, all of the world's fastest 500 supercomputers run
Linux-based operating systems
* CPU Architectures used : Power Architecture : IBM-A2 in Blue
Gene/Q
Sunway Architecture : SW26010
SPARC Architecture : SPARC64 V
- Mainframes
* 2nd Largest computers after Supercomputers
* Used by large organizations (i.e. Governments, Banks) for Bulk Data
Processing (i.e. industry and consumer statistics, enterprise
resource planning) and Transaction / Batch Processing
* 1960 – Present
* Performance measured using MIPS or TPS (Transactions Per Second)
* Can respond to hundreds of millions of users at a time
* CPU Architectures used : IBM System/390 to IBM z/Architectures
Burroughs Architectures
- Minicomputers
* Large powerful machines, Smaller and cheaper than Mainframes
* Used as High-End Network Servers to handle Large-Scale Processing of
many business/industrial applications
Used in Industrial Process-Control and Manufacturing Plants
(Computer-Aided Manufacturing (CAM))
Used for Computer-Aided Design (CAD) and other computation and
graphics-intensive applications
* 1960 – Present
* Recently called Midrange Computers (between Mainframes &
Microcomputers)
* CPU Architectures used : Power Architecture : POWER5 in IBM AS/400
- MicroComputers
* Small inexpensive, mass produced computers
* Introduced with advent of Single Chip Microprocessors
Replaced the many separate components that made up the minicomputer's
CPU with one Integrated Microprocessor Chip
* Used for Standard Applications & Tasks
Intended to be used by one person at a time
* 1975 (Altair 8800) – Present
* Work on DOS, Windows & similar operating systems
* Paved the way for Personal Computers (PC), Embedded Computers
* CPU Architectures used : x86 Architecture
Power Architecture
ARM Architecture
Classification by Function
- Servers
* Dedicated to providing one or more services to 1 or more computers
* Can make use of either :
- Minicomputers : for High-End Servers
=> Alpha, Intel Itanium (IA-64) and Power Architectures
or
- Microcomputers : for Small Servers
=> x86, Power and ARM Architectures
* Expected to be Reliable (i.e. error-correction of RAM, redundant cooling,
self-monitoring, RAID), Fit for running for several years,
and giving useful diagnosis in case of an error
For even increased security, server may be mirrored
* i.e. "Database server" : Dedicated to a database
"File server" : Manages a large collection of computer files
"Web server" : Processes web pages and web applications
- Workstations
* Powerful user machines
* Used for Technical, Scientific & Engineering Applications
Intended to be used by one person at a time
* Use UNIX & NT operating systems
* Can be equipped with powerful RISC processors (Digital Alpha or MIPS)
* Used to offer higher performance than mainstream Microcomputers (PCs),
especially with respect to CPU and graphics, memory capacity, and
multitasking capability
Nowadays, Workstations are mostly MicroComputers (PCs) + some MiniComputers
* CPU Architectures used : x86, Power, Alpha, IA-64, MIPS, SPARC Architectures
- Embedded Computers
* Part of a machine or device ; Built-in ; Hardwired
* Usually used to perform a single task
* Execute a program that is :
- Stored in non-volatile memory
- Intended to operate only a specific machine or device
* Required to operate continuously without being reset or rebooted, and once
employed in their task the software usually cannot be modified
* CPU Archs used : ARM, Power and MIPS architectures
b)Computer Design Models / Architectures (!= CPU Architectures)
Program/Application (Single-Threaded?)
+
0 or more Shared Object Files : In case of External Object Files linked Dynamically
Code in them is loaded at Run-Time to form, with
Executable Code in Executable File,
the Totality of the Executable Code
N.B : Assembly Directives are not universal. Every Assembler has its own set of directives
https://sourceware.org/binutils/docs/as/index.html
Assembler, while going through the Assembly File, keeps track of all Sections using a Section Stack
Assembler creates a Section Table in the Reloc. Obj. File to keep track of all created Sections
-> i.e. .data ... .section .rodata ... .text ... .section .rodata ... .text ... .data
.section name attributes = - creates a new section named name with attributes (if not already
existing)
- assembles the following code into the new section name
- replaces the current section and subsection by section named name
Replaced section and subsection are pushed onto the section stack
.global / .globl = makes the symbol visible to ld, externally visible to other
modules
if defined => value visible to other Object Files
otherwise => .?
.comm + .local / .lcomm = defines a Common (uninitialized) + Local (externally invisible) Symbol
-> Symbol is in .bss section
i.e. Static Uninitialized Global C Variable
Static Uninitialized Local C Variable
are translated to Assembly using .comm + .local / .lcomm
-> Symbols are originally in the Source File (.c, .cpp)
Compiler then exports them in the Assembly File (.s)
Assembler builds Symbol Table in the Relocatable Object File (.o) using Symbols in .s
file
-> Each Relocatable Object File has a Symbol Table
Symbole Table contains info about Symbols in the Object File (3 types)
-> Each Symbol has a Value (= address/offset)
- Variable : offset relative to the beginning of corresponding section
- Function : offset relative to the beginning of .text section
-> Symbole Table : (Name, Value) pairs + other information (i.e. Type, Size)
1) Core Source
2) Core Header Files à
2) External Header Files : Included in Core Source Files;
Reference Routines implemented in External Object Files
(Static and Shared Object Files)
- Each Source File is subject to the following by the Compiler Driver (i.e. GCC)
>> In C, using GCC Compiler Driver : gcc -S test.c or test.i // outputs test.s
a) Constants = Data
-> Integer Constants (30d, -101b, +4Ch, -0CDh, +457o...)
-> Character Constants ('A', "x"...)
-> String Constants ("ABC", 'xyz'...)
-> Constant Expressions (16/2, 85*8...)
* = Directive
-- name = integer-constant : count = 50
-- name = integer-constant-expression : count = 10*10 (100)
-> count is a Symbolic Constant
-> count is not a variable
-> count can be redefined using a String constant
count = "This is count"
* EQU Directive
-- name EQU integer-constant : count EQU 50
-- name EQU integer-constant-expression : count EQU
50*10(500)
-- name EQU String : count EQU
<50*10>(50*10)
1-Label
-> optional
-> case sensitive
-> Marks the offset – address of code/instruction following it
-> Code Labels (usually in .text section)
-- Used as target of Jump and Loop instructions
2-Mnemonic
-> Required
-> lower case
-> Identifies the operation
-> 0,1,2,3-operand Mnemonics, Relative Jump Mnemonics
3-Operands
Can be
-> Constants
-> Registers (EAX, BX...)
-> Memory addresses (Data Labels, Code Labels for Jumps)
4-Comments
-> start with ; till the end of the line
-> optional
Assembly Directives :
>> In C, using GCC Compiler Driver : gcc -c test.c or test.i // outputs test.o
* Linking : Merges All Relocatable Object Files (from All Source Files)
Resolves External References to symbols defined in other object
files
Relocates Symbols from their relative locations in the Relocatable
Object
files to new Absolute Positions in the output
Program/Application Source Code Content :
Compiled, Linked (to the files where the Shared Code comes from)
then Stored as an Executable File in the File System
Executable File is divided into Segments, which can contain each multiple Sections
Executable File contains a Section Table = describes the sections inside it
* Code :
- Instructions
- Modifiable by the dev before Program Execution
- Unmodifiable during Program Execution
- When Program is executed :
* Code is loaded into memory in Read-Only state
loaded into Memory area Protected from modification
* Code can/should not be modifiable afterwards during the program execution
* Data :
- Variables
- Much of it is modifiable during Program Execution
* Global Data : scope/lifetime = whole thread (static allocation)
=> address space allocated remains for lifetime of thread
* Local : scope/lifetime = when thread enters block 2 when it exits
it (automatic allocation, run-time allocation in stack)
=> address space allocated remains allocated only when thread in
- Based on the computer organization defined by von Neumann (CPU, I/O, Memory)
- Physically separates Storage and Signal Pathways (Buses) for Instructions and
Data
=> 2 Memories : 1 for Code, 1 for Data
: => 2 Separate Address Spaces for Code and Data
(Code / Data Segments)
: => Cannot access Code Instructions as Data
(No pointers to code, only to data)
=> 2 Buses : 1 associated to Code Memory, 1 associated to Data Memory
- CPU can both Access/Read an instruction and Perform a Data Memory Access at the
same time
- Code is usually Read-Only; Data is usually Read-Write
Almost-Harvard – Access-Instruction-Memory-as-Data
Designs found in real life
2/ PC : Personal Computer
- First introduced in 1981 by IBM as a Micro-Data-Processor Computer (Microcomputer) : IBM PC Model 5150
- IBM design :
-> Built over Single Chip Microprocessors : Replaced the many separate components that made up the
minicomputer's CPU with one Integrated Microprocessor
Chip i.e. IBM PC Model 5150 used Intel 8088 Processor
-> Inexpensive, simple and robust (definitely not advanced)
-> Standardized = IBM PC Standard
-> Had an Open Architecture
-> Well documented, had great possibilities for expansion
=> Other companies entered the market, manufacturing IBM compatible PCs and components for them,
creating IBM PC Clones (2 types of clones)
* Brand names : PCs from IBM, Compaq, AST...
Big companies that develop their own hardware components
* Real Clones : PCs built from standard components ; No names
Anyone can make a real clone by gathering components
- Concists of :
* Central Unit :
Motherboard : CPU, RAM, Cache, ROM chips + BIOS and start-up programs,
Chipsets(Controllers), Ports, Buses, Expansion Slots
Drives : Hard Disk(s), Floppy Drive(s), CD-ROM...
Expansion Cards : Graphics Card (Video Adapter), Network Controller,
SCSI Controller, Sound Card, Video and TV Card,
Internal modem and ISDN card
* Buses :
- Electrical conduits/wires that transfer bits back and forth between components
- 2 types : Internal Bus
- RISC (Reduced Instruction Set Computer) => Fixed-width = word size = 4 or 8 bytes
- CISC (Complex Instruction Set Computer) => Variable-width
- Macroscopic view : { System Bus, Memory Bus, I/O Bus, CPU Internal Bus }
- Microscopic view : Each Bus contains : { Data Bus, Address Bus }
Data Bus width = maximum data that can be transferred during 1 cycle; wider it is, faster it is
Address Bus width = length of memory address, how many memory arrays can be addressed (2^width);
wider it is, more memory addressable
* I/O devices :
system's connection with external world
generally 4 : keyboard + mouse for input, display for output, disk drive : long-term storage of
data + programs
I/O devices connected to I/O buses through : controller OR adapter
** Controller : chips in the device OR on the system's circuit board (motherboard)
** Adapter : card that plugs into a slot on the motherboard
Both transfer data back and forth between I/O devices and I/O bus
* Main memory :
temporary-storage device, holds program code being executed and data being operated on by
the programs
Physically consists of collection of DRAM chips (Dynamic Random Access Memory)
Logically organized as linear array of bytes, each with its own unique address (array index)
starting at 0
* Processor:
1 core, multicore
Each core = Processing Engine
Each core = 1 set of registers + 1 CPU (1 Control Unit : fetch, decode, dispatch, 1 set of
Execution Units : ALU, FPU)
PC : Program Counter <=> IP (Instruction Pointer) = word-size register
Operates according to Instruction Set Architecture, sequentially, each instruction envolving steps
*CU : Fetch instruction whose address is in PC (pointed by it)
*CU : Decode the instruction : interpretation
*CU : Dispatch the instruction by activating/sending signals to appropriate circuitry
and Execution Units
*EUs : Perform operations
*CU : update PC with address of next instruction (if no jump, contiguous)
Operations : simple, revolve around Main Memory, Registers, Execution Units (ALU, FPU...)
*Registers = collections of word-size registers, each with unique name, gathered in
a Register Set/Register File
*Main Memory = holds program code (instructions) loaded + data on which instructions
operate
*ALU : compute address values + performs arithmetic + logic operations
Instructions :
*Load : copy byte/word from main memory to register, overwrite its previous content
*Store : copy byte/word from register to main memory location, overwrite its previous
content
*Operate : copy contents of 2 registers to ALU, perform arithmetic or logic operation
on the 2 words, store result in register
*Jump : extract word from instruction, copy that word into PC, overwrite its previous
content