In this class, we use the instruction of MIPS. In MIPS, there are Design Principles that can be more efficiently.
MIPS use 32 x 32 bits General Purpose Registers. It means that there are 32 registers and each of them has 32 bits. Also, there is HI Register and LO Register. They are used to multiplication because, if some expression is multipy 32 bits, it will be more than 32 bits. For that reason, MIPS use two types HI and LO. By using them, it can calculate any arithmatic expressions.
This is the convention of MIPS architecture. There are many sections and each of them perform other functions.
Memory is just a large one dimension array with index. So, all of memory address indicates bytes. However, in some cases, memory is accessed in words size(4 bytes).
Most of arithmatic / logic instruction have 3 operands and its order is fixed.
In the computer architecture, all of instructions are restricted to special locations built in hardware called Register. In MIPS, it provides only 32 registers available to programmers. Then, we can ask why only 32 registers? The answer is our underlying design priciples of hardware technology. If there is large number of registers, it can perform many functions. However, if number of register increase, it will take more time than small number of register. For that reason, MIPS just use 32 registers.
This section means that there are a lot of common case and computer must calculate more short time. For example, if we want to perform "A = A + 1", then what is the good choice?
First is not valid in principle number 2 and second is not make sense because we can use only 32 registers.
The answer is that make constants part of arithmetic insturctions. It is more faster than load memory and more efficiently.
Assembly code should be represented in a binary code.
This is a structure of machine language.
In R-type format, it usally used calculation of register-register. For example, add, sub, or and slt.
In this way, there are problems that instructions need longer fields for constant value. If some instruction want to deal integer of 1,000,000,000, this architecture can't support it.
Thus, MIPS use another format that is I-type. In addition, in high-level programming language, we must do jump other section. So as to do that, MIPS use J-type format.
It is not valid in principle 1, but it is principle 4