Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulator or Emulator? What is the difference?

While I understand what simulation and emulation mean in general, I almost always get confused about them. Assume that I create a piece of software that mimics existing hardware/software, what should I call it? A simulator or an emulator?

Could anyone explain the difference in terms of programming?

Bonus: What is the difference in English between these two terms? (Sorry, I am not a native speaker :))

like image 211
Khaled Alshaya Avatar asked Oct 18 '09 11:10

Khaled Alshaya


People also ask

What's the difference between emulation and simulation?

Simulation. A simulator creates an environment that mimics the behaviors, variables, and configurations that exist in an app's production environment. On the other hand, an emulator mimics all of the hardware and software features for the production environment of a real device.

What is the difference between emulator and simulator in Android?

The Android Emulator tests both the hardware and the software whereas the Android Simulator tests only the software. It means you can test the associated parts of the product as well by using an Emulator. But it is not possible with a simulator.

What is emulator and simulator in mobile testing?

Testers must use MacBooks or run macOS on a virtual machine on their systems. Simulators are different from emulators because they don't mimic hardware. As a result, testing functionalities such as cellular interrupts, battery usage, motion sensors, etc., isn't possible when using simulators.


1 Answers

Emulation is the process of mimicking the outwardly observable behavior to match an existing target. The internal state of the emulation mechanism does not have to accurately reflect the internal state of the target which it is emulating.

Simulation, on the other hand, involves modeling the underlying state of the target. The end result of a good simulation is that the simulation model will emulate the target which it is simulating.

Ideally, you should be able to look into the simulation and observe properties that you would also see if you looked into the original target. In practice, there may some shortcuts to the simulation for performance reasons -- that is, some internal aspects of the simulation may actually be an emulation.

MAME is an arcade game emulator; Hyperterm is a (not very good) terminal emulator. There's no need to model the arcade machine or a terminal in detail to get the desired emulated behavior.

Flight Simulator is a simulator; SPICE is an electronics simulator. They model as much as possible every detail of the target to represent what the target does in reality.

EDIT: Other responses have pointed out that the goal of an emulation is to able to substitute for the object it is emulating. That's an important point. A simulation's focus is more on the modeling of the internal state of the target -- and the simulation does not necessarily lead to emulation. In particular, a simulation may run far slower than real-time. SPICE, for example, cannot substitute for an actual electronics circuit (even if assuming there was some kind of magical device that perfectly interfaces electrical circuits to a SPICE simulation.) A simulation does not always lead to emulation --

like image 63
Toybuilder Avatar answered Oct 01 '22 10:10

Toybuilder