How to divide a binary no. to another binary no. in Assembly

Status
Not open for further replies.

gopalkc

Newbie level 3
Joined
Jul 17, 2004
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
17
16f877

i have some problem while programming in assembly language.
can anyone tell how to divide a binary no. to another binary no. .
multiplication is also a problem too.
 

Re: 16f877

If you want to divide by the base number or multiple, just make a shitf. First shitf divide or mult. by 2, second 4 and so on.

if you want to divide by 5 for example, you can make 2 shift and then substract once.


Is what i did in my proyects
 

Re: 16f877

Moved to microcontrollers
 

Re: 16f877

Multiplication and Division are algorithms. You can find many at www.piclist.org Sourcecode section. Note that they take up ALOT of instuction cycles on te 16F877. If you do a lot of multiplication, you may want to consider the PIC18 series which comes with built-in hardware multiplier.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…