Well Going through basic Functioning of computer's instruction /program, I learnt that We write source code in High Level Language.Compilers convert it into low level language (Machine code/object code). I also learnt that Assembler converts assembly language into machine code/object code.
Then I have got following doubts:
From where this assembly language is generated if compilers directly convert high level to low level.
if the conversion process has to go through assembly language i.e
High Level Language ====> Assembly language ====> object code/machine code,
then who converts this high level language to assembly language and what is the use of it?
It's just a problem of imprecise terminology and specific implementations.
In the "classical" model, the compiler converts high level code to assembly, the assembler assembles it to machine code that gets stored into object files, which then are linked to generate an executable file.
Normally all these steps are mostly hidden (especially the assembly part) because typically you invoke the compiler through a "compiler driver", which automatically invokes all the parts of this toolchain, although generally there are options to stop the flow at some level to inspect what's going on (stopping at the assembly level to inspect the work of the compiler is interesting enough that there are even several sites dedicated just to that).
Still, this is both quite a high level view, and depending on the language and implementation some steps may be missing or handled differently - for example, you can have the compiler generate straight machine code, or the linker generate assembly/machine code instead of just linking (this happens all the time when you enable link time code generation). So, the schema above is just that - a useful schema to understand the basic flow, it's by no means exhaustive of the possibilities that can be done. As long as high level language enters, some kind of executable code exits, anything goes.
Actually compiler never converts high level language into machine level language. This definition is true but only for C language. Because in java file.java for example will be converted into byte code by a compiler which is neither High or Low Level Language but is an intermediate language. Compiler is a program because it converts source code or language into target code or language where source code can be High Level Language but Target code should be lower than Source code because if the level of both become same than it is called a pre-processor.
This is a very general question (and also a bit difficult to understand, to be honest).
A compiler for a high-level language could convert high level code into assembler and a secondary utility could convert assembler into what you call machine code. A compiler could also produce machine code directly. Either option is valid and it is up to the compiler's designers to determine which is most appropriate.
That said, assembly is one step away from being "machine code", so it is often useful to be able to read it to determine what the compiler has done. Sometimes this will lead to insights that allow one to optimize the high level code; other times, a 1337 programmer might opt to edit the assembly by hand. For this reason, even if a compiler appears to produce machine code directly, it is often the case that it can produce assembly code instead.
See this SO answer for further details.