Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想实现一个布尔 NAND/NOR 门。问题是我没有输入到我在代码本身中动态学习的门,即我事先不知道它可能有多少输入。以下是 OR 的代码。但我想不出一种方法来为 NOR/NAND 做这件事。结果的初始值应该是多少?有办法吗?
result=0; //non controlling value for OR for(i = 0; i < fin; i++) { value=unodes[i]; result=(result | value); } final_value = result;
您是否尝试过先做 AND/OR(将初始值设为 1/0)然后接受它的恭维?