1

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?

Kxa
  • 35
  • 1
  • 7
  • just because you dont have registers, or even if you do, there is no reason to use those for the actual computation of a result. use combinational logic and then latch the result in the destination at the end of the cycle, or have flip flops that hold the values if you need multiple clocks. – old_timer Mar 26 '16 at 23:13
  • @dwelch Can you please clarify? Are you talking about doing a computation then putting that in memory without using memory for the actual computation? What if I want to add values in memory when I don't know what those values are, but only know their addresses where they are stored? – Kxa Mar 26 '16 at 23:17

1 Answers1

1

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.

xvan
  • 4,554
  • 1
  • 22
  • 37
  • This is very basic, so const values are fixed to whatever my design can handle. I'm looking at page 4 here http://www.ece.eng.wayne.edu/~czxu/ece7660_f05/ISA-2.pdf Which shows that an accumulator ISA is something different. – Kxa Mar 26 '16 at 23:35
  • Just assign a different opcode to 'write constant'. memcopy op is just an alias to add const `0`. Your approach is ok, as long as efficiency is not a requirement it can be trivially implemented as a state machinne. – xvan Mar 26 '16 at 23:44
  • oh yeah i forgot to add that. My opcode is different for the write and has a different instruction format. And yes, efficiency isn't an issue, just creativity and making something different than the MIPS register/memory ISA. – Kxa Mar 26 '16 at 23:48