Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between memory address register(MAR) and program counter(PC)?

How memory address register(MAR) and program counter(PC) are different from each other?

like image 1000
Imran Avatar asked Jun 04 '12 04:06

Imran


2 Answers

Program counter (PC) stores the address of next instruction to be fetched from memory after the execution of current instruction.

This address from PC is loaded into the address register (AR): AR<--PC

The instruction from memory location given by address register (AR) is loaded into the instruction register (IR): IR<--M[AR]

The program counter is incremented to the address of next instruction: PC<--PC+1

like image 95
Mohit arora Avatar answered Sep 21 '22 17:09

Mohit arora


PC: program counter(PC) holds the address of the next instruction ,which is to be executed or decoded.

IR: instruction register(IR) holds the instruction which is currently being executed or decoded.

MAR: memory address register (MAR) holds the address of the location in memory, which contains data, that is required by the current instruction being executed. simply MAR points to the memory location that contains data required.

like image 42
valarica Avatar answered Sep 22 '22 17:09

valarica