Logic, gates, and such