At the transistor level? I assume this means that each transistor is simulated digitally, as a pure switch, and not as an analog component, which I imagine would be near impossible to do in Javascript on current hardware.
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.
I assume this means that each transistor is simulated digitally, as a pure switch, and not as an analog component, which I imagine would be near impossible to do in Javascript on current hardware.
Thought this for the longest time, too, but reality can't be simulated on a computer. Only a simplified model can.
Maybe not exactly, but you can get pretty damn close. The digital audio guys are the ones who are really into this. It's the only way to get the exact feel of old audio gear.
> I imagine would be near impossible to do in Javascript on current hardware.
In JavaScript, most probably. But on current hardware, just perhaps. You can't forget the immense floating-point power we have compositing polygons on our displays... GPUs could be used to simulate such a system close to real time, I guess (didn't do the math on that).
I put on a hat so I could take it off again. Very impressive. Now I know what do to do with those old Atari game cartridges which have been sitting in a box by my desk for 5 years.
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
I might be biased as a retrocoder hobbyist myself, but I feel like 6502 assembly would still be very useful in the classroom as a teaching tool, with it's small and (IMO) relatively straightforward instruction set - in some ways it's sort of like the 8-bit RISC-before-there-was-RISC processor. Plus there's great retrocoding potential once you learn it! ;)
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.
The 6510 (C64 6502 with extra ports) has secret opcodes, basically holes in the circuitry, which emulators have to support because they're used in demos for extra speed (eg, write to x what's in a).
I wonder if this simulation also has secret opcodes?
Couldn't think of a decent example off the top of my head.
Also, proper term is 'undocumented opcodes' for further searching.
Try
"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."
A standard double-size bed is 4 ft 6 in by 6 ft 3 in (http://en.wikipedia.org/wiki/Bed#Bed_sizes). A standard cotton sheet is 150 thread count, which means 75 threads per inch of warp and 75 threads per inch of weft (usually) (http://en.wikipedia.org/wiki/Thread_count#Thread_count). That gives about 4050 threads by about 5625 threads, omitting the part of the sheet that tucks down around the edge of the mattress, for a total of about 23 million thread crossings.
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.
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.