Any E36 6 cylinder will fit fairly easily.
Will probably be easiest with a 325i (M50B25) engine, drops right in and they use the same fuel injection version.
With 323i and 328i (M52 engines) you might have to change wire looms but it will be pretty easy too.
Don't know about the E46 engines, cost more then it's worth I think. Also, they have OBD-II which complicates things a bit.
I assume you aren't from the US since you have a 320i, which means you didn't get ODB-II in any E36.
<img src='http://www.vovvenviggo.se/ilivetoride/sig8.JPG' border='0' alt='user posted image' />
1994 Arcticsilber M3, 286hp, 18" AC Schnitzer wheels.