Writing a compiler for any modern language brings about a lot of issues that you don't need to consider when writing an emulator.
Much more important is to understand how a CPU works, i.e. assembler programming.
If you are newbie at that, search for 8051 CPU specs (as far as I know, it is the most common microprocessor teaching subject), and get a simulator for it and play with it a bit. Perhaps some basic information on what to expect, would be useful too...
As for one's first emulation project, I would suggest trying to emulate some very simple computer, such as the Commodore 64.
You would need to search for information on which CPU it uses, how it maps memory, how timers work, and how it accesses peripherials, and how the display is rendered, among other things.
If you have some programming experience (or more precisely, experience reading source code), I would greatly recommend studying an existing emulator, locating the relevant emulation cores (such as the CPU emulation), and inspecting them. It may bring a lot of good ideas to start with.
Edit: And despite the fact that the smallest Commodore PET 2001 emulator (which can run Microsoft BASIC among other things)
fits in under 4 kilobytes of C code, you should
not try to take example on that one :)