简体   繁体   中英

Why is the ALU Opcode for lw and sw 00?

I'm trying to wrap my head around data paths and how it works in MIPS programming. A part of understating it, is understanding the ALU Opcodes that essentially tell the ALU which operations to carry out. For example, if we implement the basic AND, OR, ADD, SUB, NAND and NOR functions, we get a basic ALU Opcode distribution, ie AND is 00 , OR is 01 , ADD is 10 , SUB is 10 , NAND is 10 and NOR is 01 . But I'm not sure I understand why the ALU Opcode for sw and lw are 00 ?

在此处输入图片说明

On MIPS, there is only one addressing mode: base + displacement .

In load and store instructions, the ALU performs this address computation, which is done using addition. Thus, the ALU performs the addition in: register + sign-extended immediate, which forms the address sent to the data memory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM