卡诺图karnaugh map to circuit
1 Kmap1
module top_module(
input a,
input b,
input c,
output out );
assign out=a|b|c;
endmodule
2 Kmap2
module top_module(
input a,
input b,
input c,
input d,
output out );
assign out=((~a)&(~d))|((~b)&(~c))|((~a)&c&b)|(a&c&d);
endmodule
3 Kmap3
module top_module(
input a,
input b,
input c,
input d,
output out );
assign out=a|(c&(~b));
endmodule
4 Kmap4
module top_module(
input a,
input b,
input c,
input d,
output out );
assign out=(~(a^b)&(c^d))|(~(c^d)&(a^b));
endmodule
5 Exams/ece241 2013 q2
最大项,最小项
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=~(!c|(b&(~d))|(a&(~d)));
endmodule
6 Exams/m2014 q3
module top_module (
input [4:1] x,
output f );
assign f=(x[3]&(~x[1]))|(x[2]&x[1]&(~x[3]));
endmodule
7 Exams/2012 q1g
module top_module (
input [4:1] x,
output f
);
assign f=~(x[2]|x[4])|(x[3]&(~x[1]))|(x[2]&x[3]&x[4]);
endmodule
8 Exams/ece241 2014 q3
没看懂题目
module top_module (
input c,
input d,
output [3:0] mux_in
);
assign mux_in={c&d,~d,1'b0,(c|d)};
endmodule
题目的意思是cd是多路选择器
module top_module (
input c,
input d,
output [3:0] mux_in
);
always @(*) begin
case({c,d})
2'b00:mux_in=4'b0100;
2'b01:mux_in=4'b0001;
2'b10:mux_in=4'b0101;
2'b11:mux_in=4'b1001;
endcase
end
endmodule