看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《doggingg (doggingg)》之銘言: : Use AND,OR,NOT to design a two-bit binary adder/subtractor. : Give the examples to show that your answer worked correctly. [X=0 作加法, X=1則作減法, X要當carry_in] A - B = A + (-B) = A + (~B + 1) 所以X當carry_in A B Sum Carry_out a1a0b1b0 X=0 X=1 X=0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 0 1 0 1 1 0 0 0 1 0 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 0 0 0 1 1 0 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 0 0 0 1 不知道有沒有手殘 orz Sum0 = a0 xor (b0 xor X) xor X Sum1 = a1 xor (b1 xor X) xor carry_in (即從bit0來的carry_out) Cout = (a1 and b1) or (carry_in and [a1 xor b1]) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.43.195.103 ※ 編輯: BenLinus 來自: 114.43.195.103 (02/11 14:41)
doggingg:謝謝大大 我懂囉 02/11 16:58
doggingg:在請問一下,它的布林函式長怎樣?Cin跟Cout還有Sum 02/11 17:06
※ 編輯: BenLinus 來自: 114.43.195.103 (02/11 17:16)
BenLinus:用打的反而有點亂orz 02/11 17:17
doggingg:謝謝大大熱心回答 02/11 17:23