27
[CSE10100] Introduction to Computer Engineering (컴퓨터공학 개론) Chapter 6 Seungkyu Lee Assistant Professor, Dept. of Computer Engineering Kyung Hee University

Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

[CSE10100] Introduction to Computer

Engineering (컴퓨터공학 개론)

Chapter 6

Seungkyu Lee

Assistant Professor, Dept. of Computer Engineering

Kyung Hee University

Page 2: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

2

The von Neumann architecture !!!!

Page 3: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

3

Control Unit

Control unit

The organizing force in the computer

- Instruction register (IR)

Contains the instruction that is being executed

- Program counter (PC)

Contains the address of the next instruction to

be executed

Central Processing Unit (CPU)

ALU and the control unit called the Central Processing Unit, or CPU

Page 4: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

4

The Fetch-Execute Cycle

Page 5: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

5

Computer Operations

Computer

A programmable electronic device that can store, retrieve, and process data

Data and instructions to manipulate the data are logically the same and can be stored in the same place

What operations can a computer execute?

Page 6: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

6

Machine Language

Machine language

The language made up of binary coded instructions built into the hardware of a particular computer and used directly by the computer

Why would anyone choose to use machine language?

(Hint: they had no choice. Why?)

Page 7: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

7

Pep/8 Virtual Computer Virtual computer

A hypothetical machine designed to contain the important features of a real computer that we want to illustrate

Pep/8

A virtual computer designed by Stanley Warford that has 39 machine-language instructions

Page 8: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

8

Features in Pep/8 Pep/8 Registers/Status Bits Covered

– The program counter (PC) (contains the address of the next instruction to be executed)

– The instruction register (IR) (contains a copy of the instruction being executed)

– The accumulator (A register)

The memory unit is made up of 65,636 bytes of storage

Page 9: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

9

Architecture of Pep/8

Page 10: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

Instruction Format

10

Page 11: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

11

Instruction Format Operation code

Specifies which instruction is to be carried out

Register specifier

Specifies which register is to be used (only use A in this chapter)

Addressing-mode specifier

Says how to interpret the operand part of the instruction

Page 12: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

Instruction Format

Figure 6.3 Difference between immediate addressing mode and direct addressing mode

12

Page 13: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

13

Some Sample Instructions

Figure 6.4 Subset of Pep/8 instructions

Page 14: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

14

Sample Instructions

Operand Register

Page 15: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

15

Sample Instructions

Operand Register

Page 16: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

16

Sample Instructions

What do these instructions mean?

Page 17: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

17

Sample Instructions

What do these instructions mean?

Page 18: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

18

Sample Instructions

What do these instructions mean?

Page 19: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

Written Algorithm of Hello

19

In decimal?

Page 20: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

20

ASCII Character Set Mapping

Page 21: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

21

Hand Simulation 1

Page 22: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

22

Hand Simulation 1

Fetch!!!

Decode!!!

Page 23: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

23

Hand Simulation 1

Execute!!!

Page 24: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

24

Hand Simulation 2 Operand Register

Page 25: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

25

Hand Simulation 2

Fetch!!!

Decode!!! Operand Register

Page 26: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

26

Hand Simulation 2 Operand Register

Page 27: Seungkyu Lee - khu.ac.krcvlab.khu.ac.kr/CELecture8.pdf · 2014-03-31 · The Fetch-Execute Cycle . 5 Computer Operations Computer A programmable electronic device that can store,

27

Hand Simulation 2 Operand Register

Execute!!!