CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH (5) Computer Organization CPIT 201.

Slides:



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

Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
COMPUTER ORGANIZATION CHAPTER SUBSYSTEM INTERCONNECTION.
Computer Architecture and Data Manipulation Chapter 3.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Chapter 5: Computer Systems Organization Invitation to Computer Science, C++ Version, Third Edition Added to by S. Steinfadt - Spring 2005 Additional source.
©Brooks/Cole, 2003 Chapter 5 Computer Organization.
Chapter 0 Introduction to Computing
Data Manipulation Computer System consists of the following parts:
The CPU - Outline. Components of CPU Englander p
I/O Subsystem Organization and Interfacing Cs 147 Peter Nguyen
©Brooks/Cole, 2003 Chapter 5 Computer Organization.
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.
Computer Systems CS208. Major Components of a Computer System Processor (CPU) Runs program instructions Main Memory Storage for running programs and current.
Chapter 5 Computer Organization ( 計算機組織 ). Distinguish between the three components of a computer hardware. List the functionality of each component.
0 What is a computer?  Simply put, a computer is a sophisticated electronic calculating machine that:  Accepts input information,  Processes the information.
5.1 Chaper 4 Central Processing Unit Foundations of Computer Science  Cengage Learning.
5 Computer Organization
COMPONENTS OF THE SYSTEM UNIT
C.S. Choy95 COMPUTER ORGANIZATION Logic Design Skill to design digital components JAVA Language Skill to program a computer Computer Organization Skill.
Processor Structure & Operations of an Accumulator Machine
Chapter 3 Computer Hard ware
Computer Processing of Data
Introduction to Computing: Lecture 4
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
Invitation to Computer Science 5th Edition
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
Chapter 5 Computing Components Nell Dale John Lewis.
5-1 Computer Components Consider the following ad.
CPU How It Works. 2 Generic Block Diagram CPU MemoryInputOutput Address Bus Data Bus.
Chapter 5 Computing Components. 5-2 Chapter Goals List the components and their function in a von Neumann machine Describe the fetch-decode-execute cycle.
SKILL AREA: 1.2 MAIN ELEMENTS OF A PERSONAL COMPUTER.
Chapter 5 Computer Organization. Distinguish between the three components of a computer hardware. List the functionality of each component. Understand.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Computer Organization. The digital computer is a digital system that performs various computational tasks Digital computer use binary number system which.
Electronic Analog Computer Dr. Amin Danial Asham by.
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
Chapter 5 Computing Components. 2 Computer Components Consider the following ad:
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
©Brooks/Cole, 2003 Chapter 5 Computer Organization.
Lecture 1: Review of Computer Organization
COMPURT ORGANAZTION CHAPTER 5. Computer Organization We can divide the parts that make up a computer into 3 subsystems : 1. Central processing unit (CPU).
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?
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.
Architectural Considerations A Review of Some Architectural Concepts.
Chapter 5: Computer Systems Organization Invitation to Computer Science,
Main Memory Main memory – –a collection of storage locations, –each with a unique identifier called the address. Word- –Data are transferred to and from.
CH (5) Computer Organization
Von Neumann Machines. 3 The Von Neumann Architecture Model for designing and building computers, based on the following three characteristics: 1)The.
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.
Chapter 5 Computer Organization ( 計算機組織 ). Distinguish between the three components of a computer hardware. List the functionality of each component.
Computer Architecture Adapted from CS10051 originally by Professor: Johnnie Baker Computer Science Department Kent State University von Neuman model.
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
What is a computer? Simply put, a computer is a sophisticated electronic calculating machine that: Accepts input information, Processes the information.
Computer Organization
Computer Organization
Chapter 5: Computer Systems Organization
Introduction to Computer Architecture
Chapter 5 Computer Organization
Presentation transcript:

CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH (5) Computer Organization CPIT 201 Introduction to Computing

CPIT 201 2

3 CPU

CPIT We can divide the parts that make up a computer into three broad categories or subsystem: the central processing unit (CPU), the main memory and the input/output subsystem. Computer hardware (subsystems)

CPIT Central Processing Unit The central processing unit (CPU) performs operations on data. In most architectures it has three parts: An arithmetic logic unit (ALU) A control unit A set of registers, fast storage locations.

CPIT The arithmetic logic unit (ALU) Performs logic, shift, and arithmetic operations on data Registers Registers are fast stand-alone storage locations that hold data temporarily. Multiple registers are needed to facilitate the operation of the CPU.  Data registers  Instruction register  Program counter

CPIT The Control Unit The third part of any CPU is the control unit. The control unit controls the operation of each subsystem. Controlling is achieved through signals sent from the control unit to other subsystems.

CPIT Computer hardware (subsystems)

CPIT Main Memory Main memory is the second major subsystem in a computer. It consists of a collection of storage locations, each with a unique identifier, called an address. Data is transferred to and from memory in groups of bits called words. A word can be a group of 8 bits, 16 bits, 32 bits or 64 bits (and growing). If the word is 8 bits, it is referred to as a byte. The term “byte” is so common in computer science that sometimes a 16-bit word is referred to as a 2-byte word, or a 32-bit word is referred to as a 4-byte word.

CPIT Main memory

CPIT Address Space To access a word in memory requires an identifier. Although programmers use a name to identify a word (or a collection of words), at the hardware level each word is identified by an address. The total number of uniquely identifiable locations in memory is called the address space. For example, a memory with 64 kilobytes and a word size of 1 byte has an address space that ranges from 0 to 65,535.

CPIT Memory addresses are defined using unsigned binary integers.

CPIT A computer has 32 MB (megabytes) of memory. How many bits are needed to address any single byte in memory? Example 5.1 A computer has 128 MB of memory. Each word in this computer is eight bytes. How many bits are needed to address any single word in memory? Example 5.2 Solution The memory address space is 32 MB, or 2 25 (2 5 × 2 20 ). This means that we need log2 2 25, or 25 bits, to address each byte. Solution The memory address space is 128 MB, which means However, each word is eight (2 3 ) bytes, which means that we have 2 24 words. This means that we need log2 2 24, or 24 bits, to address each word.

CPIT Memory Types Two main types of memory exist: RAM and ROM. Random access memory (RAM) “Volatile”  Static RAM (SRAM)  Dynamic RAM (DRAM) Read-only memory (ROM) “non-volatile”  Programmable read-only memory (PROM).  Erasable programmable read-only memory (EPROM).  Electrically erasable programmable read-only memory (EEPROM).

CPIT

CPIT Memory hierarchy Computer users need a lot of memory, especially memory that is very fast and inexpensive. This demand is not always possible to satisfy—very fast memory is usually not cheap. A compromise needs to be made. The solution is hierarchical levels of memory.

CPIT Cache Memory Cache memory is faster than main memory, but slower than the CPU and its registers. Cache memory, which is normally small in size, is placed between the CPU and main memory.

CPIT Input/Output Subsystem The third major subsystem in a computer is the collection of devices referred to as the input/output (I/O) subsystem. This subsystem allows a computer to communicate with the outside world and to store programs and data even when the power is off. Input/output devices can be divided into two broad categories: non-storage and storage devices.

CPIT Non-storage devices Non-storage devices allow the CPU/memory to communicate with the outside world, but they cannot store information.  Keyboard and Monitor  Printer

CPIT Storage devices Storage devices, although classified as I/O devices, can store large amounts of information to be retrieved at a later time. They are cheaper than main memory, and their contents are nonvolatile—that is, not erased when the power is turned off. They are sometimes referred to as auxiliary storage devices. We can categorize them as either magnetic or optical.

CPIT 201 A magnetic disk 21

CPIT 201

A magnetic tape 24

CPIT 201

Creation and use of CD-ROMs 26

CPIT 201 CD-ROM format 27

CPIT

CPIT 201 Making a CD-R 29

CPIT 201 Making a CD-RW 30

CPIT

CPIT 201

Subsystem Interconnection The previous sections outlined the characteristics of the three subsystems (CPU, main memory, and I/O) in a stand- alone computer. In this section, we explore how these three subsystems are interconnected. The interconnection plays an important role because information needs to be exchanged between the three subsystems.

CPIT Connecting CPU and Memory The CPU and memory are normally connected by three groups of connections, each called a bus: data bus, address bus and control bus. Connecting CPU and memory using three buses

CPIT 201 Memory Slots CPU Sockets

CPIT Connecting CPU and Memory The CPU and memory are normally connected by three groups of connections, each called a bus: data bus, address bus and control bus. Connecting CPU and memory using three buses

CPIT Data Bus  Is made of several connections.  Each carrying 1 bit at a time.  The number of connections depends on the size of the word.  EX: 32 bits word need data bus with 32 connections.

CPIT Address Bus  Allows access to a particular word in memory.  The number of connections depends on the Address space of the memory.  EX: memory with 2 n words need bus with n connections.

CPIT Control Bus  carries communication between CPU and memory  The number of connections depends on the total number of control commands a computer needs.  EX: a computer with 2 m control actions need m connections

CPIT 201

41 Connecting I/O devices I/O devices cannot be connected directly to the buses that connect the CPU and memory, because the nature of I/O devices is different from the nature of CPU and memory. I/O devices are electromechanical, magnetic, or optical devices, whereas the CPU and memory are electronic devices. I/O devices also operate at a much slower speed than the CPU/memory. There is a need for some sort of intermediary to handle this difference. I/O devices are therefore attached to the buses through input/output controllers or interfaces. There is one specific controller for each input/output device.

CPIT 201 Connecting I/O devices to the buses 42

CPIT Connecting I/O devices Controllers/Interfaces They are bridge the gap between the nature of the I/O device and the CPU and memory. Controller can be.. Serial: has only one data wire. Parallel: has several data connections

CPIT 201 Parallel Interface Serial Interface

CPIT 201

46 Connecting I/O devices Controllers/Interfaces Most common kinds of controllers… SCSI (Parallel Interface) FireWire (Serial Interface) USB (Serial Interface)

CPIT 201 SCSI controller 47 Macintosh Daisy Chained connection Both end connected to a terminator Each device much have a unique ID

CPIT 201 SCSI controller

CPIT 201 FireWire controller 49 IEEE High-Speed Interface transfer data as packets Used to connect devices in a daisy chain or tree using one connection. No need to termination

CPIT 201 FireWire controller

CPIT 201 USB controller 51 Used to connect low/high speed devices Devices easily removed or attached 4 wires cable (2 for power/2 for data)

CPIT 201

53 Addressing input/output devices The CPU usually uses the same bus to read data from or write data to main memory and I/O device. The only difference is the instruction. If the instruction refers to a word in main memory, data transfer is between main memory and the CPU. If the instruction identifies an I/O device, data transfer is between the I/O device and the CPU. There are two methods for handling the addressing of I/O devices: isolated I/O and memory-mapped I/O.

CPIT 201 Isolated I/O addressing 54 Instructions used to read/write memory and I/O devises are totally different There are instructions to Test, Control, Read from, Write to I/O devices Each I/O device has its own address. I/O addresses can OVERLAP with memory addresses without ambiguity because the instructions are different EX: CPU instructions “Read101”, “Input101”.

CPIT 201 Memory-mapped I/O addressing 55 CPU treats each register in the I/O controller as a word in memory. Advantage: Small number of instructions Disadvantage: part of memory address space is allocated to registers in I/O controllers If we have 5 controllers with 4 registers to each  20 addresses are used from memory

CPIT Program Execution Today, general-purpose computers use a set of instructions called a program to process data. A computer executes the program to create output data from input data.. Both the program and the data are stored in memory.

CPIT Machine Cycle The CPU uses repeating machine cycles to execute instructions in the program, one by one, from beginning to end. A simplified cycle can consist of three phases: fetch, decode and execute. The steps of a cycle

CPIT Input/output operation Commands are required to transfer data from I/O devices to the CPU and memory. Because I/O devices operate at much slower speeds than the CPU, the operation of the CPU must be somehow synchronized with the I/O devices. Three methods have been devised for this synchronization:  Programmed I/O  Interrupt driven I/O  Direct memory access (DMA)

CPIT Programmed I/O - Primitive - CPU waits for I/O device -The Data transferred to memory after the Input operation - The Data transferred from memory before the Output operation

CPIT Interrupt-driven I/O

CPIT DMA connection to the general bus -Transfer large data between high-speed I/O device and memory without using CPU. -Requires DMA controller which has register to hold a block of data before and after memory transfer. -CPU is idle for a short time -Type of transfer I/O - start address of memory location -Number of byte to be transfer

CPIT DMA input/output

CPIT Different Architectures The architecture and organization of computers has gone through many changes in recent decades. In this section we discuss some common architectures and organization that differ from the simple computer architecture we discussed earlier.

CPIT CISC CISC stands for Complex Instruction Set Computer. The strategy behind CISC architectures is to have a large set of instructions, including complex ones. Programming CISC-based computers is easier than in other designs because there is a single instruction for both simple and complex tasks. Programmers, therefore, do not have to write a set of instructions to do a complex task.

CPIT CISC CPU and Control Unit are very complicated. Two levels programming to simplify complication: o The instruction is not executed directly by CPU, CPU performs only simple operations called microoperation o A complex instruction is transformed into a set of these simple operations and then executed by the CPU. addition memory “micromemory” used to hold the set of operations for each complex instruction. The type of programming here called microprogramming

CPIT RISC RISC stands for Reduced Instruction Set Computer. The strategy behind RISC architecture is to have a small set of instructions that do a minimum number of simple operations. Complex instructions are simulated using a subset of simple instructions. Programming in RISC is more difficult and time-consuming than in the other design, because most of the complex instructions are simulated using simple instructions.

CPIT Pipelining A computer uses three phases, fetch, decode and execute, for each instruction. In early computers, these three phases needed to be done in series for each instruction. Instruction n needs to finish all these phases before instruction n + 1. Modern computers use a technique called pipelining to improve the throughput (the total number of instructions performed in each period of time). The idea is that if the control unit can do two or three of these phases simultaneously, the next instruction can start before the previous one is finished.

CPIT Pipelining

CPIT Parallel Processing Traditionally a computer had a single control unit, a single arithmetic logic unit and a single memory unit. With the evolution in technology and the drop in the cost of computer hardware, today we can have a single computer with multiple control units, multiple arithmetic logic units and multiple memory units. This idea is referred to as parallel processing. Like pipelining, parallel processing can improve throughput.

CPIT 201 Flynn’s taxonomy of computer organization Single Instruction Multiple Instruction Single Data SISDMISD Multiple Data SIMDMIMD

CPIT SISD organization Single Instruction, Single Data -Stream Represents a computer that has one control unit, one ALU, and one memory unit. The instructions are executed sequentially and each instruction may access one or more data item in the data stream. EX: the earlier simple computer.

CPIT SIMD organization Single Instruction, Multiple Data -Stream Represents a computer that has one control unit, multiple processing units (ALUs), and one memory unit. All processor units receive the same instruction from the control unit, but operate on different items of data EX: An array processor that simultaneously operates on an array of data.

CPIT MISD organization Multiple Instruction, Single Data -Stream Several instructions belonging to several instruction streams simultaneously operate on the same data stream. EX: Pipelining

CPIT MIMD organization Multiple Instruction, Multiple Data -Stream Several instructions belonging to several instruction streams simultaneously operate on several data streams

CPIT 201

A Simple Computer To explain the architecture of computers as well as their instruction processing, we introduce a simple (unrealistic) computer. Our simple computer has three components: CPU, memory and an input/output subsystem.

CPIT The components of a simple computer 1400

CPIT Instruction Set Our simple computer is capable of having a set of sixteen instructions, although we are using only fourteen of these instructions. Each computer instruction consists of two parts: the operation code (opcode) and the operand (s). The opcode specifies the type of operation to be performed on the operand (s). Each instruction consists of sixteen bits divided into four 4-bit fields. The leftmost field contains the opcode and the other three fields contains the operand or address of operand (s).

CPIT

CPIT 201 Format and different instruction types 80

CPIT Processing the Instruction Our simple computer, uses machine cycles. A cycle is made of three phases: fetch, decode and execute. During the fetch phase, the instruction whose address is determined by the PC is obtained from the memory and loaded into the IR. The PC is then incremented to point to the next instruction. During the decode phase, the instruction in IR is decoded and the required operands are fetched from the register or from memory. During the execute phase, the instruction is executed and the results are placed in the appropriate memory location or the register. Once the third phase is completed, the control unit starts the cycle again, but now the PC is pointing to the next instruction. The process continues until the CPU reaches a HALT instruction.

CPIT The components of a simple computer 1400

CPIT An Example Let us show how our simple computer can add two integers A and B and create the result as C. We assume that integers are in two’s complement format. Mathematically, we show this operation as: We assume that the first two integers are stored in memory locations (40) 16 and (41) 16 and the result should be stored in memory location (42) 16. To do the simple addition needs five instructions, as shown next:

CPIT In the language of our simple computer, these five instructions are encoded as :

CPIT Storing program and data We can store the five-line program in memory starting from location (00) 16 to (04) 16. We already know that the data needs to be stored in memory locations (40) 16, (41) 16, and (42) 16. Cycles Our computer uses one cycle per instruction. If we have a small program with five instructions, we need five cycles. We also know that each cycle is normally made up of three steps: fetch, decode, execute. Assume for the moment that we need to add = 415. The numbers are shown in memory in hexadecimal is, (00A1) 16, (00FE) 16, and (019F) 16.

CPIT Status of cycle 1

CPIT Status of cycle 2

CPIT Status of cycle 3

CPIT Status of cycle 4

CPIT Status of cycle 5

CPIT Another Example In the previous example we assumed that the two integers to be added were already in memory and the result of addition will be held in memory. You may ask how we can store the two integers we want to add in memory, or how we use the result when it is stored in the memory. In a real situation, we enter the first two integers into memory using an input device such as keyboard, and we display the third integer through an output device such as a monitor. Getting data via an input device is normally called a read operation. Sending data to an output device is normally called a write operation. To make our previous program more practical, we need modify it as follows:

CPIT In our computer we can simulate read and write operations using the LOAD and STORE instruction. Furthermore, LOAD and STORE read data input to the CPU and write data from the CPU. We need two instructions to read data into memory or write data out of memory. The read operation is:

CPIT The write operation is: The input operation must always read data from an input device into memory: the output operation must always write data from memory to an output device.

CPIT 201 The program is coded as: Operations 1 to 4 are for input and operations 9 and 10 are for output. When we run this program, it waits for the user to input two integers on the keyboard and press the enter key. The program then calculates the sum and displays the result on the monitor. 94