14

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

2
  • what processor/microcontroller are you referring to?
    – old_timer
    Jun 4, 2012 at 5:50
  • I think it is w.r.t. Intel 8085.
    – dheerendra
    Apr 20, 2021 at 2:47

8 Answers 8

12

The difference is that the program counter points to the next instruction to be fetched / executed , whereas the memory address register points to a memory location where the program being run will fetch some data (not an instruction).

11

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.

1
7

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

2

The Memory Address Register (MAR) holds the address location where data will be fetched from to bring into the register component of a CPU.

the Program Counter (PC) is holds the location of the NEXT instruction (everything stored in memory has an address). hope this helped

1

Program Counter (PC) is the address of the current instruction being executed by a CPU. Memory Address Register (MAR) could contain address of data being accessed by a load or store instruction.

1
  • 2
    PC points immediately to the next instruction to be fetched so, saying it holds the address of current instruction being executed by a CPU is wrong.
    – 0decimal0
    Sep 24, 2014 at 5:31
1

The program counter uses logical address (virtual addresses generated by the program), where as the address register uses physical addresses (actual real memory address). This is the main difference.

1

program counter The program counter holds the address of the next instruction that is to be fetched-decoded-executed. This will increment automatically as the current instruction is being decoded

The Memory Address Register (MAR) holds the address of the current instruction being executed. It points to the relevant location in memory where the required instruction is (at this stage the address is simply copied from the Program Counter).

0

I read about it in a book

The PC only holds the address of the instruction

PC adds a number immediately after passing the instruction address to MAR

MAR holds the address of the instruction during the addressing cycle

The address to hold the data during subsequent fetch cycles

These are part of the difference(maybe have some other difference)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.