Fahim, you seem to be coming at HDL from the perspective of a programmer, this DOES NOT WORK, you need to start by drawing circuit diagrams then translating those into HDL, if you cannot draw a circuit for whatever you need the thing to do, you likely canot convert it to HDL....
Draw the circuit of what you want (and, or, nand, nor, xor, simple arithmetic + flipflops), and at least initially make all the flipflops D types clocked from a common clock, then translate that diagram into HDL.
Don't view a HDL as a programming language, view it as a description of a circuit.
Regards, Dan.