AnyCPU http://anycpu.org/forum/ 

Some BCD arithmetic in an MSP430based calculator http://anycpu.org/forum/viewtopic.php?f=3&t=565 
Page 1 of 1 
Author:  BigEd [ Tue Jan 15, 2019 11:21 am ] 
Post subject:  Some BCD arithmetic in an MSP430based calculator 
. There are several blog posts near here which will be worth reading, for those interested in BCD and CORDIC and so on: https://joldosh.blogspot.com/2018/12/ti ... tions.html https://joldosh.blogspot.com/search/lab ... Calculator https://joldosh.blogspot.com/search/label/BCD Interesting to see a difference in best practice between two CPU architectures: Quote: Multiplication In addition to the straightforward method of repeated additions, I tried the quarter squares and Russian peasant algorithms I learned about doing 6502 BCD multiplication. It was a surprise that using quarter squares was over 10% slower on the MSP430 than the Russian peasant algorithm, whereas it was over 4 times faster on the 6502! Part of the difference may be the speed up I get on the MSP430 by converting each digit of one argument to binary (so it can be halved) only once and saving it, rather than converting it every time like on the 6502. Another major difference is how much slower accessing tables on the MSP430 is compared to register operations. It's interesting how the timing of the architecture can decide which algorithm works the fastest. It's also great that the Russian peasant algorithm doesn't need any tables and is therefore much smaller. 
Page 1 of 1  All times are UTC 
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ 