Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.

Slides:



Advertisements
Similar presentations
The CPU The Central Presentation Unit What is the CPU?
Advertisements

Computer Architecture
Microprocessors.
Processor System Architecture
MICRO PROCESSER The micro processer is a multipurpose programmable, clock driven, register based, electronic integrated device that has computing and decision.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Processor Technology and Architecture
Data Manipulation Computer System consists of the following parts:
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Computer Organization and Assembly language
Basic Computer Organization CH-4 Richard Gomez 6/14/01 Computer Science Quote: John Von Neumann If people do not believe that mathematics is simple, it.
Chapter 17 Microprocessor Fundamentals William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Computer Systems 1 Fundamentals of Computing The CPU & Von Neumann.
Basic Microcomputer Design. Inside the CPU Registers – storage locations Control Unit (CU) – coordinates the sequencing of steps involved in executing.
Lecture 8 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
created by :Gaurav Shrivastava
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
MICROCOMPUTER ARCHITECTURE 1.  2.1 Basic Blocks of a Microcomputer  2.2 Typical Microcomputer Architecture  2.3 Single-Chip Microprocessor  2.4 Program.
General Concepts of Computer Organization Overview of Microcomputer.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
CHAPTER 4 The Central Processing Unit. Chapter Overview Microprocessors Replacing and Upgrading a CPU.
Introduction to Microprocessors
MICROOCESSORS AND MICROCONTROLLER:
Lecture 15 Microarchitecture Level: Level 1. Microarchitecture Level The level above digital logic level. Job: to implement the ISA level above it. The.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Overview von Neumann Architecture Computer component Computer function
Computer operation is of how the different parts of a computer system work together to perform a task.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
GROUP 2 CHAPTER 16 CONTROL UNIT Group Members ๏ Evelio L. Hernandez ๏ Ashwin Soerdien ๏ Andrew Keiper ๏ Hermes Andino.
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
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.
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
Control Unit Operations Chapter10:. What is Control Unit (CU)?(1)  Part of a CPU or other device that directs its operation.  Tells the rest of the.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Capability of processor determine the capability of the computer system. Therefore, processor is the key element or heart of a computer system. Other.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
CPIT Program Execution. Today, general-purpose computers use a set of instructions called a program to process data. A computer executes the.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
Unit Microprocessor.
8085 Microprocessor Architecture
Basic Computer Organization and Design
COURSE OUTCOMES OF Microprocessor and programming
Introduction to microprocessor (Continued) Unit 1 Lecture 2
Lecture on Microcomputer
Assembly Language for Intel-Based Computers, 5th Edition
Introduction of microprocessor
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Number Representations and Basic Processor Architecture
MICROCOMPUTER ARCHITECTURE
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Control Unit Introduction Types Comparison Control Memory
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
A Top-Level View Of Computer Function And Interconnection
Register sets The register section/array consists completely of circuitry used to temporarily store data or program codes until they are sent to the.
Presentation transcript:

Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language

Computer and Information Sciences College / Computer Science Department Chapter 2 MICROCOMPUTER ARCHITECTURE 2

2.1 Basic Blocks of a Microcomputer 2.2 Typical Microcomputer Architecture 2.3 Single-Chip Microprocessor 2.4 Program Execution by Conventional Microprocessors 2.5 Program Execution by typical 32-bit Microprocessors 2.6 Scalar and Superscalar Microprocessors 2.7 RISC vs. CISC Outline 3

 A microcomputer has three basic blocks: 1. A central processing unit (CPU) 2. A memory unit (RAM & ROM) 3. An input/output (I/O) unit.  The CPU(microprocessor) executes all the instructions and performs arithmetic and logic operations on data.  A memory unit stores both data and instructions. The memory section typically contains ROM and RAM chips.  A system bus (comprised of several wires) connects the these blocks. 2.1 Basic Blocks of a Microcomputer 4

5 In a single-chip microcomputer, these three elements are on one chip. Whereas in a single-chip microprocessor, separate chips are required for memory and I/O.

 The microcomputer’s system bus contains three buses: Address, Data, and Control bus  WRITE operation: when a memory or an I/O chip receives data from the microprocessor and data is written into a selected memory location or an I/O port (register).  READ operation : when a memory or an I/O chip sends data to the microprocessor, and data is read from a selected memory location or an I/O port System Bus 6

 The Address Bus  Unidirectional bus: Information transfer takes place in only one direction, from the microprocessor to the memory or I/O elements.  Typically 20 to 32 bits long.  The size of the address bus determines the total number of memory addresses available  The data bus  bidirectional bus: data can flow in both directions, that is, to or from the microprocessor.  The size of the data bus varies from one microprocessor to another System Bus For example : microprocessor with 32 address pins can generate 2 32 = 4,294,964,296 bytes 7

 The control bus consists of a number of signals that are used to synchronize operation of the individual microcomputer elements. Memory read/write signal. I/O read/write signal. Interrupt request. Clock signals. Transfer ACK Bus request Bus grant Interrupt ACK Reset System Bus Is it Unidirectional or bidirectional bus ??

Operations Of Bus The operation of the bus is as follows: If one module wishes to send data to another, it must do two things: (1) (1) Obtain the use of the bus. (2) Transfer data via the bus. If one module wishes to request data from another module, it must: (1) Obtain the use of the bus. (2)Transfer a request to the other module over the appropriate control and address lines. It must then wait for that second module to send the data.

 The system clock signals are contained in the control bus.  The clock frequency f: the number of cycles per second (hertz, abbreviated Hz).  Clock frequency (rate): cycles per second Clock cycle = 1/f  clock frequency determines the speed of the microcomputer.  e.g., 4.0GHz = 4000MHz = 4.0×10 9 Hz  Clock period: duration of a clock cycle  e.g., 250ps = 0.25ns = 250×10 –12 s Clock Signals Clock (cycles) Data transfer and computation Update state Clock period

The microprocessor is the CPU of the microcomputer The logic inside the microprocessor chip can be divided into three main areas: 1. The arithmetic-logic unit (ALU). 2. The register section. 3. The control unit. 2.3 Single-Chip Microprocessor

Basic Blocks of a Computer Components

The number, size, and types of registers vary from one microprocessor to another. Basic Microprocessor Registers:  Instruction Register IR: stores instructions. The word size of the microprocessor determines it’s size.  Program Counter PC/IP: contains the address of the next instruction to be executed. The size of the program counter is determined by the size of the address bus  Memory Address Register MAR: contains the address of data. The microprocessor uses that address as a direct pointer to memory. The contents of the address is the actual data that is being transferred.  Accumulator Registers 13

How Program Counter is Work ? 1. Upon activating the microprocessor’s RESET input, the address of the first instruction to be executed is loaded into PC. 2. To execute an instruction, the microprocessor typically places the contents of PC on the address bus and reads (“fetches”) the contents of this address(i.e., instruction) from memory 3. PC contents are incremented automatically by the microprocessor’s internal logic. Microprocessor executes a program sequentially, unless the program contains an instruction such as a JUMP instruction, which changes the sequence Registers 14

General Purpose Register (GPR)/ Accumulator: stores the result after most ALU operations. In 8-bit microprocessors the instructions to shift or rotate the Accumulator one bit to the right or left through the carry flag. In16- and 32-bit microprocessors the accumulator is replaced by a GPR. Any GPR can be used as an Accumulator. GPR can hold data, memory addresses, or the results of arithmetic or logic operations. Most registers are GPR, but some, such as (PC),are provided for dedicated functions Registers 15

The main purpose of the control unit is to read and decode instructions from the program memory. To execute an instruction, the control unit steps through the appropriate blocks of the ALU based on the op-codes contained in the instruction register Control Unit

Control Signals RESET: common input to all microprocessors. When this input pin is driven HIGH or LOW, the PC is loaded with a predefined address specified by the manufacturer. READ/WRITE (R/W) : common output to all microprocessors. Tells the other microcomputer elements whether the microprocessor is performing a READ or a WRITE operation.  HIGH indicates a READ operation  LOW indicates a WRITE operation Control Unit 17

Control Signals READY: input to a microprocessor. Slow devices (memory and I/O) use this signal to gain extra time to transfer data to or receive data from a microprocessor. READY is active LOW signal, that is, LOW indicates that the microprocessor is ready. Therefore, when the microprocessor selects a slow device, the device places a LOW on the READY. The microprocessor responds by suspending all its internal operations and enters a WAIT state. When the device is ready to send or receive data, it removes the READY signal. The microprocessor comes out of the WAIT state and performs the appropriate operation Control Unit

Control Signals Interrupt Request (INT or IRQ). The external I/O devices can interrupt the microprocessor via IRQs. When this signal is activated by the external devices, the microprocessor service IRQ by interrupt service routine. Interrupt service program is written by the user for performing tasks that the interrupting device wants the microprocessor to carry out. After completing this program, the microprocessor returns to the main program it was executing when the interrupt occurred Control Unit

The ALU performs all the data manipulations, such as arithmetic and logic operations, inside a microprocessor. The size of the ALU conforms to the word length of the microcomputer. ALU Functions: 1.Binary addition and logic operations 2. Finding the one’s complement of data 3. Shifting or rotating the contents of a general-purpose register 1 bit to the left or right through a carry Arithmetic-Logic Unit

2.3.4 Functional Representations of Simple and Typical Microprocessors Buffer Register : Stores any data read from memory for further processing by the ALU.

Typical Microprocessor Pentium I

The Pentium contains two instruction pipelines: the U-pipe and the V-pipe. The U-pipe can execute all integer and floating-point instructions. The V-pipe can execute simple integer instructions The Pentium contains two separate cache memories: code cache and data cache. 23 Typical Microprocessor Pentium I

The control unit performs two basic operations: 1. instruction interpretation 2. and instruction sequencing. There are two methods for designing a control unit: Simplified Explanation of Control Unit design

2.3.5 Simplified Explanation of Control Unit design How incrementing the contents of the register by 1 is done in microprogramming control ??

The three steps for completing the instruction: 1.Fetch: The microprocessor fetches (instruction read) the instruction from the main memory (external to the microprocessor) into the instruction register. 2. Decode: The microprocessor decodes or translates the instruction using the control unit. The control unit inputs the contents of the instruction register, and then decodes (translates) the instruction to determine the instruction type. 3. Execute: The microprocessor executes the instruction using the control unit. To accomplish the task, the control unit generates a number of enable signals required by the instruction. 2.4 Program Execution by Conventional Microprocessors

For example: register R3= register R1 + register R2 A conventional microprocessor performs the following steps: 1. The microprocessor fetches the instruction into IR 2. The control unit CU decodes the contents of IR 3. The CU executes the instruction by generating enable signals for the register and ALU sections to perform the following: a. The CU transfers the contents of registers R1 and R2 from the Register section into the ALU. b. The CU commands the ALU to ADD. c. The CU transfers the result from the ALU into register R3 of the register section. 2.4 Program Execution by Conventional Microprocessors 31

Instruction Pipelines Instruction cycle typically involves the following activities: 1. Instruction fetch -  needs five clocks to complete 2. Instruction decode 3. Operand fetch (Data Read) 4. Operation execution 5. Result routing Pipelining 32

Multi-stage pipeline Pipelining makes it possible for processor to execute instructions in parallel Instruction execution divided into discrete stages Example of a non- pipelined processor. For example, Many wasted cycles.

Pipelined execution More efficient use of cycles, greater throughput of instructions: (80486 started to use pipelining) For k stages and n instructions, the number of required cycles is: k + (n – 1) compared to k*n

Basic Concept Pipelining 35 Hi is Hardware designed to perform activity Ai

2.5.1 Pipelining 36

Effects of Pipelining

Instruction Pipelining

Scalar processors such as the can execute one instruction per cycle. The contains only one pipeline. Superscalar microprocessors, can execute more than one instruction per cycle. These microprocessors contain more than one pipeline. The Pentium, a superscalar microprocessor, contains two independent pipelines. This allows the Pentium to execute two instructions per cycle. 2.6 Scalar and Superscalar Microprocessors

Superscalar A superscalar processor has multiple execution pipelines. In the following, note that Stage S4 has left and right pipelines (u and v). For k states and n instructions, the number of required cycles is: k + n Pentium: 2 pipelines Pentium Pro: 3

2.7 RISC vs. CISC: two types of microprocessor 42 CISC: Complex Instruction Set Computer RISC: Reduced Instruction Set Computer large number of instructions and many addressing modes One instruction per cycle a simple instruction set with a few addressing modes slower clock ratefast clock rate complex control unit, thus requiring microprogrammed implementation. hardwired control Unit more difficult to pipeline;more efficient pipelining. complex programs require fewer instructions in CISC RISC requires a large number of instructions to accomplish the same task

Intel’s original Pentium is a CISC microprocessor. Not clear cut Many designs borrow from both philosophies Intel Pentium Pro and other succeeding members of the Pentium family and Motorola use a combination of RISC and CISC architectures for providing high performance. 2.7 RISC vs. CISC 43