4x4x4 led cube problem

I thought it took 3 variables to light a single led, x,y,z, going into an AND gate. You only have x and y, so you can't isolate the led that you want at z. I'm not sure how to actually code it, other than IF statements arranged as AND gates. If x=1, and y=1 and z=1, the bottom corner should only be lit, and so on.