% This function defines the operation of three-input multiplexer. % INPUT: % a1: the stochastic sequence of the first input for the mux; % a2: the stochastic sequence of the second input for the mux; % a3: the stochastic sequence of the third input for the mux; % a4: the stochastic sequence of the first selection input for the mux; % a5: the stochastic sequence of the second selection input for the mux; % OUTPUT: % a: the stochastic sequence of the output for the mux. % Copyright @ The authors, 2012. function a= mux3(a1,a2,a3,a4,a5) a=a1.*(1.-a4).*(1.-a5)+a2.*(1.-a4).*a5+a3.*a4.*(1.-a5);