hey
i am using 89c51 to measuring velocity. the distance is fix. but i am unable to divide it with time which is varying. plz help me with some example of such division. let my distancce is 15cm and time will not b more than half minute. i am using oscillator of 11.0592MHz.
thanks in advance
mov dptr, #distance movx a, @dptr mov dptr, #time movx b, @dptr div ab
check ur oscillator frequency. 12MHz is best.
thanx but register B is only of 8 bits. what to do if my time is more than #FFh
"hanx but register B is only of 8 bits. what to do if my time is more than #FFh"
The same thing the school teached you when dividing with pen and paper. Just that you aren't limited to digits 0..9 anymore but can compute with digits 0..255 aka bytes.
please make it more easy for me by writing some example... and also tell that how to calculate answers in decimals like 12/5=2.4.
120/5 = 24. Easy to insert a decimal point between the 2 and 4 when presenting the result. Scaling the numbers like that is called fixed-point arithmetic and a way to use integers to compute even when inputs or results have decimals.
thanks
If "easy" is your goal, why don't you just write in 'C'?
actually i dont know 'C' language.... would u plz guide me about some helping material to learn 'C'?
u plz since you gave me the idea, I will save a character by typing 'no' instead of 'yes'
View all questions in Keil forum