woai3c / nand2tetris

计算机系统要素-从零开始构建现代计算机
MIT License
2.65k stars 441 forks source link

为什么可以用取反区分A指令和B指令 #21

Closed 7HangZ closed 1 year ago

7HangZ commented 1 year ago

// 指令的最大地址位 如果为1则是C指令 为0则是A指令 Not(in = instruction[15], out = isA); // 对isA再次取反 判断是否C指令 读者可以自行用1或0代入想像一下 isC实际上就是instruction[15]的值 Not(in = isA, out = isC);

大神这个有点看不懂啊 假设这个最大地址位为0,第一次取反out不就是1了吗。为什么是isA

woai3c commented 1 year ago

如果是最大地址位为 1,取反就是 0 了。isA 说明它是个变量,还不确定值。

7HangZ commented 1 year ago

谢谢!

woai3c commented 1 year ago

谢谢!

不客气 加油