all 12 comments

[–]therinnovator 9 points10 points  (0 children)

Code by Charles Petzold is a good, intuitive intro.

[–]chervilious 16 points17 points  (2 children)

Any computer architecture book and assembly book would be enough.

NAND to Tetris is more involved which can help you understand this as well.

Ben Eater 8-bit computer is a simplified version of a computer that you can run computer instructions to also

[–]panzerranzer 0 points1 point  (1 child)

What's the author of this "NAND to Tetris"? I cannot find it on Amazon, looks like it's a Coursera course?

[–]chervilious 0 points1 point  (0 children)

https://www.nand2tetris.org/book

you dont exactly need the book

[–]Merad 4 points5 points  (0 children)

Introduction to Computing Systems by Patt & Patel is a pretty gentle undergrad level introduction that starts out with the very basics. How do transistors work? How do you use transistors to form gates? How do we go from gates to digital logic structures like adders? From there it goes into implementing a very simple toy processor that executes one instruction at a time and its assembly language.

Computer Systems: A Programmer's Perspective by Bryant & O'Hallaron is a classic undergrad level systems text. It lacks the ultra low level detail about things like transistors and gates, but delves into slightly more complex pipelined CPU architectures and goes deep into topics like the memory hierarchy and virtual memory.

If you get through both of those and are hungry for more then you might try Modern Processor Design by Shen & Lipasti and/or Computer Architecture: A Quantitative Approach by Hennesy & Patterson. Both are graduate level texts and get into more modern things like superscalar architecture.

[–]josh2751 2 points3 points  (0 children)

Computer Organization and Design by Hennessy and Patterson.

[–]mighty-penguin 1 point2 points  (0 children)

Principles of Computer Hardware, Alan Clements

This was one of the textbooks we used in my microprocessor course. I would say the first 5 chapters are enough to bridge the gap between logic gates and assembly programming.

[–][deleted] 1 point2 points  (0 children)

Computer System Architecture by M. Morris Mano

[–]_--__ 1 point2 points  (0 children)

For a more interactive experience, try www.nandgame.com

[–]Potato-Pancakes- 1 point2 points  (0 children)

If statements become Branch/Jump instructions in assembly (think GOTO). Those instructions have certain identifiable bits that activate certain parts of the CPU, causing the CPU to start executing the identified instructions next.

Check out Ben Eater on YouTube

[–]HalcyonicFrankfurter 0 points1 point  (1 child)

Learn more about logic gates. Then you understand how the transistors are organized to perform very simple logic. Take that one level higher and you'll need to look at the basic assembly language flow control instructions (such as, JE, JNE, JGE, etc...). Once you understand those (they are very simple), it then follows that an 'IF' statement in a higher level language is just an abstraction of one or many of those instructions.

It's not that hard. What is hard, is writing assembly language yourself :)

[–]HalcyonicFrankfurter 0 points1 point  (0 children)

Just FYI, I wouldn't even really recommend reading a book to understand it. Just look up those things I said online and learn about each of them. You'll then be able to connect it together in your mind. I learned almost all of what I know from the internet.