24
Computer System Architecture CSC 203 1.5 Computer System Architecture Budditha Hettige Department of Statistics and Computer Science University of Sri Jayewardenepura 1 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Embed Size (px)

Citation preview

Page 1: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

CSC 203 1.5

Computer System Architecture

Budditha Hettige Department of Statistics and Computer Science

University of Sri Jayewardenepura

1 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 2: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Introduction

Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html 2

Page 3: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

What is Computer?

• Is a machine that can solve problems for

people by carrying out instructions given to it

• The sequence of instructions is call Program

• The language machine can understand is call

machine language

3 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 4: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

What is Machine Language?

• Machine language(ML) is a system of instructions and

data executed directly by a computer's Central Processing

Unit

• The codes are strings of 0s and 1s, or binary digits (“bits”)

• Instructions typically use some bits to represent

– Operations (addition )

– Operands or

– Location of the next instruction.

4 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 5: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Machine Language contd..

• Advantages

– Machine can directly access (Electronic circuit)

– High Speed

• Disadvantages

– Human cannot identify

– Machine depended

(Hardware depended)

5 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 6: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

More on Machines

• Machine defines a language

– Set of instructions carried out by the machine

• Language defines by the machine

– Machine executing all the program, writing in the

language

Machine Language Language Language Language

6 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 7: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Two Layer (Level) Machine

• This machine

contains only New

Language (L1) and

the Machine

language (LO)

Virtual Machine (L1)

Machine Language (L0)

Translate/ Interpreter

Machine Machine Virtual

Machine (L1)

Machine Language

(L0)

7 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 8: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Translation (L1 L0)

1. Replace each instruction written in L1 in to LO

2. Program now execute new Program

3. Program is called compiler/ translator

8 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 9: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Interpretation

• Each instruction in L1 can execute through the

relevant L0 instructions directly

• Program is call interpreter

9 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 10: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Multi Level Machine

10 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

High-level Language Program (C, C++)

Assembly Language Program

Machine Language

Page 11: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Multilevel Machine

11 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Virtual Machine Ln Virtual Machine Ln-1

. . . Machine Language L0

Page 12: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Six-Level Machine

• Computer that is designed up to the 6th level of computer

architecture

12 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 13: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Digital Logic Level

• The interesting objects at this level are gates;

• Each gate has one or more digital inputs (0 or 1)

• Each gate is built of at most a handful of

transistors

• A small number of gates can be combined to

form a 1-bit memory, which can store a 0 or 1;

• The 1-bit memories can be combined in groups

of, for example, 16, 32 or 64 to form registers

• Each register can hold a single binary number

up to some maximum;

• Gates can also be combined to form the main

computing engine itself.

13 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 14: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Microarchitecture level

• A collection of 8-32 registers that form a local

memory and a circuit called an ALU

(Arithmetic Logic Unit) that is capable of

performing simple arithmetic operations;

• The registers are connected to the ALU to form

a data path over which the data flow;

• The basic operation of the data path consists of

selecting one or two registers having the ALU

operate on them;

• On some machines the operation of the data

path is controlled by a program called a

microprogram, on other machine it is

controlled by hardware.

14 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 15: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Data Path

15 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 16: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Instruction Set Architecture Level

• The ISA level is defined by the

machine’s instruction set

• This is a set of instructions carried

out interpretively by the

microprogram or

hardware execution sets

16 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 17: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Operating System Level

• Uses different memory organization, a new set of

instructions, the ability to run one or more

programs concurrently

• Those level 3 instructions identical to level 2’s

are carried out directly by the microprogram (or

hardwired control), not by the OS;

• In other words, some of the level 3 instructions

are interpreted by the OS and some of the level 3

instructions are interpreted directly by the

microprogram;

• This level is hybrid

17 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 18: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Assembly Language Level

• This level is really a symbolic form for the one of the underlying languages;

• This level provides a method for people to write programs for levels 1, 2 and 3 in a form that is not as unpleasant as the virtual machine languages themselves;

• Programs in assembly language are first translated to level 1, 2 or 3 language and then interpreted by the appropriate virtual or actual machine;

• The program that performs the translation is called an assembler.

18 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 19: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Between Levels 3 and 4

• The lower 3 levels are not for the average programmer – Instead they are primarily for running the interpreters and translators needed to support the higher levels;

• These are written by system programmers who specialise in developing new virtual machines;

• Levels 4 and above are intended for the applications programmer

• Levels 2 and 3 are always interpreted, Levels 4 and above are usually, but not always, supported by translation;

19 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 20: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Problem-oriented Language Level

• This level usually consists of languages designed to be used by applications programmers;

• These languages are generally called higher level languages

• Some examples: Java, C, BASIC, LISP, Prolog;

• Programs written in these languages are generally translated to Level 3 or 4 by translators known as compilers, although occasionally they are interpreted instead;

20 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 21: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Multilevel Machines: Hardware

• Programs written in a computer’s true machine language (level 1) can be directly executed by the computer’s electronic circuits (level 0), without any intervening interpreters or translators.

• These electronic circuits, along with the memory and input/output devices, form the computer’s hardware.

• Hardware consists of tangible objects: – integrated circuits

– printed circuit boards

– Cables

– power supplies

– Memories

– Printers

• Hardware is not abstract ideas, algorithms, or instructions.

21 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 22: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Multi level machine Software

• Software consists of algorithms (detailed instructions telling how to do something) and their computer representations-namely, programs

• Programs can be stored on hard disk, floppy disk, CD-ROM, or other media but the essence of software is the set of instructions that makes up the programs, not the physical media on which they are recorded.

• In the very first computers, the boundary between hardware and software was crystal clear.

• Over time, however, it has blurred considerably, primarily due to the addition, removal, and merging of levels as computers have evolved.

• Hardware and software are logically equivalent

22 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 23: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

The Hardware/Software Boundary

• Any operation performed by software can also be built directly into the hardware;

• Also, any instruction executed by the hardware can also be simulated in software;

• The decision to put certain functions in hardware and others in software is based on such factors as:

– Cost

– Speed

– Reliability and

– Frequency of expected changes

23 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html

Page 24: CSC 203 1.5 Computer System Architecture · PDF file• Each register can hold a single binary number ... microprogram, on other machine it ... •This level is really a symbolic form

Computer System Architecture

Exercises

1. Explain each of the following terms in your own words

– Machine Language

– Instruction

2. What are the differences between Interpretation and translation?

3. What are Multilevel Machines?

4. What are the differences between two-level machine and the six-level machine

24 Budditha Hettige http://www.dscs.sjp.ac.lk/~budditha/index.html