views:

1027

answers:

9

In simple understandable terms, what is the difference between the two terms?

[I have already looked at this, this and this]

+3  A: 

An "emulator" is a term for a software-based hardware-simulator, but in general the two are synonyms.

BlueRaja - Danny Pflughoeft
I don't really know anything, but I would guess that sometimes a simulator may not actually emulate the actual low level hardware, but instead be a peice of software that simulates the high level platform apis.
Breton
+2  A: 

Both are models of an object that you have some means of controlling inputs and observing outputs. With an emulator, you want the output to be exactly what the object you are emulating would produce. With a simulator, you want certain properties of your output to be similar to what the object would produce.

Let me give an example -- suppose you want to do some system testing to see how adding a new sensor (like a thermometer) to a system would affect the system. You know that the thermometer sends a message 8 time a second containing its measurement.

Simulation -- if you do not have the thermometer yet, but you want to test that this message rate will not overload you system, you can simulate the sensor by attaching a unit that sends a random number 8 times a second. You can run any test that does not rely on the actual value the sensor sends.

Emulation -- suppose you have a very expensive thermometer that measures to 0.001 C, and you want to see if you can get by with a cheaper thermometer that only measures to the nearest 0.5 C. You can emulate the cheaper thermometer using an expensive thermometer by rounding the reading to the nearest 0.5 C and running tests that rely on the temperature values.

Jay Elston
Check the links, he's talking about hardware emulation
Carlos Gutiérrez
+2  A: 

I do not know whether this is the general opinion, but I've always differentiated the two by what they are used for. An emulator is used if you actually want to use the emulated machine for its output. A simulator, on the other hand, is for when you want to study the simulated machine or test its behaviour.

For example, if you want to write some state machine logic in your application (which is running on a general purpose CPU), you write a small state machine emulator. If you want to study the efficiency or viability of a state machine for a particular problem, you write a simulator.

Max Shawabkeh
That's pretty much my understanding, too. I even coined a catch-phrase for that distinction: "A simulator is an emulator on a mission".
Jörg W Mittag
+1  A: 

Coming from the hardware development world. . .

Simulation tests functionality. 2+2 = 4 etc

Emulation tests the functionality on the specific environment (64-bit, 16-bit, fingers and toes).

Here is a food example:

You have two pieces of bread, one knife, peanut butter and jelly and will be giving them to a kindergartner. You write instructions on how to make a sandwich.

In simulation, you would act out the process, pretend you opened the jars, pretend spreading the peanut butter etc.

If at the end of the instructions your are left with only jelly and not peanut butter then you failed the simulation and you need to fix your instructions. On the other hand if you have a complete "sandwich" then the instructions should be valid

In emulation, you would use close representations of the actual parts (same bread, knife peanut butter etc). What happens if you gave your kindergartner a cheap plastic knife and really really thick peanut butter?? The knife would break in emulation and the instructions would need to be clarified or fixed to accommodate this problem. In this case you might suggest warming up the peanut butter in the microwave.

In practice: Consider a 64-bit system that you are programming in and a 32bit system that will actually be running the code. You add two very very large numbers and print the result. In simulation everything works (you managed to get the code right to add two numbers) In emulation however you find that you get the wrong answer. What happened? The emulation of the 32-bit system was unable to handle the large numbers. This is an example of correct functionality (i.e. simulation) but not proper support for your runtime environment (emulation)

Toymakerii
+3  A: 

This is a hard question to answer definitively because the terms and often misused or confused.

Often, an emulator is a complete re-implementation of a particular device or platform. The emulator acts exactly like the real device would. For example, a NES emulator implements the CPU, the sound chip, the video output, the controller signals, etc. The unmodified code from a NES castridge can be dumped and then the resulting image can be loaded into our emulator and played.

A simulator is a partial implementation of a device/platform, it does just enough for its own purposes. For example, the iPhone Simulator runs an "iPhone app" that has been specifically compiled to target x86 and the Cocoa API rather than the real device's ARM CPU and Cocoa Touch API. However, the binary that we run in the simulator would not work on the real device.

Coxy
A: 

Please forgive me if I'm wrong. And I have to admit upfront that I haven't done any research on these 2 terms. Anyway...

Emulation is to mimic something with detailed known results, whatever the internal behaviors actually are. We only try to get things done and don't care much about what goes on inside.

Simulation, on the other hand, is to mimic something with some known behaviors to study something not being known yet.

my 2cents

shinkou
+17  A: 

(Using as an example your first link)

You want to duplicate the behavior of an old HP calculator, there are two options:

  1. You write new program that draws the calculator's display and keys, and when the user clicks on the keys, your programs does what the old calculator did. This is a Simulator

  2. You get a dump of the calculator's firmware, then write a program that loads the firmware and interprets it the same way the microprocessor in the calculator did. This is an Emulator

The Simulator tries to duplicate the behavior of the device.
The Emulator tries to duplicate the inner workings of the device.

Carlos Gutiérrez
I've never seen a simpler explanation... Thank you very much :)
Legend
Yes -- that's an excellent way of summarizing that. Thanks!
Andrew Flanagan
A: 

Here's an example - we recently developed a simulation model to measure the remote transmission response time of a yet-to-be-developed system. An emulation analysis would not have given us the answer in time to upgrade the bandwidth capacity so simulation was our approach. Because we were mostly interested in determining bandwidth needs, we cared primarily about transaction size and volume, not the processing of the system. The simulation model was on a stand-alone piece of software that was designed to model discrete-event processes. To summarize in response to your question, emulation is a type of simulation. But, in this case, simulation was NOT an emulation because it didn't fully represent the new system, only the size and volume of transactions.

Grembo
+1  A: 

Generally, I think of this larger question in three pieces: simulation, stimulation, emulation, and modeling.

Simulation is the use of modeling to create a controllable, representative stand in for a complex system. Simulations are, by definition, always incomplete.

Stimulation is the use of artificial environmental inputs to a well defined interface to drive, examine and test the behavior of a real world device.

Emulation is the replacement of a real world device with an model at a well defined interface for the purposes of allowing controlled responses from the emulated real world device. The emulation is "complete" if all the interfaces are present, and the resulting observed behavior matches that of the real world device.

Modeling is the use of mathematical techniques, specialized hardware, and engineering judgment to create a representative stand in for a real world environment, device, system, or behavior.

In "simple terms" this means that an emulator is something that across a well defined interface is indistinguishable from the real world equivalent (except in speed). Emulations can be complete or incomplete.

In "simple terms" a simulation is any system that can be controlled and examined for a range of behaviors that are similar or analogous to a real world system. Simulations are never, by definition, complete.

semiuseless