Not the most practical way to emulate a CPU, but surely a good exercise in learning how a processor works from the component level on up.
Notably, the description of the 6502 was reverse engineered from die photographs.
Thought this for the longest time, too, but reality can't be simulated on a computer. Only a simplified model can.
An amp is much simpler than a microchip but the ideas are there:
Pretty different things those two, if you consider chaos theory.
Still, computers are by design created in a way which can be easily modeled.
Also, this seems like it should have a unit to itself on any CS course, not to mention serving as a platform much further research. Maybe I should take up 6502 Assembler as a hobby. Their SigGraph slides are well worth a look: http://www.visual6502.org/docs/6502_in_action_14_web.pdf
And yes. I learned to program on a TI-55 calculator. Limiting complexity is a very useful tool to introduce someone to programming.
It reminds me of 6502-sim for my Apple ][ - it was a 6502 application (Sorry Captain Obvious), but it was cool as it was showing how each instruction worked.
This goes beyond it :)
It runs at 27hz (not 27Mhz)...
And some people are willing to simulate the brain? Good luck!
By contrast, the Apple II ran at 1 Mhz.
But you could simulate a lot using a couple GPUs. That's what OpenCL is for.
I wonder if this simulation also has secret opcodes?
Also, proper term is 'undocumented opcodes' for further searching.
"AXS * (SAX)
AXS ANDs the contents of the A and X registers (without changing the
contents of either register) and stores the result in memory.
AXS does not affect any flags in the processor status register."
But How Do It Know? - The Basic Principles of Computers for Everyone
The Intel Core i7 has about 781 million transistors (http://en.wikipedia.org/wiki/Intel_cpus#Core_i7), which is about the number of warp/weft crossings in 34 standard bedsheets, omitting the stuff around the edge of the mattress. I thought maybe ARM chips would be smaller, but http://www.geek.com/articles/mobile/arm-introduces-cortex-a8... says the Cortex-A8 has over a billion transistors. (Although there are certainly low-end microcontroller ARMs that are much smaller. And of course the C18 is smaller still; is it "modern"?)
If you're talking about bigger beds and finer sheets, you might get the number down to less than 10 bedsheets per CPU.
But that doesn't mean you could make a diagram of a modern CPU that was only the size of ten to forty bedsheets, with the transistors the size of warp/weft crossings in a bedsheet. If I remember correctly, only a minority of the chip area typically consists of transistors and other active devices.