Im'm studying Instruction Set Architecture using the book "Logic and Computer Design Fundamentals". Studying types of architectures I came up with an example of memory-memory type which is:
ADD T1, A, B ' M[T1] <-M[A] + M[B] ADD T2, C, D ' M[T2] <- M[C] + M[D] MUL X, T1, T2 ' M[X] <- M[T1] * M[T2]
Then a it is said and I quote:
For the previous example, three instructions are required, but if an extra word must appear in the instruction for each memory address, then up to four memory reads are required to fetch each instruction. Including the fetching of operands and storing of results, the program to perform the arithmetic operation would require 21 accesses to memory.
I don't understand how they come up with 21 accesses to memory...
i know that we have at least 9 accesses (one for each operand and each result). If we have an extra word (to specify the address of each operand) then we will have 7 more
9+7=16... How do they come up with the extra 5 accesses? Can someone clarify this to me? Thanks!