Generate a truth table in excel?

I have the need to make a formula that gives you the truth table for a variable number of columns Examples ...