I'd like to know how to implement the MUL and DIV operators using only AND, OR, XOR, NOT, SHL, SHR, ADD and SUB and without much time consuming looping constructs, of course.
I need this because I'm working on a program that will demonstrate how integers of arbitrary length (64, 128 or even 4096 bit) can be implemented. I already have the above operators, now I still need MUL and DIV (integer division, that is). Eventually I'll also need MOD (integer modulo), but I can implement that when I have DIV.
I'm using the higher level language Turbo Pascal, my integers are stored in an array (vector) and I use Intel byte order. Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
I need this because I'm working on a program that will demonstrate how integers of arbitrary length (64, 128 or even 4096 bit) can be implemented. I already have the above operators, now I still need MUL and DIV (integer division, that is). Eventually I'll also need MOD (integer modulo), but I can implement that when I have DIV.
I'm using the higher level language Turbo Pascal, my integers are stored in an array (vector) and I use Intel byte order. Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.