`timescale 1ns/1ns module data_sel( input S0 , input S1 , input D0 , input D1 , input D2 , input D3 , output wire Y ); assign Y = ~S1 & (~S0&D0 | S0&D1) | S1&(~S0&D2 | S0&D3); endmodule module sel_exp( input A , input B , input C , output wire L ); data_sel u_1 (A,B,0,~C,C,1,L); endmodule
对多项式进行化简,是得每一项都包含AB,将AB作为S0,S1.
L=AB+A(~C)+BC
=AB+A(B+~B)(~C)+(A+(~A))BC
=AB +AB(~C)+A(~B)(~C)+ABC+(~A)BC
=AB(~C)+A(~B)(~C)+ABC+(~A)BC
=AB+A(~B)(~C)+(~A)BC
S0=A,S1=B得
=D3+D1(~C)+D2C
所以D0输入为0,D3输入为1,D1、D2分别为~C和C。