Is there any hardware device inside computer that helps to convert high level language into machine, like compiler and assembler ?
closed as unclear what you're asking by Wandering Logic, David Richerby, FrankW, Juho, Patrick87 Oct 16 '14 at 15:18
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
No, and yes.
The answer is "no", in the sense that the vast majority of computers have no hardware that does what you typically expect a compiler to do; compilers are written in software. Obviously this ultimately runs on hardware, but we're talking general-purpose hardware.
However, the answer is "yes", in the sense that the machine code that is actually executed often isn't the same as the machine code that a programmer sees (i.e. the instruction set architecture, or ISA for short). Almost all modern CPUs do some degree of dynamic translation of the "machine code" into a form that is more suited for out-of-order execution.
Intel/AMD-type CPUs, for example, translate machine code into RISC micro-operations (called "uops"). It is these instructions which are scheduled and executed.
ARM has something similar. Its ISA is much closer to the format that's executed, but ARM also features Thumb instructions, which are dynamically translated into "core" instructions. The short-lived Jazelle DBX/ThumbEE did a similar thing with direct execution of JVM bytecode.
Almost all modern high-performance CPUs do this to varying degrees. Indeed, there is a fuzzy line between "dynamic translation" and "instruction decoding".
To complement the very good answer by Pseudonym (this was initially intended as a comment, but became long).
As Pseudonym said, all CPUs can be considered has having some form of translation process of code into more elementary steps, of for more elementary cicuit, and there is a fuzzy distinction between "dynamic translation" and "instruction decoding".
But if you go one level up, you have byte-code interpreters. Byte code interpreters translate byte-code (i.e. source code at this level) into machine instructions. The first byte code interpreters were written as software programs. Then people started making specilized computers which looked like their machine code was the byte-code. They actually had byte-code interpreters inside, implemented in microcode residing on high-speed memory. Now again, the line is fuzzy: is an unchanging program in microcode on high speed memory to be considered hardware or or precompiled software. But then, in what sense would it be different from other programmable logic device found in various hardware pieces, and in what sense would these be different from hardware assembled from logical gates with a soldering iron. Actually microcode is often stored in a ROM (read-only memory) or PLA (programmable logic array) structure, or a combination of both.
The concept of bytecode dates back to the 1960s, and it was much developed for Pascal implementations in the 1970s as p-code (often understood at the time as Pascal-code, though meaning now portable code) leading to what is probably the first byte-code machine: the Pascal MicroEngine in 1979. Its p-code was, effectively, its native machine language.
Around the same time, the Lisp machine was developed, using microcode to implement an instruction set specialized for Lisp.
To my knowledge, this is about as high as hardware will go in the code ecology, but it does make some room for various translations: what is object code for one level is source code for the level below. From a conceptual point of view, there is no difference between hardware and software as to what they can do. It is mostly an issue of flexibility, speed, reliability and cost-effectiveness. And you prefer to have highly complex structures in software so as to be able to debug them and correct them: hardware bugs can be very expensive to deal with. These parameters also fix the level of programmability from very hard circuitry, to programmable logic, to microcode and read-only memory to standard dynamically programmable memory that may contain the code for a compiler.
These remarks about hierarchical, multi-level translation structures also apply to some extent at the program design level, when the translation from general specification to architecture, to algorithms, to source code is done by humans. The same is or can be true for other concepts such as memory management, caching, parallel processing, communications.
However, this answer has been cheating a bit in the sense that it talks only of interpretation, not compilation. Interpretation is pretty much an on the fly translation process, but often (not always: it can be memoized) executes the resulting code immediately without memorizing it as a compiler would. Then, the question is only about conversion, not memorization or compilers. Furthermore, interpreters are usually also considered as program translators.