Has a computer ever been simulated on another computer?

I don’t mean simulating a particular set of circuits; I don’t mean OS emulators like Lindows.

I mean a full computer system emulated by another computer. The simulated computer functioning just like a real computer.

The simulation software might actually display a computer graphic on-screen; a monitor, a mouse, a keyboard. You could then use the “real” mouse to click on the simulated keyboard to input commands, or use the real mouse to click on and move the simulated mouse - which in turn would move the simulated cursor.
Anyway, I think you get the idea. Has anything like this ever been done?

Yes. You can download emulators that make your PC or Mac act like a C-64, or a Sinclair ZX-80, for example. Though why you’d want to is another issue.

Yes, I’ve got a sinclair spectrum (2, I think) emulator and I haven’t noticed any difference between that and the actual old-skool spectrum I had in the 80’s.

Also I’ve seen simulators for things as advanced as the Amiga 500 and even playstation emulators (though I doubt the playstation emulators are fully working).

I think we’re thinking of different ideas here.

I’m guessing that these computer emulators described above act simply as an interface between the emulation and the OS - translating the emulation commands into commands that the operating computer would understand. And besides that, the above examples are, in essence, still just modeling an OS.

This is not what I mean. I’m thinking more along the lines of a Universal Turing Machine. A piece of computer software that simulates, say, a generic PC. It would simulate the entire electrical structure of the computer - NOT the software of the computer. On this simulated PC, you could then run any OS you wanted to. Hell, you could run your C-64 emulated on the simulated PC.

Have I made the difference clear?

I’m not sure this is what you are getting at, but in college I had to design an 8-bit CPU using LogicWorks, a program that simulated gates, circuits, etc.

It had an instruction set and we ran 3 different programs in assembly. Had we had more gusto we could have slapped a front end on it somehow and made what sounds like what you are describing. I’m guessing it has been done.

I thought that a PC emulator for Apple did what you describe, i.e. completely simulate the hardware and CPU, so the software had no way of telling it was running in a simulated environment. Since I’m not knowledgeable in Apple software, I cannot tell you the name of the emulator I’m thinking of. I remember reading it in a computer article, where the specific method of emulation was mentioned for explaining why it was a superior emulator: it couldn’t have a compatibility problem since it behaved exactly like a real PC.

But that’s what a computer is! If you perfectly simulate the circuits in a computer, then you’re simulating the computer.

UAE (the “Useless Amiga Emulator” that is not useless) can emulate the complete hardware of an Amiga, which lets you use your Amiga software on an Intel PC.

MAME simulates the hardware of various arcade machines, though using it is kind of on the border of legal - you must be careful to only emulate games that are really in the public domain.

There are several programs that completely emulate the hardware of the old TRS-80 computers from Radio Shack.

There is Bochs and Plex86, which can emulate the hardware of an Intel PC on any system that runs Unix.

Intel and AMD routinely simulate new processors on existing hardware during the development cycle - if my memory is not totally shot, there was even a Linux Kernel that was booted on a simulation of AMDs new Opteron.

Any others?

I don’t know of any PC emulators off the top of my head except the one for the Apple. I know of a lot of other computers that have been simulated.

Most of the 8 bit computer simulators out there (Commodore, TRS-80, Apple, etc) use software to completely simulate the hardware. Many of them go so far as to simulate the undocumented features of some of the chips used. MAME (Multiple Arcade Machine Emulator) also does the same thing, completely emulating the hardware so that the original software ROMS will run on them without any alteration.

I used a PDP-11 emulator for the VAX many years ago. This completely emulated a PDP-11 computer in software on a VAX, so that the VAX user could run older PDP-11 software.

Software emulators are also sometimes used in hardware developement. We had a simulator for an embedded computer used in a piece of avionics. As the hardware was developed, we switched off parts of the emulator until finally we got rid of it altogether.

How far down in detail do you want to go? It sounds like you’re asking for a program that emulates matter and energy, everything else being built up from those components in the program.

Even here though, are you happy to make do with a an emulation of the statistical properties of, say, silicon, or do you want the properties of silicon to be defined by the emulation of quarks etc?

Generally speaking any commercial emulator will not go down any further in detail than is absolutely necessary for complete function, so this might mean emulating the CPU and other components, but only in a sort of when-this-happens-it-causes-this method; memory is emulated by a bit of code that fulfils all the expectations of the other bits of code emulating other components; no actual transistors, molecules or electrons are being discretely modelled.

There are programs that will emulate electronic circuits and it would be possible to build a rudimentary computer inside one of these, but again, I think they only model the statistical properties of the components, not the way they work on a subatomic level.

Ah, Mangetout, this is exactly what I was trying to get at with my OP.

I do not mean as far down as the atomic level. But I deffinitely mean a lower level than the black box this-goes-in-that-comes-out method. Yes, I’m looking at the level of electronics. Transistors. I know there is software that can emulate electronic circuits but has anyone taken this as far as to build an operable computer inside such software?

Probably still not what you’re looking for, since I think you’re looking for simulation of each component, but VMware does meet these requirements. I assume Virtual PC for the Macintosh does also, but I have no experience with it, so I don’t know for sure.

VMware creates a virtual machine of the same hardware the host OS is running on. If you’re running it on a PIII 733 with 128 megs of RAM and a TNT2 video card, you can’t tell the virtual machine it has a Athlon XP 1800+ with GeForce 4. But, you can then load any OS that would work on the host hardware, and any software that would work with the OS you’re loading.

I think this is what you are talking about. These simulations are run such that the actual circuitry of the new processor is emulated. Not just at command level (software interpreting the individual assemly language instructions,) but actually the hardware that does the work being emulated. They want to see if the design is good, not just try out software for the new processor before the hardware is there - although they do that, too.

If you wanted to try it, you might dig up some software that does logic design and have at it.

Spice would be a good place to start. You design your processor using discrete logic components (or you could go all the way down to transistor level if you really want to be hardcore.)

Then, you create a custom program that does the display stuff and provides you with your on screen keyboard and what have you.

Depending on how deep into this you would want to go, you can either create the peripherals (graphics card, keyboard, etc.) in your program or you could design your own graphic card and only have your program translate its output to something you could see on screen.

You’ve got basically the same choice for every piece of hardware, actually. Do I do it in software in the display program, or do I design the hardware and do it in the simulator?

If you’ve got loads of time, and a good understanding of all parts of a modern computer system, it could be loads of fun.

I am pretty sure that Virtual PC for the Macintosh does exactly what you describe. It is most often bundled with a copy of Windows, but that is certainly not required. You can install any OS that you want… Virtual PC is simulating the PC, not the OS that is running on it. I have run the same version of Virtual PC with DOS, Windows 3.1-XP, and various distros of Linux.

Do they make Mac emulators for Windows? How many levels of simulation could one do? You could run Virtual PC with WinXP, then use that to run VirtualMac (or whatever), then within VirtualMac run Virtual PC, which runs WinXp…and so on and so forth.

The same effect, easily achieved by feeding ones ram to godzilla

I think some old-computer emulators run at a fairly low level. Maybe not transistor level, though.

Does a turing machine emulator count? I suppose it would have to emulate a specific implementation of a turing machine.

Notice some people would claim your distinction was empty - two programs are normally considered the same if they produce identical output for the same input, so simulating memory as separate chips would give the same prog. as simulating memory as “something that remembers values.” I suppose the difference is that you’d get authentic errors if you upped the background radiation count, or similar.

Yes. It’s done during the development of processors. It’s also done when designing computers and other hardware in FPGAs (field programmable gate arrays). The entire computer (or whatever) is simulated in a design package and tested with various stimuli (also simulated) to make sure it behaves properly. That way when it is put into hardware it has a better chance of working.

I’m not sure why you don’t think the various computer emulators count. They model each chip in the system. They aren’t translating things between various operating systems. For a commodore 64 emulator for example, the 6510 CPU is simulated in software, as are the VIC, SID, CIA, etc. The code isn’t being translated from one operating system to another. The bits and bytes are being emulated as they would flow through the actual system.

Ah, okay, I was not aware of exactly how those emulators work. So yes, technically such emulators would meet the critera of my question; but they aren’t really in the spirit of my OP. They represent a very specific implementation whilst I’m interested in much more generic, “turing-esque” implementations.