简体   繁体   中英

Need Clarification on Memory Accessing (ISA/MIPS)

I'm doing a theoretical assignment where I design my own ISA. I'm doing a Memory-Memory design where the ALU receives inputs from memory and outputs back to memory without using any registers. This is an outdated method and registers are more effective now, but that doesn't matter for my assignment.

My question:

If the encoding of one of my instructions looks like this

opcode|destination|value1|value2|function

00 0001 0011 1100 00

the function "00" stands for addition and the opcode 00 stands for an ALU operation.

My RTN looks like this for that function:

Mem[0001] <--- Mem[0011] + Mem[1100]

0001, 0011, 1100 are memory addresses, what I'm trying the accomplish is to sum the values INSIDE those memory addresses and then store it in the memory address of 0001 (overwriting it).

So if the value in memory address 0011 was '2' and the value in memory address 1100 was '3', my instruction would store '5' in memory address 0001.

Also lets say I want to overwrite the value '3' that's in address 1100 with '4'. I can just do Mem[1100] <--- 0100(binary for 4) ?

Is what I'm implementing correct? Or am I approaching memory addressing completely wrong?

These architectures usually have one accumulator. Otherwise you'd need a dual port ram to access two operands at the same time.

You could latch one memory value, but that's just a less versatile accumulator.

Memory writes are done on a different clock/ clock flank than reads.

Memory-const operations use a different opcode than memory-memory operations of the same type.

Finally, if your const is too big for your instruction size, you need to first copy the const to a memory address, then use it on a memory-memory operation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM