Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly MIPS汇编中的nand位操作_Assembly_Logic_Bit Manipulation_Mips_Operation - Fatal编程技术网

Assembly MIPS汇编中的nand位操作

Assembly MIPS汇编中的nand位操作,assembly,logic,bit-manipulation,mips,operation,Assembly,Logic,Bit Manipulation,Mips,Operation,我一直在试图找出如何在汇编中执行nand逐位操作,但没有成功。我试图编写一个逻辑门模拟器,它将为输入a和B生成这个真值表 A | B || F ----------------- lo | lo || hi lo | hi || hi hi | lo || hi hi | hi || lo A | B | F ----------------- 你好 你好 嗨|瞧| |嗨 嗨|嗨| |洛 我什么都试过了 and $t3,$t1,$t

我一直在试图找出如何在汇编中执行nand逐位操作,但没有成功。我试图编写一个逻辑门模拟器,它将为输入a和B生成这个真值表

A | B || F ----------------- lo | lo || hi lo | hi || hi hi | lo || hi hi | hi || lo A | B | F ----------------- 你好 你好 嗨|瞧| |嗨 嗨|嗨| |洛 我什么都试过了

and $t3,$t1,$t not $t4,$t3 和$t3、$t1、$t 不是t4美元,而是t3美元
无法生成正确的输出

当然,请查看真值表:

A    B    And   Nand
---------------------
lo   lo   lo    hi
lo   hi   lo    hi
hi   lo   lo    hi
hi   hi   hi    lo
如您所见,可以通过对先前的AND值求反来获得nand值。但是您可能忘记了
以及
对寄存器的每一位进行操作。我认为你把布尔值搞混了,在布尔值中(通常)任何非零值都被认为是真的。所以,

   11101001 nand 01000111 = 
 = ~ (11101001 and 01000111) =
 = ~ 01000001 = 
 = 10111110
因为

1 and 0 = 0
1 and 1 = 1
1 and 0 = 0
0 and 0 = 0
1 and 0 = 0
0 and 1 = 0
0 and 1 = 0
1 and 1 = 1

下次你也应该发布预期结果和实际结果,这样我们更容易理解出了什么问题。

我是MIPS的新手,请原谅。所以我想我应该只关注寄存器中值的最小重要位。我不知道怎么做