View unanswered posts | View active topics It is currently Thu Mar 28, 2024 12:45 pm



Reply to topic  [ 1 post ] 
 Some BCD arithmetic in an MSP430-based calculator 
Author Message

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1780
.
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.


Tue Jan 15, 2019 11:21 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software