The 74151 will select one, and only one, of its D0, ... , D7 data inputs for presentation at the Y output on pin 5, based on the input-select bits A,B,C. This can be used to implement Boolean logic by connecting appropriate D0, ... , D7 inputs to either logic "1" (Vcc) or logic "0" (GND) levels...