Slide 12 of 97
Notes:
The values in the registers and are transferred from data memory using LOAD instructions. To move values from the register file back into data memory, a STORE instruction is used.
In this example, we use LDH, or Load half word, to load the 16 bit values. Somewhere in data memory, there exists a value that we want to obtain and put into register A. We refer to that value as *MemA, so we we load H, *MemA, and put that into register A, and load H, *MemX and place that in register B.
Once the values exist in the registers A and X, we multiply them together, placing the value in A times X, and we update the running sum Y by adding A times X to Y and placing the result in Y.
And finally, we use a store instruction, in this case a store half word, to store the running sum Y back into data memory.
We add a functional unit to the architecture, shown here in green, to get values to and from data memory and to and from the register file.