A single-output digital system with four inputs (a,b,c,d) generates a logic-1 when 2, 7, or 15 appears on the inputs, and a logic-0 when 0, 1, 4, 5, 6, 9, 10, 13, or 14 appears. The input conditions for the numbers 3, 8, 11, and 12 never occur in this system. For example, 7 corresponds to a,b,c,d being set to 0,1,1,1, respectively.
Determine the output out_sop in minimum SOP form, and the output out_pos in minimum POS form.
一個4輸入a, b, c, d和一輸出的邏輯電路,當輸入為2, 7或15時,輸出為1, 當輸入為0, 1, 4, 5, 6, 9, 10, 13, 或 14 時,輸出為0,當輸入為3,8,11或12時輸出為任意值。舉例來說,7對應輸入abcd為0,1,1,1.
sop:sum of product 積之和 即化成最小項的形式(最小項之和)
最小項之和是跟真值表相對應的。
pos:product of sum 和之積 即化成最大項的形式 (最大項之積)
如果最小項之和是(m1,m2,m3,m5,m7)
那麼就可以直接得出最大項之積就是(M0,M4,M6),是取反的。
記得最大項M0對應A+B,M3對應~A + ~B,跟最小項的是反過來的
根據題目畫出卡諾圖:
根據卡諾圖可以寫出:
module top_module (
input a,
input b,
input c,
input d,
output out_sop,
output out_pos
);
assign out_sop = (c & d) | (~a & ~b & c);
assign out_pos = (~a & ~b & c) | (b & c & d) | (a & c & d);
endmodule
注意看下面的圖,卡諾圖直接寫最大項之積的形式,正負是根據圖中反着來的: