Vous êtes sur la page 1sur 25

Computer Architectures and

History of Programming Language


The Big Picture
What is a Computer
An electronic machine that:
Receives inputs
Processes and manipulate the inputs data with
high speed and high accuracy
Store these data and retrieve them whenever its
necessary
Produce outputs
This is done by the interaction and
collaboration between the H/W components
and the S/W components
Computer System
Computer System
Hardware
CPU
ALU
CU
Registers
I/ O devices Memory
RAM
ROM
2
nd
Memory
Software
OS Applications Translator
Machine
Languages
Assembly
Assembler
High Level
Compiler
Interpreter
Hardware Components
Input/Output devices
keyboard, mouse, scanner/monitor, printer
Storage Devices
CPU
ALU
Control Unit
Interface Unit
Memory
Short-term storage for CPU calculations
Hardware Components
Memory
Memory provide rapid access with relatively
low capacity
Data and instructions are stored in main
memory as a sequence of 0s and 1s called
Bits (Binary Digits)
Byte (8 Bits)
Each memory location consists of one Byte
The address is just a number (in hex) to identify the
memory location

Memory
Memory
Main memory: RAM (Random Access Memory)
CPU fetches program instructions from RAM directly
(temp saves the data)
The place where OS, application programs and the
data in current use are kept
Relatively has low capacity
Expensive
Volatile
ROM (Read Only Memory)
The place where critical programs are kept such as
BIOS

Secondary Storage Memory
Memory storage Devices: HD or CD-ROMS

Advantages
Long-term and high capacity storage than RAM or
ROM
Non-volatile
Less expensive than RAM

Disadvantages
Slower than RAM
Central Processing Unit
CPU is the brain
Fetch Decode Execute
ALU: arithmetic/logic unit
Performs arithmetic and logical operations
CU: control unit
Controls processing of instructions
Controls movement of data within the CPU
Interface unit and Registers
Interface Unit moves instructions and data
between the CPU and other hardware components
Computer System
Computer System
Hardware
CPU
ALU
CU
Registers
I/ O devices Memory
RAM
ROM
2
nd
Memory
Software
OS Applications Translator
Machine
Languages
Assembly
Assembler
High Level
Compiler
Interpreter
Software Components
Applications (Word, Excel, PowerPoint, IE,
Firefox Games)

Operating System OS (Windows, Linux)
Set of programs that lies between applications
software and H/W devices (provides file
management system, drivers, security)
Controls and manages the computing resources

Translators (compiler for C and C++,
Interpreter for J ava)
Programming Languages
Machine Languages (Low Level Language)
The language your computer directly understand
Consists of 0s and 1s
Examples

100100 010001 //Load
100110 010010 //Multiply
100010 010011 //Store

Programming Languages
Assembly Languages
The language that is more understandable by
human
English-like abbreviations representing elementary
computer operations
Needs assemblers to convert them to machine
language
Examples
SET r1,10
LOAD r2,x
CMP r1,r2
JMP 04003F3

Programming Languages
High Level Languages: C, C++, J ava, Fortran
and Matlab
Understandable to human
Uses common mathematical operations (+,-,*,/)
Single statements to perform substantial tasks
Fewer lines of code than Assembly language to perform
a similar task
Uses compilers/Interpreter and linkers
Machine binary language Low-level assembly High-level
Summary
Translators
The computer does not understand your
language
Compilers (for C/C++)
Convert high-level language to machine language

After you write your code in C++ to generate:
Source code
The original program in a high level language


How to Translate?
Compiler will check for errors
Syntax errors
Violation of the syntax (grammar rules) of
programming language
The only error that the compiler will check for
Run time errors
Division by Zero
Logic errors
Written correctly, Compiled Correctly but
doesnt run correctly

How to Translate?
Object code
The translated version in machine language
Contains markers that indicates missing pieces
that depends on.

A Linker combines
The object code for the programs we write
and
The object code for the pre-compiled routines
into
The machine language program the CPU can run
How to Translate?
What is a program
A set of ordered instructions to perform
certain task

Steps for writing a program
Problem Definition
Design a solution (algorithm and flowchart)
Program Implementation (coding)
Program Compiling
Program Execution and testing


Introduction to C++
Derived from C language
C language is developed in 1971 by Dennis
Ritchie at Bell labs, alongside with UNIX
operating
Added data types (int, float, double) in
comparison to previous languages
H/W independent
Portable Programs


Introduction to C++
C++ Developed at AT&T Bell Labs by Bjarne
Stroustrup in the 80s
Overcome several shortcomings of C
Designed for the UNIX system environment
Provides capabilities for object-oriented programming
Objects: reusable S/W components that model the real life
items
Object-Oriented Programming: easy to understand, correct and
modify
Why ++
C++ means C=C+1
Why C++?
Not So Good News:
C++ needs a lot of practice to learn

Good News:
Lots of good-paying jobs for programmers
Many problems can be solved in different ways
C++ allows a programmer to express their ideas at
a high level as compared to assembly languages
C++ is widely used and taught

Who Uses C++?
Computer makers such as Sun, SGI, IBM, and
HP
Airport
Computer chip manufacturers (Motorola, Intel)
Software companies
Banks
Telecommunications
Universities

Vous aimerez peut-être aussi