简体   繁体   English

为什么 lw 和 sw 的 ALU 操作码是 00?

[英]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.我正在尝试围绕数据路径以及它在 MIPS 编程中的工作原理。 A part of understating it, is understanding the ALU Opcodes that essentially tell the ALU which operations to carry out.低估它的一部分是理解 ALU 操作码,它本质上告诉 ALU 执行哪些操作。 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 .例如,如果我们实现基本的AND, OR, ADD, SUB, NANDNOR函数,我们得到一个基本的 ALU 操作码分布,即AND00OR01ADD10SUB10NAND10NOR01 But I'm not sure I understand why the ALU Opcode for sw and lw are 00 ?但我不确定我是否理解为什么swlw的 ALU 操作码是00

在此处输入图片说明

On MIPS, there is only one addressing mode: base + displacement .在 MIPS 上,只有一种寻址模式: 基址 + 位移

In load and store instructions, the ALU performs this address computation, which is done using addition.在加载和存储指令中,ALU 执行地址计算,这是使用加法完成的。 Thus, the ALU performs the addition in: register + sign-extended immediate, which forms the address sent to the data memory.因此,ALU 执行以下加法:寄存器 + 符号扩展立即数,形成发送到数据存储器的地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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