Computer Architecture (3)

김동규·2023년 10월 3일
0

Computer Architecture

목록 보기
3/16

In this class, we use the instruction of MIPS. In MIPS, there are Design Principles that can be more efficiently.

Goals of instruction set design for MIPS

  • To maximize performance
  • To minimize cost
  • To reduce design time

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 Structure

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).

Priciles of MIPS Design

  • Simplicity favors regularity.
  • Smaller is faster. (Don't have large scale)
  • Make common case fast.
  • Good design demands a compromise.

Simplicity favors regularity

Most of arithmatic / logic instruction have 3 operands and its order is fixed.

Smaller is faster

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.

Make common case fast

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?

  • Put typical values in memory and load them from memory.
  • Create hard-wired register for specific constant value like R0.

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.

Good design demands a compromise

Assembly code should be represented in a binary code.

This is a structure of machine language.

  • R-type format
  • I-type format
  • J-type format

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

profile
안녕하세요 :)

0개의 댓글