0% found this document useful (0 votes)
7 views42 pages

1 Introduction

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 42

Computer Organization

Introduction
Engr. Osama Bin Naeem
What is this course
about?
 To understand organization of a computer system
 To gain an insight knowledge about the internal architecture and
working of microprocessors.
 To understand working of memory devices, interrupt controllers
Course and I/O devices.
Objectives  To learn Assembly Language
 To understand how low level logic is employed for problem solving
by using assembly language as a tool.

3
 Basic Structure & Components of a Computer System
 Difference in Computer Organization & Computer Architecture
 Computer Evolution
 Microprocessor & Microcontrollers
 Interconnection Structures
Course  Memory Organization
Contents  Data Representation
 Instruction Set
 Processor Structure & Function
 Interrupts
 Processor Registers & FLAGS

4
 Assembly Language
 Syntax
 Basic Instructions
 Flow Control Instructions
 High Level Language Structures
Course  Logic, Shift and Rotate Instructions
Contents 

The Stack
Multiplication & Division Instructions
Contd..  Array & Addressing Modes
 String Instructions
 Procedures & Macros
 Translation of high level language into assembly language.

5
An Example System
Consider this advertisement: z? ?
MH

e? ?
a ch MB?
C ?
L1

CI ? ?
P
US
B? ?

What does it all mean??


6
An Example System

The microprocessor is the “brain” of


the system. It executes program
instructions. This one is a Pentium
(Intel) running at 4.20GHz.

A system bus moves data within the


computer. The faster the bus the better.
This one runs at 400MHz.

7
An Example System

This system has 256MB of (fast)


synchronous dynamic RAM
(SDRAM) . . .

… and two levels of cache memory, the level 1 (L1)


cache is smaller and (probably) faster than the L2 cache.
Note that these cache sizes are measured in KB.

8
An Example System
Hard disk capacity determines
the amount of data and size of
programs you can store.

This one can store 80GB. 7200 RPM is the rotational


speed of the disk. Generally, the faster a disk rotates,
the faster it can deliver data to RAM. (There are many
other factors involved.)

9
An Example System

ATA (advanced technology attachment) which describes how the


hard disk interfaces with (connects to) other system components.

10
An Example System
Ports
allow movement of data between a
system and its external devices.

This system has ten ports.

• Serial ports send data as a series of pulses along one or two data lines.
• Parallel ports send data as a single pulse along at least eight data lines.
• USB (Universal Serial Bus), is an intelligent serial interface that is self-
configuring. (It supports “plug and play.”)
11
 ARCHITECTURE is those attributes visible to the programmer.
 Instruction set, number of bits used for data representation, I/O
mechanisms, addressing techniques.

 Is there a multiply instruction?

Architecture
&
Organization  ORGANIZATION is how features are implemented.
 Computer organization mainly deals with how a particular
hardware works.
 Control signals, interfaces, memory technology.

 Is there a hardware multiply unit or is it done by repeated addition?


 Computer Architecture refers to those attributes of a system
visible to a programmer
 Those attributes that have direct impact on logical execution of a
program.
 Architectural attributes include:
 the instruction set,
Computer  no. of bits used to represent various data types (numbers,
Architecture characters etc),
 I/O mechanisms and technology for addressing memory.

 Example: Architectural design issue whether a computer will


have multiply instruction or not.

13
 Organization is how features are implemented.
How does a Computer Work?
 For Example: Is there a special hardware multiply unit for
multiplication operation or is it done by repeated addition?
What is  Computer Organization refers to the operational units and their
Computer interconnections that realize the architectural specifications.
 Organizational attributes:
Organization?  hardware details transparent to the programmer such as control
signals,
 interfaces between peripherals and the computer,
 the memory technology used.

14
 Architecture:
 Logical aspects of computer hardware that are visible to the
Computer programmer
 What instruction a computer understands!
Organization
vs.  Organization:
Architecture  Physical aspects of computer hardware that are invisible to the
programmer
 How does the computer hardware carries out instructions!

15
 Computer Organization must be designed to implement a
particular architectural specifications.
Computer
Organization  It is possible to have same architecture but different
vs. organizations.
Architecture  All computers in the Intel Pentium series have the same architecture.
 Each version of the Pentium has a different organization or
Contd.. implementation.

16
 Architectural Issues:
Computer  Reduced Instruction Set Computing (RISC)
Organization  Complex Instruction Set Computing (CISC)
 Pipeline etc
vs.
Architecture  Organizational Issues:
Contd..  I/O, control unit, memory etc

17
 Understand how computer works!
 Computer functional components, their characteristics, their
Why Study performance, and their interactions.

Computer
Organization?  How to select a system?
 Understand tradeoff among various components, such as memory
size, CPU clock speed etc.

18
 All Intel x86 family share the same basic ARCHITECTURE.
 This gives code compatibility.
Architecture
&  ORGANIZATION differs between different versions.

Organization
 Composed of applications and is the level with which everyone is
most familiar.

THE  At this level, we run programs such as word processors, graphics


packages, or games. The lower levels are nearly invisible from the
COMPUTER - User Level.

Level
Hierarchy

Level - 6
 The level with which we interact when we write programs in
languages such as C, C++ and Java.
 These languages must be translated to a language the
machine can understand. (using either a compiler or
an interpreter)
Level – 5
 Compiled languages are translated into assembly language
High-Level Language and then assembled into machine code. (They are
translated to the next lower level.)
 The user at this level sees very little of the lower
levels.
 Acts upon assembly language produced from Level 5, as
well as instructions programmed directly at this level

 As previously mentioned, compiled higher-level


languages are first translated to assembly, which is then
Level-4 directly translated to machine language. This is a one-to-
one translation, meaning that one assembly language
Assembly Language instruction is translated to exactly one machine language
Level instruction.

 By having separate levels, we reduce the signicant gap


between a high-level language, such as C++, and the
actual machine language
 Deals with operating system instructions.

Level-3  This level is responsible for multiprogramming,


protecting memory, synchronizing processes, and
System Software various other important functions.
Level
 Often, instructions translated from assembly
language to machine language are passed through
this level unmodified
 Consists of instructions OR ISA(instruction set
Level-2 architecture) that are particular to the architecture of
the machine
Machine Level
 Programs written in machine language need no
compilers, interpreters, or assemblers.
 A control unit decodes and executes instructions and moves
data through the system.

 Control units can be microprogrammed or hardwired.


Level -1
 A microprogram is a program written in a low-level language
Control Level that is implemented by the hardware.

 Hardwired control units consist of hardware that directly


executes machine instruction
 This level is where we find digital circuits (the chips).

 Digital circuits consist of gates and wires.

Level – 0  These components implement the mathematical logic of all


other levels.
Digital Logic Level
Programming  High-Level Languages (HLL)
Languages  Assembly Language
 Machine Language

27
 Allow programmers to write programs that look
more like natural language.
 Examples: C++, Java, C#.NET etc
 A program called Compiler is needed to translate
a high-level language program into machine
High-Level code.
Language  Each statement usually translates into multiple
machine language instructions.

28
 The "native" language of the computer
 Numeric instructions and operands that can be stored in
memory and are directly executed by computer system.
 Each ML instruction contains an op code (operation
code) and zero or more operands.
Machine  Examples:
Language
Opcode Operand Meaning
-------------------------------------------------
40 increment the AX register
05 0005 add 0005 to AX

29
 Use instruction mnemonics that have one-to-one
correspondence with machine language.
 An instruction is a symbolic representation of a single
machine instruction
Assembly  Consists of:
 label always optional
Language  mnemonic always required
 operand(s) required by some instructions
 comment always optional

30
Sample Program

1. mov ax, 5 ax 05 Memory


011C
2. add ax, 10 ax 15 011E
35 0120
3. add ax, 20 ax 35 0122
0124
4. mov [0120], ax ax 35 0126

5. int 20

31
 Assembler is a program that converts source-code programs into a
machine language (object file).
 Linker joins together two or more object files and produces a single
executable file.
Essential Tools  Debugger loads an executable program, displays the source code,
and lets the programmer step through the program one instruction at
a time, and display and modify memory.
 Emulator allows you to load and run assembly language programs,
examine and change contents of registers. Example: EMU8086

32
 Learn how a processor works
 Explore the internal representation of data and instructions
 How to structure a program so it runs more efficiently.
Why Learn
Assembly  Compilers/Device Drivers/ OS codes
Language?  Games/Embedded System

33
Structure  STRUCTURE is the way in which components relate to each other.
&
Function  FUNCTION is the operation of individual components as part of
the structure.
Peripherals Computer

Central Main
Processing Memory
Unit
STRUCTURE Computer Systems
Interconnection

Top Level
Input
Output
Communication
lines
CPU

Computer Arithmetic
Registers and
STRUCTURE I/O
System
CPU
Login Unit
Bus
Internal CPU
Interconnection
Memory

The CPU
Control
Unit
Control Unit

CPU
Sequencing

STRUCTURE ALU
Internal Control
Login

Bus Unit
Control Unit

The Control
Registers Registers and
Decoders

Unit
Control
Memory
 Data processing

 Data storage

Function
 Data movement

 Control
OPERATIONS

Data
Movement
OPERATIONS

Storage
OPERATIONS

Processing
From / To
Storage
OPERATIONS

Processing
From Storage
to I / O

You might also like