Tuesday, April 28, 2009
Line of code of the day
Hmmm ... you know... sometimes you create pieces of code that look like crap but do wonderful things and very fast... so i'll paste a line of a VHDL architecture module... now imagine that 90% of the rest of the module is similar... yes... a nightmare to debug... div_buffer <= (NUM_VARS-LOG2_NUM_VARS-1 downto 1 => '0')&((offset-(stack(top)(NUM_VARS+LOG2_NUM_VARS-2 downto NUM_VARS)&'0'))&'0'); But work! I might clean up the code later ... anyway, this calculates a divider for a bit vector calculation ... in software takes around 2*N clock cycles to calculate the bit vector, in hardware takes N*log(N) clock cycles... i would say my implementation is efficient .. XD In other news, my pen tablet and gimp (or should i say GTK+?) are always punching eachother... i found a way of solving the issues ... reboot! ... This only happens in windows Vista... so... yeah ... Vista is not only sluggish, slow and bad... is even worse ... specially since my pen tablet says "Certified for windows Vista" ... go figure!