6 ms·
Tangentially related question: how does one learn "computer architecture" or "computer engineering" as a hobbyist? I'm actually not even sure what those terms r
by k_sze 7y ago
Tangentially related question: how does one learn "computer architecture" or "computer engineering" as a hobbyist? I'm actually not even sure what those terms really mean.
I'm amazed that people can build homebrew computers using Z80, MOS 6502/6510, or Motorola 68k series microprocessors.
I could buy one of those homebrew Z80 kits and assemble it, but I don't think I'll gain much real understanding just from the act of assembling the kit.
I have long wondered how things work down to the bare-metal level. What does it take to be able to design (and program?) a homebrew computer? Let's say I leave out the FPGA route and only focus on using real, off-the-shelf ICs.
I'm mostly just a software guy (I write Python, I've learned automata theory at University) but I haven't learned any real electronics beyond things like Ohm's law, KCL, KVL, capacitance, impedance as a complex number. I don't even know my transistors or diodes.
- the_pwner224 7y agoThis book starts you off with NAND gates and then has you build an ALU, CPU, assembler, and finally a Java-like-language compiler. The Elements of Computing Systems / From NAND to Tetris https://www.nand2tetris.org/ https://www.nand2tetris.org/ The first six textbook chapters (all the hardware stuff) are available on the website in the 'Projects' tab, you should buy the book for the other six. All 12 chapter assignments are available on the website. The Software section has a hardware simulator to test your designs.
- jlevers 7y agoI'd like to second this -- I'm slowly making my way through Nand2Tetris (currently building a VM -> assembly transpiler, and if you'd asked me to do that a few months ago, I'd have had no idea what you were talking about), and it's been really fun, taught me a lot about low-level computing, and given me the opportunity to learn a new language (I'm building everything in C). I highly recommend it!
- cmrdporcupine 7y agoI think you'd find that once you dig into those old machines it's a lot simpler than you think. The 6502 for example is pretty easy to interface. Electronics knowledge isn't much needed at first, as it's mostly just logic. You can make a simple "computer" on a breadboard that just cycles a no-op through all of memory: https://coronax.wordpress.com/2012/11/11/running-in-circles/ https://coronax.wordpress.com/2012/11/11/running-in-circles/ From there it's not a tall order to start interfacing SRAMs and some EPROMs and a UART chip and you can get a machine you can connect to over serial. Just try! It's worth it!
- stevekemp 7y agoThe Z80 is very easy to drive on a breadboard - since it just needs a clock. Add a few LEDs to show address-line accesses and you're done: https://www.youtube.com/watch?v=nFIviiwPrLI https://www.youtube.com/watch?v=nFIviiwPrLI The Z80 has RAM-refresh support built-in, and can be hand-clocked if you wish making it one of the simplest processors to run - in terms of required external components.
- Marazan 7y agoThe hand clocking is the magic of the Z80 for me. That you can manually toggle a button to step through every tiny change is so cool.
- Klinky 7y agoYou should check out https://eater.net/ https://eater.net/ and https://www.nand2tetris.org/ https://www.nand2tetris.org/. Both breakdown a lot of the complexity around building a homebrew computer using off the shelf components.
- porlw 7y agoBen Eater's Youtube series building a simple CPU from scratch was a real "lightbulb" moment for me. After 40 years of programming (including Z80 assembly back in the 8-bit days), it took my understanding of the CPU from a mysterious black box to what's basically a simple look-up table and some control signals.
- fentonc 7y agoI happen to be a computer architect both professionally and as a hobbyist, but the basics of it really aren't that complicated. All of the _hard_ parts are people being terribly clever to eek out the last bit of performance in a given technology. Getting any modern <$100 FPGA board and designing a really simple processor is definitely do-able as a complete novice. I haven't read it, but I've heard good things about the Nand2Tetris book someone else in this thread mentioned.
- k_sze 7y ago> All of the _hard_ parts are people being terribly clever to eek out the last bit of performance in a given technology. Is that a skill that's related to how you do optimisation in certain puzzle games? E.g. TIS-100, Opus Magnum, Factorio. Or not really?
- jacquesm 7y agoI don't see a reply to this and not sure if any is forthcoming, but just on the off chance there isn't: at that level anything analog and when you're optimizing for multiple variables at once (power consumption, clock speed, reliability, gate count) it gets complicated in a hurry. The big breakthroughs were the ability to simulate hardware for larger circuits at higher frequencies realistically to determine how to make those circuits stable rather than to get them to oscillate wildly at the frequencies they operate at. Once you develop a bit of appreciation for what is required to make a 100 gates work reliably at 10 MHz or so you can begin to understand the black magic required to make billions of transistors work reliably at frequencies in the GHz. So the skill is not at all related to puzzle games, but it is a puzzle and the tools and knowledge required were usually hard won. At those frequencies and part sizes anything is an antenna, there is no such thing as a proper isolator, coils, resistors and capacitors all over the place even if you did not design them into the circuit (parasitics). If this sort of stuff interests you I highly recommend the 'Spice' tutorials, and/or to get an oscilloscope and some analog parts to play with.
- k_sze 7y agoIs that what “high speed digital design” is? Like the stuff that Dr Howard Johnson teaches? Or is that not the same scope or maybe still something entirely different?
- derjames 7y agoAlso read the book: `Code` by Charles Petzold to complement the material from NAND to Tetris.
- kabdib 7y agoThere are some popular textbooks on computer architecture; Patterson's stuff is good, but there are better texts. Some techno-hobbyist sites (like Ars Technica) do CPU reviews that get into various microarchitectures. Datasheets from processor manufacturers are free and often have interesting details. Going after things at a really low level, books like The Art of Electronics take you from transistors (and through things you probably don't care about, like power supplies and amplifiers) to digital electronics, to simple computer system design. You can probably find value by skimming the component-level stuff, skipping the goopy analog chapters, and just reading the digital electronics sections. (This is more or less how I started with personal computers in 1974 or so).
- k_sze 7y agoCould you elaborate on the "better texts"? Can you give some examples and why/in what respect they are better than (David) Patterson's books? Or are those "better texts" the Ars Technica CPU reviews and manufacturer datasheets that you mentioned in the subsequent sentence?
- kabdib 7y agoI liked John Shen's Modern Processor Design and Noam Nisan's The Elements of Computing Systems. The websites I mentioned have hobbyist-level details that are pretty interesting (but in general won't teach you much about things like concurrency hazards and branch prediction and so forth).
- Bluecobra 7y agoThere’s a lot of good videos on YouTube such as “Hello,world” from scratch on a 6502: https://youtu.be/LnzuMJLZRdU https://youtu.be/LnzuMJLZRdU
- transitorykris 7y agoA few responses pointing to Ben Eater's videos. I have only a rudimentary understanding of electronics. I built my first 6502 computer following his first two videos. Ben's able to strip away a lot of things you don't need to know immediately to get up and running. Supplementing this with reading sites like 6502.org has built a lot of confidence for me to go beyond what Ben's released so far.
- Starwatcher2001 7y agoBack in the day there were a suprising number of good technical books to learn from. I kicked off with two books from Tandy (Radio Shack): [0] The TRS80 Technical Reference Manual (1978). This had the full schematics of the computer, explanations, timing diagrams, fault finding tips etc. Understanding Microprocessors (1979). This taught basic TTL gates, how flip-flops worked, shift-registers, adders and all the other basics. In my opinion learning this stuff gives you a better understanding of coding, especially with low level languages. [0] http://www.trs-80.com/wordpress/books/140213/ http://www.trs-80.com/wordpress/books/140213/