Has a computer ever been simulated on another computer?

Is anyone aware of a PC emulator for PCs? I want an emulator that acts like a PC from about 10 years ago. I have all these games that I can’t get working these days, because I don’t have a soundblaster etc anymore. Can I get an emulator that will act like a dos window, but be able to use my soundcard, mouse etc through windows, without any messing about with config.sys files etc?

Just had to stick in my head and say I have both a Gameboy emulator and a C-64 emulator on my cell-phone. [/takes a bow]

Speaking as someone who’s worked in electronics design for a number of years, there are many different ways of simulating the action of a CPU and other logic. Which level of abstraction is used depends on exactly what is required to be tested.

At the lowest level, you can do an accurate timing simulation of the final electronic design, modeling all the individual gates on the final device, and modelling the timing for signals to propagate between each component. This is hideously slow, and might take weeks to simulate a millisecond of real-time operation, depending on the complexity of the design. But if you are spending half a million dollars on an ASIC then it’s worth it before you commit the final design to silicon.

Then you can do an RTL (Register Transfer Level) simulation. This models the circuit as made up of a number of registers connected by asynchronous logic; these exchange data on the rising edge of a clock signal, passing it through logic gates. This sort of simulation is done throughout the design process, and tests the logical correctness of a design even though it cannot tell if a design will meet timing constraints.

Above that, you can use a functional simulation, which models the processor on the level of inputs and outputs. This is used when developing code for a processor, system-on-chip design, or entire system, or to model interations between components of a system. This includes simulators such as ARMulator, an ARM processor simulator. Some models are cycle-accurate, and reproduce the way a CPU will actually respond to input signals and drive output signals. Others, for instance in a software emulator designed to let you run PC software on a Mac, or an OS simulator like VxWorks, just model the effects on registers and memory without doing accurate timing.

Many of these pieces of software are hugely expensive, into six figures for an application like Seamless which allows you to model at the RTL and functional level, or even more expensive for ASIC (application-specific integration circuit) design tools, which can cost over $1m.

Simple simulations of a Turing machine and finite-state automata are very easy to program, and many versions can be found on university CS websites. Here is a simple Turing machine emulation, and there are many other sites with emulations of cellular automata and related systems:

http://www.nmia.com/~soki/turing/

Bochs will provide a complete hardware emulation of an IA-32 computer (IA-32 being Intel’s 32-bit architecture, which means 80386 and on up through the Pentium series). You can provide the OS in the form of a disk image (a bootable floppy would presumably work).

If you can compile C programs, dosemu is probably the more direct route: It specifically emulates a computer running MS-DOS (it actually comes with a FreeDOS distro, but all DOSes are very much alike). But I don’t know how *nix-specific dosemu is, or whether a non-guru would be able to get it working under Windows.

There’s Connectix Virtual PC for Windows, that is an x86 virtual machine (also available on the Mac). There’s also VMWare for Linux and Windows, which is another (pricier) x86 virtual machine.

These emulators are logical emulators – they don’t emulate every component on the original circuit boards – that would be incredibly slow. Instead they emulate hardware like a black box – known data in, expected result out. Thus you get a virtual machine that the operating system doesn’t know is virtual. Since it’s a complete virtual machine, there’s no reason you can’t run an emulation inside an emulation and so on ad infinitum until your computer slows to a useless crawl.

I seem to recall a professor telling the class that someone had designed a Turing machine that would read its tape as a program to the left of the start point, data to the right of the start point, and emulate a Turing machine. It was quite complex. I would probably nominate this effort if there is ever a “Most work done to accomplish nothing” award.

To go any more basic than that, I think you’re looking to create something that models all of reality (useful if you could speed it up and look at the future, ignoring paradox). I’ve often wondered if you could create a simulator to model the entire universe. I was thinking the total amount of information required (position and speed of each particle, plus all of the Physics involved) would probably require at least all of the matter/energy in the universe, and someone already did that. Then my brain imploded and I went back to work.

[QUOTE]
*Originally posted by Derleth *
**[here’s Connectix Virtual PC for Windows, **

Thanks for the suggestions. Do these work well with games? I’m desperate to play Xcom Apocalypse for the first time in years.

Bakhesh, I think there is a very good chance that they’ll work very well with games. After all, they emulate hardware, as opposed to a specific OS. If they emulate hardware well enough to fool an OS (which they do), they can probably fool a game.