component sel3 "select one of three inputs"; pin in float in0 "input value 0"; pin in float in1 "input value 1"; pin in float in2 "input value 2"; pin in bit en0 "select value 0"; pin in bit en1 "if 0 not selected select value 1"; pin in bit en2 "if 0 or 1 not selected select value 2"; pin out float out "selected output or 0 if none selected"; function _; license "GPL"; // indicates GPL v2 or later ;; FUNCTION(_){ if(en0) out = in0; else if(en1) out = in1; else if(en2) out = in2; else out = 0; }