Does the instruction register have to send its memory address to MAR before accessing memory?

0

I am studying computer systems and operating systems and I have been confused about when a memory address would be transferred to the memory address register (MAR). When the instruction register (IR) receives the opcode instruction and memory address it is to perform an operation on, does it have to send this information to the MAR before the memory location the IR points to can be accessed? Or does the IR have enough information to point to the memory location directly? Why would you need the MAR at all?

Darien Springer

Posted 2019-10-13T23:39:59.730

Reputation: 437

1Although this is about computer hardware, it is probably not the expertise of this site. – Daniel – 2019-10-13T23:51:08.123

Which site would you recommend? – Darien Springer – 2019-10-13T23:52:12.917

And why wouldn't be the expertise of this site? I asked a question about computer architecture that received a lot of upvotes. – Darien Springer – 2019-10-13T23:53:19.030

In my humble opinion, superuser is more about the user rather than the engineering decisions. Keep in mind I'm not saying it's off topic. – Daniel – 2019-10-13T23:58:02.400

1

See this question

– Daniel – 2019-10-13T23:59:38.567

Ah. I see. Thanks for letting me know. I will keep that in mind going forward. – Darien Springer – 2019-10-14T01:32:02.913

Answers

0

... does it have to send this information to the MAR before the memory location the IR points to can be accessed?

Yes. That is how the memory subsystem works.

Or does the IR have enough information to point to the memory location directly?

You cannot bypass the MAR.
Depending on the particular instruction and CPU architecture, an instruction is not likely to even contain a complete memory address.
The instruction may contain just a relative offset (or an index), so a calculation with a base address (i.e. the contents of another register such as the PC) will be required.
The instruction operand may specify the contents of another register as the memory address.

Why would you need the MAR at all?

It's a latch to hold the value from the address bus.
The value on the address bus cannot be guaranteed to be stable for the duration of the memory access in order to drive the to row and column lines of the memory device.
Hence the need to "capture" the value from the address bus.

Be aware that the IR is not the only register in the CPU that needs to access main memory. The PC, program counter, specifies the the memory location of the next instruction.

Be aware that the CPU is not the only component in the computer that can access main memory. A memory arbitration unit may grant other devices such as a DMA controller or a bus-master access to main memory.

So a simplistic IR to memory connection as you envision would have very limited capabilities.

sawdust

Posted 2019-10-13T23:39:59.730

Reputation: 14 697