Computer Organization Authors: Carl Hamacher, Zvonko Vranesic, Safwat Zaky By Prof R.R.Karwa.

Slides:



Advertisements
Similar presentations
1 Instructions and Addressing
Advertisements

0 What is a computer?  Simply put, a computer is a sophisticated electronic calculating machine that:  Accepts input information,  Processes the information.
Computer Organization
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Computers Are Your Future Eleventh Edition Chapter 2: Inside the System Unit Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall1.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
Computer Architecture And Organization UNIT-II General System Architecture.
Computer Organization & Assembly Language © by DR. M. Amer.
I/O Memory Reg File ALU Program Counter Instruction Register Control Interconnect Control 1)PC contains mem address of Instruction, 2)From memory, instr.
CSCI-100 Introduction to Computing Hardware Part I.
M. Mateen Yaqoob The University of Lahore Spring 2014.
Computer Architecture Lecture 03 Fasih ur Rehman.
CPS 4150 Computer Organization Fall 2006 Ching-Song Don Wei.
12/13/ _01 1 Computer Organization EEC-213 Computer Organization Electrical and Computer Engineering.
Computer Organization Instructors Course By: Lecturer: Shimaa Ibrahim Hassan TA: Eng: Moufeda Hussien Lecture: 9:45 Address:
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Overview of microcomputer structure and operation
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
1 Instructions and Addressing Course website:
Computer Architecture Furkan Rabee
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Introduction :: Computer Organization and Architecture Computer.
1 CSCI 2510 Computer Organization Memory Addressing and Assembly Instruction Basics.
Computer Organization and Architecture Lecture 1 : Introduction
Basic Computer Organization and Design
What is a computer? Simply put, a computer is a sophisticated electronic calculating machine that: Accepts input information, Processes the information.
Lecture 5: Computer systems architecture
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Microprocessor Systems Design I
What is a computer? Simply put, a computer is a sophisticated electronic calculating machine that: Accepts input information, Processes the information.
Chapter 7.2 Computer Architecture
Computer Architecture
Assembly Language for Intel-Based Computers, 5th Edition
Introduction of microprocessor
CS1251 Computer Architecture
Components of Computer
Microcomputer Architecture
Computer Organization and Design
Computer Organization and Assembly Language (COAL)
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Computer Organization
Number Representations and Basic Processor Architecture
Multicultural Social Community Development Institute ( MSCDI)
Prepared By:- Parminder Mann
Functional Units.
Computer Architecture
The Von Neumann Model Basic components Instruction processing
so Subject Name: Computer Organization Subject Code: 10CS46
CENTRAL PROCESSING UNIT
MARIE: An Introduction to a Simple Computer
Introduction to Micro Controllers & Embedded System Design
Chapter 5: Computer Systems Organization
Chapter 2: Computer Hardware
Registers.
Overview of Computer Architecture and Organization
Computer Architecture
The Von Neumann Architecture
Introduction to Microprocessor Programming
Introduction to Computer Architecture
Chapter 5 Computer Organization
Computer Architecture
Course Outline for Computer Architecture
Information Representation: Machine Instructions
COMPUTER ORGANIZATION AND ARCHITECTURE
Prepared By:- Bhim Singh
Computer Architecture
Computer Operation 6/22/2019.
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Computer Organization Authors: Carl Hamacher, Zvonko Vranesic, Safwat Zaky By Prof R.R.Karwa

BASIC STRUCTURES OF COMPUTERS Part A BASIC STRUCTURES OF COMPUTERS

Computer Fast electronic machine Accepts digitized Input Process stored instructions(Program) Produce Output

Functional Units Figure 1.1. Basic functional units of a computer. Arithmetic Input and logic Memory Output Control I/O Processor Figure 1.1. Basic functional units of a computer.

(ALU + Control Unit = CPU) Functional Unit Input Unit : Accepts data from I/p devices, convert that data into computer acceptable format and supplies converted data to computer system for further processing. Output Unit : Accepts result produced by computer which is in computer acceptable format, convert that into human readable format and lastly supplied converted result to outside world through o/p devices. ALU : Place where actual execution takes place during processing. Control Unit : Direct all activities in computer. (ALU + Control Unit = CPU)

Functional Unit Memory Unit: Stores a) data to be processed b) intermediate result of processing c) Final result before result are released to o/p device Two classes of Storage (Memory) : i)Primary (Internal/Main memory) : directly accessed by CPU, Fast, Volatile (Content erased when power interrupt), Non- removable, Example: RAM & Cache ii)Secondary (External memory/Auxiliary memory): Non volatile, removable, Larger & Cheaper, Example: Hard drive, optical disk, magnetic disk etc.

Cache Memory Volatile computer memory that provide high speed data access to processor Stores frequently used computer data. At start, Cache is empty. All data is in Main memory. As during execution data is required, it is fetched from main memory and copies placed in cache. Fetching from Cache reduces processing time. Example: (in classroom)

Computer Organization Vs. Computer Architecture Architecture: refers to those attributes of system that is visible to programmer, that have a direct impact on Logical execution of a program. Architecture attributes include Instruction set, Number of bits used to represent data type, techniques for addressing memory etc. Organization: refers to operational unit and their interconnections that realize the architectural specification. Organizational attribute includes H/w details transparent to programmer such as Control signals, interfaces between computer and peripherals etc. (Creating a design of house is Architecture while Building the house is Organization)

Historical Perspective : Generations of Computers First (1945-1955, Processing using Vaccum tube, faster than earlier mechanical & electromechanical technology, assembly language was used to prepare program and was translated into machine language for execution) Second (1955-1965, Transistor invented & replaced vaccum tube, faster than first generation, high level language developed & used, compilers developed to convert high level to assembly which was then translated into machine language, separate I/O processors developed that improved performance, Manufacturer Example : IBM) Third (1965-1975, Many transistor on single chip that is Integrated Circuits, Introduction of Microprogramming, Parallelism, Pipelining, Cache memory, Example: System 360 mainframe computer from IBM)

Historical Perspective : Generations of Computers Fourth: (1975 onwards, Tens of thousand of Transistors on a single chip, named Very large scale IC. Complete processor on one chip : microprocessor, Organizational concept evolved, LAN WAN MAN introduced, Manufacturer example: Texas, Intel, Motorola etc. ) Beyond The Fourth : (Computer featuring Artificial Intelligence, Parallel machines, Distributed system are examples of current trends.)

BUS Structures There are many ways to connect different parts inside a computer together. A group of lines that serves as a connecting path for several devices is called a bus. Lines carry data, address. In addition, BUS must have Lines for control purposes

BUS Structures Single bus: Low cost, Flexible Multiple bus: Achieve more concurrency by allowing 2 or more transfer at a same time that lease better performance but at increased cost.

Performance of Computer Measured by How quickly it can execute program Factors/Affected by: a) Compiler (High level to machine language) b) Cache Memory (Slide 6) c) Technology = VLSI (Slide 9) d) Processor & System Organization (Next slide) == Parallelism, Pipelining, Multicore processor, Multicomputer, Multitasking e) Instruction set CISC & RISC (Later units)

Performance of Computer: Processor & System Organization Parallelism: Execute instruction concurrently. For example, next instruction could be fetched from memory at same time that an arithmetic operation is being performed on register operands of instruction (Pipelining) Multicore processors: Multiple processors on a single chip, called as Core. (Dual core, Quad core, Octal core) Multiprocessors: Large computer system may contain number of processor units, termed as Multiprocessors. Execute a number of different application tasks in parallel Execute subtasks of a single large task in parallel

Performance of Computer: Processor & System Organization Multicomputer : Interconnected group of complete computers to achieve high computational powers. Multitasking : Performing multiple task over a certain period of time by executing them concurrently. Computer resource can be used efficiently.

Part B MACHINE INSTRUCTIONS

Memory Location and Addresses second word first word Figure 2.5. Memory words. n bits last word i th word • Memory consists of many millions of storage cells, each of which can store 1 bit. Data is usually accessed in n-bit groups. n is called word length. Accessing main memory to store or retrieve a single item of information requires address for each item. A k-bit address memory has 2k memory locations, namely 0 – 2k-1, called memory space.

Memory Location and Addresses 32-bit word length example 32 bits • b b b b 31 30 1 Sign bit: b = for positive numbers 31 b = 1 for negative numbers 31 (a) A signed integer 8 bits 8 bits 8 bits 8 bits ASCII ASCII ASCII ASCII character character character character (b) Four characters

Byte and Word Addressing Memory It is impractical to assign distinct addresses to individual bit locations in the memory. The most practical assignment is to have successive addresses refer to successive byte locations in the memory – byte-addressable memory. Byte locations have addresses 0, 1, 2, … If word length is 32 bits, they successive words are located at addresses 0, 4, 8,… Byte is smallest addressable unit for a CPU. Such computers are called Byte Addressable.

Byte and Word Addressing Memory: Big Endian & Little Endian Big Endian: Bytes are numbered starting with MSB of a word. Word is given the same address as its MSB. Little Endian: Bytes are numbered starting with LSB of a word. Word is given the same address as its LSB.

Byte and Word Addressing Memory: Big Endian & Little Endian Byte address Byte address 1 2 3 3 2 1 4 4 5 6 7 4 7 6 5 4 • • k k k k k k k k k k 2 - 4 2 - 4 2 - 3 2 - 2 2 - 1 2 - 4 2 - 1 2 - 2 2 - 3 2 - 4 (a) Big-endian assignment (b) Little-endian assignment Figure 2.7. Byte and word addressing.

Memory Operations Load (Read/Fetch) Store (Write) Transfer data from Memory location to CPU. 2 Steps CPU sends the address of desired location to the main memory & request to read its content. Main memory reads the data stored at that address & sends them to CPU. Store (Write) Transfer data from CPU to Specific Memory location, destroying former contents of that location. CPU sends the address of desired location to the main memory, together with the data to be written to that location.

Instruction & Instruction Sequencing Task carried out by Computer program consist of sequence of small steps. 4 Types of Operation: Data transfer between memory & register (MOV,PUSH,POP) Arithmetic & Logic Operations on Data (ADD,SUB,MUL,DIV) Program sequencing & control (LOOP) I/O Transfers (IN,OUT)

Instruction & Instruction Sequencing Register Transfer Notation (RTN) Identify a location by a symbolic name standing for its hardware binary address (LOC, R0,…) Contents of a location are denoted by placing square brackets around the name of the location (R3 ←[R1]+[R2]) Assembly Language Notation Represent machine instructions and programs. Move LOC, R1 R1←[LOC] Add R1, R2, R3 R3 ←[R1]+[R2]

Basic Instruction Types/Formats Three address Format: Operation Source1, Source2, Destination ADD A,B,C C <- [A] + [B] Two address Format: Operation Source, Destination ADD A,B B <- [A] + [B] (Problem: Original content of B is destroyed. Solution: MOV A,R0 ADD B,R0 MOV RO,C i.e. C <- [A] + [B]

Basic Instruction Types/Formats One address Format: Operation Source/Destination ADD A AC <- AC + [A] Example: C <- [A] + [B] i.e. LOAD A (AC <- A) ADD B (AC <- [B] + AC) STORE C (C <- AC) Zero address Format: Operation ( NO Source/Destination) Example: PUSH

Numerical Example: Evaluate (A+B)  (C+D) Three-Address ADD A, B, R1 ; R1 ← M[A] + M[B] ADD C, D, R2 ; R2 ← M[C] + M[D] MUL R1,R2,X ; M[X] ← R1  R2

Example: Evaluate (A+B)  (C+D) Two-Address MOV A,R1 ; R1 ← M[A] ADD B,R1 ; R1 ← R1 + M[B] MOV C,R2 ; R2 ← M[C] ADD D,R2 ; R2 ← R2 + M[D] MUL R1, R2 ; R2 ← R1  R2 MOV R2,X ; M[X] ← R2

Example: Evaluate (A+B)  (C+D) One-Address LOAD A ; AC ← M[A] ADD B ; AC ← AC + M[B] STORE T ; M[T] ← AC LOAD C ; AC ← M[C] ADD D ; AC ← AC + M[D] MUL T ; AC ← AC  M[T] STORE X ; M[X] ← AC

Example: Evaluate (A+B)  (C+D) Zero-Address PUSH A ; TOS ← A PUSH B ; TOS ← B ADD ; TOS ← (A + B) PUSH C ; TOS ← C PUSH D ; TOS ← D ADD ; TOS ← (C + D) MUL ; TOS ← (C+D)(A+B) POP X ; M[X] ← TOS

Instruction Execution and Straight-Line Sequencing Address Contents Assumptions: - One memory operand per instruction - 32-bit word length - Memory is byte addressable - Full memory address can be directly specified in a single-word instruction Begin execution here i Move A,R0 3-instruction i + 4 Add B,R0 program segment i + 8 Move R0,C A Data for B the program Two-phase procedure Instruction fetch Instruction execute C . A program for C ¬ [A] + [B].

Instruction Execution and Straight-Line Sequencing CPU contains register PC that holds the address of instruction to be executed next. To begin execution, address of first instruction must be placed in PC. CPU control circuits use the information in PC to fetch & execute the instruction in increasing order, referred as Straight line sequencing. As each instruction is executed, the PC is incremented by 4 to point next instruction

Instruction Execution and Straight-Line Sequencing Two-phase procedure Instruction fetch Instruction is fetched from memory location whose address is in the PC & is placed in Instruction register Instruction execute Instruction is in the IR is examined to determine which operation is to be performed. Operation is performed by processor. Between this two phase, PC is advanced to next instruction. After first execution phase is over, New instruction fetch can begin

ADDRESSING MODES