Sie sind auf Seite 1von 31

CS 3530 Operating Systems

Computer Architecture Review

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Consists of Six Components: CPU: The Central Processing Unit.


The processor chip that can interpret and execute the instructions in a computer program (software).

Computing System

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Main Memory: This is working storage for programs and information, which is used while the compute is turned on and running. Main memory is generally not permanent or fixed storage, its contents are wiped clean when the machine is power-down.

Computing System

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Secondary Storage: This term covers a variety of types of devices to store and retrieve data, information, and software programs. Devices range in speed, amount of storage, and cost. These can include harddrives, floppy drives, ram-drives, CDs, etc.

Computing System

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

I/O Devices: This is a category of devices used to provide input to the machine, or display output for the user or to communicate with other computers. Devices in this category include: monitor, keyboard, mouse, network card, modem, camera, printers, scanners, etc.

Computing System

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Bus: an electrical highway that is used to connect the components. The bus is multiple wires, so that many bits can be communicated between devices at the same time. It is typical for a computer system to have two or more buses.

6th Component: Operating System

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

The operating system includes low level software for controlling the hardware devices, as well as software for managing programs and the resources in the computer system. User interface typically a Graphical User Interface (GUI) though other types of interfaces are possible. Programming interface: a way for programmers to utilized portions of the operating system routines in developing software. Most of the operating system is software, which resides in secondary storage and is loaded into the computers memory when the computer boots-up. Usually, small portion of system code is stored in hardware in a chip, and may be called a Basic InputOutput System (BIOS), which contains instructions for loading and starting the operating system.

The Central Processing Unit (CPU) CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

contains the logic used to execute or process instructions a single chip that is the master of all the other devices in the system and any secondary processors. The CPU chip itself is quite small, the size of a fingernail or smaller. It is enveloped in a plastic or ceramic package The ceramic enclosure protects the fragile CPU, connects input and output wires to pins on the chip for easy connection to the rest of the computer system and is involved in transferring waste heat away from the chip. Depending on how fast the CPU operates, many chips can generate sufficient heat to cause internal failures unless the excess heat is dealt-with in some way.

Numbers

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Inside the CPU everything is stored as numbers Represented inside the computer with binary digits. The binary number system has only two digits: zero and one. This two-digit system turns out to be convenient to build and manufacture using modern digital electronics technologies. A binary representation of the number eighteen for instance, looks like this in binary: 10010

Computer

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

All information that we manipulate must be translated at some point by the computer and computer software, into simple binary representations. The CPU operates on values represented as binary digits, and in fact, has no knowledge about the meaning of the binary numbers or what they represent in our world. It simple-mindedly manipulates the data represented by binary numbers as it is told to do so by its programs, which are also translated or converted into binary representations before the computer can work with them. The computer itself has no intelligence of its own, and all of its abilities are simply the result of capturing the intelligence and logic of its makers (both hardware designers and software programmers).

CPU Components

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

1. Registers: a set of temporary storage locations

add two numbers together, each number would first be loaded from memory into a register, prior to adding process. Result goes in a register

CPU Components

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

1. Registers: a set of temporary storage locations

add two numbers together, each number would first be loaded from memory into a register, prior to adding process. Result goes in a register

CPU Components

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

2. Arithmetic Logic Unit (ALU):

this is the logic that can do operations with binary numbers. math functions like addition, subtraction, multiplication and division, the ALU can also manipulate numbers in other ways and compare numbers together for equality and inequalities (greater than, less than).

CPU Components

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

3. Control Unit: logic that is written into the hardware chip that determines the sequence of events
Things like: how to decode an instruction how to move data from one register to the ALU where to put results from the ALU which instruction should be processed next

Assembly Language

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

The following is an instruction that adds the contents of two registers together. ADR R1 R2

This representation is an example of what an assembly language instruction looks like. Assembly language is a low level programming language we prefer easier to use languages.

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

The assembly language code can be directly translated (by an assembler program) into machine code which the computer can process: ADR R1 R2 00 010000 0001 0010

The computer can process the machine code hard for humans to work with Hence, the creation of assembly language and other higher level programming languages.

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Instruction Format: machine code and assembly language is organized in an instruction format Operation to be performed (OpCode or Op) Operands that the instruction will operate on (R1 and R2 are registers).

Fetch Decode Execute Cycle

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

CPU repeats the cycle for each instruction


1. 2. 3. 4. 5. Fetch the Instruction Decode the instruction (opcode and operands) Fetch and needed operands Execute the instruction Check for Interrupt

Processing Cycle CPU

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Main Mem

I/O Devices

Network

Bus
Fetch Instruction

Instruction Decode

Operand Fetch

Instruction Execution

Interrupt Check

Simple Computer Program

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

LOAD R1 Num1 LOAD R2 Num2 ADD R1 R2

STOR R1 Result

Initial State of Computer


Register 1 empty Register 2 empty Number 1 = 4 Number 2 = 5 Result empty
CPU Register Contents R1 R2

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Memory Location Num1 Num2 Result Contents 4 5

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

After executing the first instruction:


LOAD R1 Num1

First Instruction

CPU Register Contents R1 R2 4

Memory Location Num1 Num2 Result Contents 4 5

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

After executing the second instruction:


LOAD R2 Num2

Second Instruction

CPU Register Contents R1 R2 4 5

Memory Location Num1 Num2 Result Contents 4 5

After executing the third instruction:


ADD R1 R2

Third Instruction

Note that the sum overwrites the temporary storage in R1.


CPU Register Contents R1 R2 9 5 Memory Location Num1 Num2 Result Contents 4 5

After executing the fourth instruction:


STOR R1 Result

Fourth Instruction

CPU Register Contents R1 R2 9 5

Memory Location Num1 Num2 Result Contents 4 5 9

High Level Language

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

LOAD R1 Num1 LOAD R2 Num2 ADD R1 R2 STOR R1 Result Can be accomplished in a high-level language with a single instruction or programming statement: Result = Num1 + Num2

Computer Architecture Layers

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

1.Transistors and Gates: constructing small devices called Logic Gates from transistors. 2. Simple Devices: building simple devices from gates 3. System Devices: building more complex devices 4. Computer System Architecture: building a system 5. Instruction Set: specifying the CPU internal architecture and capabilities with the instruction set. The instruction set specifies the programmers interface to the hardware, both machine code and assembly language. 6. Operating Systems 7. Distributed, N-Tier, Client/Server and Parallel systems

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Computer System Layers

Distributed, N-Tier, Client/Server, Parallel and Grid systems. Operating System: Manages resources and provides user and program interface. Instruction Set: Internal design of the CPU and the machine code. Computer System Architecture: building a computer from system level devices System Devices: more complex system-level devices from simple devices and gates. Simple Devices: building simple, elemental devices using gates as the construction components. Transistors and Gates: constructing small devices called Logic Gates from transistors.

Operating Systems

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

Manage the system resources: CPU Memory Disk Space Internet Access A user interface: GUI Graphical User Interface Programming Interface Networking Interface

End of Lecture

CS 3530 Operating Systems. Dr. Ken Hoganson, Copyright 2008

End Of Todays Lecture.

Thisslideintentionallyleftblank