Handwritten Text Recognition for manuscripts and early printed texts
Â
computer architecture and organization.ppt
1. Computer Architecture
and Organization
Instructor: Col Dr. Khawar Mehmood
You can revolutionize the way computers are built, if you understand both the
hardware and the software and change each accordingly
2. Introduction
âą Why Do We Have Computers?
âą To Solve Problems
âą How Does a Computer Solve Problems?
âą Orchestrating Electrons
âą How Do Problems Get Solved by Electrons?
3. Introduction - The Transformation Hierarchy
Micro-architecture
SW/HW Interface
Program/Language
Algorithm
Problem
Logic
Devices
System Software
Electrons
Computer Architecture
(narrow view)
Computer Architecture
(expanded view)
5. Computer Architecture vs. Organization
âą Architecture:
âLogical aspects of computer hardware that are
visible to the programmer
â What instruction a computer understands!
â Instruction Set Architecture (ISA)
âExample: Architectural design issue is
whether a computer will have multiply
instruction or not.
5
6. Computer Organization vs. Architecture
âą Organization:
âPhysical aspects of computer hardware that
are invisible to the programmer
â How does the computer hardware carries out
instructions!
â Hardware details are transparent to the programmer
âFor Example: Is there a special hardware
multiply unit for multiplication operation or is
it done by repeated addition?
6
7. 7
Concept of the ISA
âą ISA stands for Instruction Set Architecture,
and it could be viewed as a model for the
computer
âą It includes the instruction set, memory space
and all the programmer-accessible registers
âą It serves as the interface between the
program and the functional units of the
computer
8. Types of Computer Architectures
âą Microcontrollers generally use two types of
Architecture.
âVon Neumann Architecture
âHarvard Architecture
8
9. Types of Computer Architectures
9
Differences
Von Neumann Harvard
Single Memory to be shared by
both code and data
Separate Memory for code and
data
Need two clock cycles to fetch
instruction and data
Single clock cycle is sufficient to
fetch instruction and data
Simple in design â requires less
hardware components
Complex in design
10. Types of Computer Architectures
10
Von Neumann CPU
Data
Instructions Data / Instruction Bus
Address Bus
Control Bus
Memory
11. Types of Computer Architectures
11
Harvard CPU
Instructions
Memory
Data
Memory
Instruction Bus
Address Bus
Control Bus
Data Bus
Address Bus
Control Bus
14. Why to learn Assembly Language
âą There is a general impression that assembly
language is difficult to learn
âą In fact if you are not an expert, you will learn
assembly language quickly, as non-experts see
things with simplicity and the basic beauty of
assembly language is that it is exceptionally
simple.
âą Do not ever try to find a complication, as one will
not be there.
âą In assembly language what is written in the
program is all that is there, no less and no more.
15. 15
Why to learn Assembly Language
âą Assembly language commands are a symbolic
representation of machine language commands
using âEnglish likeâ keywords called âmnemonicsâ
âą Using assembly language commands, its much
easier to program as compared to machine
language in the form of long strings of 1s and 0s
âą Commands in assembly language have a one-to-
one correspondence with machine language
commands
16. 16
Example
âą Some assembly language instructions of the
x86 family of computers and their equivalent
machine language instructions
Assembly
Language
Machine Language
(Binary)
Machine
Language
(Hex)
Instruction
type
add cx, dx 0000 0001 1101 0001 01 D1 Arithmetic
mov alx, 34h 1011 1000 0011 0100 0000 0000 B8 34 00 Data transfer
xor ax, bx 0011 0001 1101 1000 31 D8 Logic
jmp alpha 1110 1011 1111 1100 EB FC Control
17. Why to learn Assembly Language
âą Why should we learn assembly language when
there are higher level languages one better than
the other
âA translator translating from English to Japanese
âThink about a three-color picture scanned at 300 dots per inch
making 90000 pixels per square inch.
âNow a processing on this picture requires 270000 operations
per square inch, one operation for each color of each pixel.
âA few extra instructions placed by the translator can cost hours
of extra time.
âThe only way to optimize this is to do it directly in assembly
language.
âIMPORTANT: This doesnât mean that the whole application has
to be written in assembly language, which is almost never the
case. Itâs only the performance critical part that is coded in
assembly language to save few extra cycles that matter at that
18. Why to learn Assembly Language
âą Time Critical / Real time systems
âReal time systems have time bound responses
âFor such precise timing requirement, we must keep
the instructions in our total control.
âIn higher level languages we cannot even tell how
many computer instructions were actually used
âIn assembly language we have precise control over
them
âą No assembly language, no optimization
âą Sometimes a useful application becomes
useless just because it is not optimized
19. Why to learn Assembly Language
âą For reverse engineering â
âtaking malware and figuring out what it does
âą Vulnerability research
âTaking a program and finding flaws in it
âą Exploit crafting
âWriting code to take advantage of a flaw in a program
âą Some types of forensics, memory forensics in
particular
âFiguring out what happened during a cyber attack
âą And many more.
20. Machine Language vs Assembly Language
Machine Language Assembly Language
Only understandable by the computers.
only understandable by humans not by
computers.
Represented in binary format(0s and 1s)
Represented with mnemonics such as Mov,
Add, Sub etc.
Difficult to understand by human beings. Easy to understand by the human being.
Error fixing is almost impossible
Error fixing can be done in assembly
language.
Difficult to memorize so difficult to learn
Easy to memorize (mnemonics) thus easy
to learn
Execution is fast as all data is already in
0s and 1s
Execution is slow as compared to machine
language.
There is no need of translator Assembler is used as translator
Machine language is hardware
dependent.
Assembly language is the machine
dependent and it is not portable.