Code: The Hidden Language of Computer Hardware and Software, by Charles Petzold, is a well-written and wonderfully detailed introduction to how computers work. It starts with a gentle introduction to binary encodings via Morse code and the telegraph, and then proceeds to build a computer from the ground up from relays to logic gates to circuits to memory to a real CPU. The book does not require any prerequisite knowledge and is fully self-contained, although it becomes increasingly complex at the end as each chapter needs the reader to fully understanding the material that came before it. To anyone interested in computers, the first chapters will be an accessible and enlightening read for some , and I highly recommend it.
On my first read of the book, was 16 (19 in the second edition). I already knew how logic gates could be networked to compute an arbitrary Boolean function, but didn’t see how that could be extended to a fully programmable computer. As Code explains, the key step is to design a feedback circuit that admits multiple stable states. Such a circuit can be used to build a memory array to store data — including “instructions” that can be read conditionally execute other circuits.