You're asking for a course in computer architecture. Buy a textbook. I recommend "Computer Systems" by J. Stanley Warford. We used the fourth edition in our class and I found it very enjoyable. It will cover all the way up from "How do you represent data in binary" to "how do you create an arbitrary digital logic circuit from a spec alone" to "here's a toy computer to play with".