Can you explain in terms of logic gates how Babbage’s Analytical Engine worked?
The documentation is quite clear they're still working out what the design was supposed to be. 

Taking an approximation - they have developed a Java program to run sample programs. The logic behind the source code shows how it may have worked.