3 ms·
Very nice! Shows that it's possible to do something concise while still remain readability and educational value. My mind was absolutely blown when I first rea
by mungoman2 11y ago
Very nice! Shows that it's possible to do something concise while still remain readability and educational value.
My mind was absolutely blown when I first realized that the function of a CPU is pretty much to read tokens from a stream and perform an action for each. - no magic!
- jarcane 11y agoFor me the fun realization was when I cottoned on how nicely instruction microcode lines up as a concept with stored functions in a language with first class functions. Your instruction look up becomes your execution step in one go: https://github.com/jarcane/MicroMini/blob/master/main.rkt https://github.com/jarcane/MicroMini/blob/master/main.rkt
- lfowles 11y ago> My mind was absolutely blown when I first realized that the function of a CPU is pretty much to read tokens from a stream and perform an action for each. - no magic! The magic is mostly in the pipelining bit :)
- cantrevealname 11y ago> My mind was absolutely blown when I first realized that the function of a CPU is pretty much to read tokens from a stream and perform an action for each. My "aha!" moment when I first learned about CPUs was the program counter, or if you're an Intel guy, you'd call it the instruction pointer. The PC might seem obvious, but if you think about it for a moment, you'll realize that someone had to have invented it. It's not totally obvious. And as far as I can tell, the inventor is unknown. Note also that the featured program does not have a PC, so there are things it can't do that a normal CPU can do.
- rdc12 11y agoAnd if you look at computers based on drum memory, then you probably didn't have a PC, the optimal place for the next instruction then wasn't the next address, but instead how far the drum rotated during execution, at least in some of those machines the next instruction was encoded in the current instruction. Having RAM seems to be important to having a PC, that works well.