I frequently see Simulation and Emulation in computer science. These two terms seem synonymous. Is there any difference between Simulation and Emulation?
Yes, the concepts are different.
simulation is a system that behaves similar to something else, but is implemented in an entirely different way. It provides the basic behaviour of a system, but may not necessarily adhere to all of the rules of the system being simulated. It is there to give you an idea about how something works.
Think of a flight simulator as an example. It looks and feels like you are flying an airplane, but you are completely disconnected from the reality of flying the plane, and you can bend or break those rules as you see fit. For example, fly an Airbus A380 upside down between London and Sydney without breaking it.
emulation is a system that behaves exactly like something else, and adheres to all of the rules of the system being emulated. It is effectively a complete replication of another system, right down to being binary compatible with the emulated system's inputs and outputs, but operating in a different environment to the environment of the original emulated system. The rules are fixed, and cannot be changed, or the system fails.
The M.A.M.E. system is built around this very premise. All those old arcade systems that have been long forgotten, that were implemented almost entirely in hardware, or in the firmware of their hardware systems can be emulated right down to the original bugs and crashes that would occur when you reached the highest possible score.
20"behave exacly like ..." may be not necessary. The important thing is that it "reproduce the same exact external behavior" in respect to what uses it. Feb 13, 2012 at 20:39
Note that it depends on what is being simulated/emulated. For example, something that emulates a PC compatible computer may be far less accurate and a lot less realistic than something that simulates the digital circuitry of a PC compatible computer. In this case, the simulator may behave "exactly like" a real PC while the emulator doesn't (because the simulator is simulating something at a much lower level).– BrendanJul 1, 2015 at 7:07
A simulation is a model constructed of something else which reproduces some of that thing's features and leaves others out - obviously you want to preserve the features relevant to your query, and leave out the irrelevant ones.
For instance, a simulation of early-morning commuter traffic leaves out the commuter's names, and maybe even their identities (using a counter variable rather than an actual set of
Commuter objects), but it cannot disregard their rate of arrival.
Emulation is the running of a software X created for platform A on platform B, without changing the software itself. This requires building a model of A that runs on B, and obviously it has to model everything about A that involves code execution. (In theory you could omit support for opcodes that you know this particular software won't ever use, but that is rare - doing an emulator is hard work, and it's much more worthwhile to do a thorough job and have something reusable than a kludge that works only for S.)
Both means something doing the job of something else.
The difference is that "Simulation" happens at a conscious level (with respect to the user) and is finalized typically to anticipate the result of a reality without touching the reality itself.
"Emulation" happens at an unconscious level, and has the purpose to replace an underlying component with another different one that -in respect to the user- works as the old one.
In other words, simulation happen in a "parallel world", while emulation happens in a "replaced world".
3How does this answer the OP's question in terms of computer science? There is nothing either conscious or unconscious about them. A simulation is real, as is an emulation. Their respective purposes however are conceptually very different. Feb 13, 2012 at 12:01
@S.Robins: conscious/unconscious != real/unreal. conscious = something you explicitly decided, unconscious something you did not decide yourself explicitly. An app running on an "emulated" system doesn't know about that emulation. An app running on a "simulated" system must know about it, since it will not necessarily have a the same behavior. Feb 13, 2012 at 15:12
1It has nothing to do with which apps are running where, and nothing to do with making conscious or unconscious decisions. The difference fundamentally is about whether a system is being modeled generally, or replicated entirely. Feb 13, 2012 at 20:26
@S.Robins: I agree with the concept you mean, but there is something subtle it doesn't catch: an "emulator" is typically conceived to run something on top, replacing something under the scope of the application. A "simulator" is typically conceived to be run for itself instead of the real application. They are not at the same abstraction level. Feb 13, 2012 at 20:34
Technically, they both do the same: do something in an environment that acts as if it were the real thing.
Conceptually, however, there is an important difference.
A simulation is supposed to be detached from the real world to a certain degree; the output of a simulation is not directly connected to the thing it simulates. For example, an aircraft simulator does not actually fly, and the pilot is not actually communicating with a real air traffic controller.
A simulation usually has the goal of testing or predicting some real-life process in a safe environment; because the simulation is disconnected from the real world, nothing really bad can happen (a crashed aircraft simulator never kills real people).
An emulation, by contrast, has the goal of taking the place of the real thing: for example, if you emulate a simple microcontroller using a more sophisticated programmable CPU, that CPU can be used in place of the original microcontroller; it will be physically connected to some machine, and it will actually control that machine just like the microcontroller would.
The goal of an emulation is to replace hardware or software components with functional equivalents when the original modules aren't available (or have become too expensive, if only to maintain). Emulation can also serve the goal of using hardware more flexibly - the same programmable microcontroller can double for several simpler controllers, switching emulation mode as needed.
"technically", they are entirely different. The conceptual difference you describe is fundamental to this difference. Feb 13, 2012 at 11:55
@S.Robins: by 'technically', I mean that technical implementations are often similar or equivalent; the difference is mainly in what you use them for.– tdammersFeb 13, 2012 at 19:32
It has nothing to do with use cases. It is the fundamental difference of purposes which defines two very separate concepts. The emulation seeks to replace a complex system of functionality exactly so that it is indistinguishable from the original, while the simulation is a big simplification of a system and represents functionality in a very general sense via a model. Thus, the technical implementations are necessarily vastly different. Feb 13, 2012 at 20:19
@S.Robins - I disagree. Whether you simulate or emulate a given microprocessor doesn't make much of a difference for the implementation, but what you do with it does.– tdammersFeb 13, 2012 at 20:47
1@tdammers: Generally, the primary design goal of an emulator is to serve as a "real-time" replacement for the thing being emulated, while a major design goal of a simulators is to allow not-necessarily-real-time analysis of, and possibly interaction with, the underlying process. Some simulators may be fast, and some emulators may provide substantial abilities to analyze and/or interact with the underlying process, but the engineering priorities are different.– supercatJan 28, 2014 at 18:02
While the etymology isn't strictly accurate, think about the difference between sympathy, "I can imagine what that must feel like" and empathy, "I know what that feels like." A simulation might include visual representation of a problem, but it might not. For example it might just print out columns of numbers representing how many people are lined up for something or total revenue or average speed. It has some characteristics that match reality, and some that don't.
Emulation, which is often used in the context of one platform pretending to be another platform, is far more complete. So Windows Phone developers can run or debug their phone apps on a Windows machine in an emulator, which looks like a phone and behaves like one too. You can run your old Commodore 64 games in an emulator, too.
The words aren't precise. Most flight simulators are more like emulators in my opinion, but the name has stuck from a time when they were not so immersive. Some people reserve the word emulator for the cross-platform case and reject it for anything else. You'll probably never be thought wrong if you do the same when speaking, but understand that some people may place the boundary between the two words a little differently, and make allowances when someone says "this is an emulation" for a really accurate and complete simulation.
1It seems a common misconception that emulation and simulation are effectively the same. This may be because the word emulate can mean to mirror the behavior of others (e.g.: a child emulates his father). This is technically inaccurate when spoken of in terms of computer science. A flight simulator isn't an emulation, because all input/output is manged through a purpose built program - the simulator - which doesn't exactly replicate the behavior of the aircraft it's modeled on, as it doesn't implement the exact same computer programs the aircraft does. If it did, then it would be an emulator. Feb 13, 2012 at 14:31
Both terms are very much similar in concept - mimicking.
Simulation or Simulators make use of software to produce a replicated system that is very much similar to target model in respect to its underlying core functionality(especially its basic methodology).
Emulators, on the other hand, focus more on exterior similarity when compared to target system. It has minimum concern for "how" the functions are mimicked. Emulators are, in general, used when working in a completely different environment(For example a different Operating system) as compared to the original system.
1I'd say you got the two concepts mixed up. It's simulation that doesn't care about the exact implementation; emulation cares very much about the internals. See: M.A.M.E. Jul 1, 2015 at 1:48