Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/05/00 21:00
Read: times


 
#2109 - RE: how to divide 2 bytes? SOON PLZ..
It is really hard, two weeks ago , I had the same problem , thought It was easy at first , but when I set on the code , it took me almost 6 hours to come with something.
anyway , i'm sure your'e not intrested with that shit , code - I Don't have to give you (maybe i'll write sometime then i have the time) , but good way to do it , I can give u.
first of all , I see all you want to do is to split a 16bit number by a 8bit one , this is much simpler than 16b/16b.
just think what would you do , if you had to split 2 numbers , without a calculator , remmember the 4-th grade ?
yea that's right , same implentation here.
let's call the two numbers with some paramaters :
num1 -> the 8 most signyfcant bits of the number you wish to split
num2 -> the 8 least signyfcan bits.
num3 ->the 8 bit spliiter.

split num1 with num3 , you will have a result and a carry , the result is your MSB DIGIT ! ,dec the carry from the started num1, add the result to num2 , and split this added numbers with num3 , this again will give you a result and a carry , the result is your LSB digit. if you want precise numbers , you have the second carry , do whatever you want with it.

this seems simple maybe here , but start writing this code , use a lot pushs and pops , don't forget to save your results/carrys.
that's it.
if u want a code for this , msg me , i'll try to fix something for u
hope I helped you out.

Nir.

List of 7 messages in thread
TopicAuthorDate
how to divide 2 bytes? SOON PLZ..            01/01/70 00:00      
RE: how to divide 2 bytes? SOON PLZ..            01/01/70 00:00      
RE: how to divide 2 bytes? SOON PLZ..            01/01/70 00:00      
RE: how to divide 2 bytes? SOON PLZ..            01/01/70 00:00      
RE: how to divide 2 bytes? SOON PLZ..            01/01/70 00:00      
RE: how to divide 2 bytes? SOON PLZ..            01/01/70 00:00      
RE: how to divide 2 bytes? SOON PLZ..            01/01/70 00:00      

Back to Subject List