对于下面的Karnaugh图,根据需要使用一个4对1多路复用器和尽可能多的2对1多路复用器给出电路实现,但使用尽可能少。不允许使用任何其他逻辑门,必须使用 a 和 b 作为多路复用器选择器输入,如下面的 4 对 1 多路复用器所示。
您只实现了标记为top_module的部分,使得整个电路(包括 4 对 1 多路复用器)实现了 K-map。
For the following Karnaugh map, give the circuit implementation using one 4-to-1 multiplexer and as many 2-to-1 multiplexers as required, but using as few as possible. You are not allowed to use any other logic gate and you must use a and b as the multiplexer selector inputs, as shown on the 4-to-1 multiplexer below.
You are implementing just the portion labelled top_module, such that the entire circuit (including the 4-to-1 mux) implements the K-map.
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;
default:mux_in <= 4'b0000;
endcase
end
endmodule