the fetch-execute cycle

25
THE FETCH-EXECUTE CYCLE

Upload: claudio-crowe

Post on 30-Dec-2015

71 views

Category:

Documents


5 download

DESCRIPTION

THE FETCH-EXECUTE CYCLE. REGISTERS. ACC. Check for interrupts. Fetch instruction from memory. MDR. MAR. 1. CIR. Execute instruction. Update Program counter. PC. 1. MEMORY Location Contents. THE PROGRAM. The address of the first instruction is copied from the PC to the MAR. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: THE  FETCH-EXECUTE  CYCLE

THE

FETCH-EXECUTE

CYCLE

Page 2: THE  FETCH-EXECUTE  CYCLE

1

1

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The address of the first

instruction is copied from the PC to the MAR

Page 3: THE  FETCH-EXECUTE  CYCLE

LDA 23

1

1

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The first instruction is read into the

MDR

Page 4: THE  FETCH-EXECUTE  CYCLE

LDA 23

LDA 23

1

1

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The first instruction is

copied into the CIR

Page 5: THE  FETCH-EXECUTE  CYCLE

LDA 23

LDA 23

1

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The program counter is

updated to point to the next instruction

Page 6: THE  FETCH-EXECUTE  CYCLE

LDA 23

LDA 23

23

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The address part of the current instruction is placed in the

MAR

Page 7: THE  FETCH-EXECUTE  CYCLE

14

LDA 23

23

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The contents of the location

whose address is in the MAR are loaded into the

MDR

Page 8: THE  FETCH-EXECUTE  CYCLE

14

14

LDA 23

23

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The contents of the MDR are

copied into the ACC

Page 9: THE  FETCH-EXECUTE  CYCLE

14

14

LDA 23

23

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The Status Register is checked for interrupts

Page 10: THE  FETCH-EXECUTE  CYCLE

14

14

LDA 23

2

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The address of the second

instruction is copied from the PC to the MAR

Page 11: THE  FETCH-EXECUTE  CYCLE

14

ADD 72

LDA 23

2

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The second instruction is read into the

MDR

Page 12: THE  FETCH-EXECUTE  CYCLE

14

ADD 72

ADD 72

2

2

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The second instruction is

copied into the CIR

Page 13: THE  FETCH-EXECUTE  CYCLE

14

ADD 72

ADD 72

2

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The program counter is

updated to point to the next instruction

Page 14: THE  FETCH-EXECUTE  CYCLE

14

ADD 72

ADD 72

72

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The address part of the current instruction is placed in the

MAR

Page 15: THE  FETCH-EXECUTE  CYCLE

14

35

ADD 72

72

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The contents of the location

whose address is in the MAR are loaded into the

MDR

Page 16: THE  FETCH-EXECUTE  CYCLE

49

35

ADD 72

72

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The contents of the MDR are added to the

ACC

Page 17: THE  FETCH-EXECUTE  CYCLE

49

35

ADD 72

72

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The Status Register is checked for interrupts

Page 18: THE  FETCH-EXECUTE  CYCLE

49

35

ADD 72

3

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The address of the third

instruction is copied from the PC to the MAR

Page 19: THE  FETCH-EXECUTE  CYCLE

49

STA 53

ADD 72

3

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The third instruction is read into the

MDR

Page 20: THE  FETCH-EXECUTE  CYCLE

49

STA 53

STA 53

3

3

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The third instruction is

copied into the CIR

Page 21: THE  FETCH-EXECUTE  CYCLE

49

STA 53

STA 53

3

4

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The program counter is

updated to point to the next instruction

Page 22: THE  FETCH-EXECUTE  CYCLE

49

STA 53

STA 53

53

4

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The address part of the current instruction is placed in the

MAR

Page 23: THE  FETCH-EXECUTE  CYCLE

49

49

STA 53

53

4

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 26

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The contents of the ACC are

copied into the MDR

Page 24: THE  FETCH-EXECUTE  CYCLE

49

49

STA 53

53

4

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 49

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The contents of the MDR are

copied into the memory location whose address is in the MAR

Page 25: THE  FETCH-EXECUTE  CYCLE

49

49

STA 53

53

4

REGISTERS

ACC

MDR

MAR

CIR

PC

1 LDA 23

2 ADD 72

3 STA 53

THE PROGRAM

23 14

53 49

72 35

MEMORY

Location Contents

Fetch instruction from memory

Update Program counter

Execute instruction

Check for interrupts

The Status Register is checked for interrupts