SW multiply accumulate

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SW multiply accumulate
This is a 100% freak question
Are there any one there have a fast way to multiply (and acc.) in software, using a lookup table?

The only way I can make it faster than use the normal inline mul (34 clk + 3 for 24 bit add) is by using a 512 byte lookup table.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How many bits in the two values being multiplied?

A 512 byte lookup table would not allow for much (two 4-bit numbers, multiplied)

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry it's 8*8=16 bit. unsigned to begin with.

The table (I use )is the SQR of the numbers 0..255

Edit extra info

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That would be a huge table. It would take most or all of your code space, depending on your processor.

This is why they have hardware DSPs!

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm looking into the best way sample the ADC on a tiny15(I have 800! for others it would be tiny13)
then run a little FIR filter before sending the data over RS232.
yes 512 byte is huge but the code to run is small so I can avoid spending 7 clk calling a subroutine.

But that's why I ask if anyone has a better way.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow--how much time cycle-saving a 1.5MHz (IIRC) processor with 1k and no SRAM, even if "free", would make up for using Tiny25 that runs many times faster and has lots more resources? And if you do in fact decide on the Tiny25, how many pennies more is a Mega48 with MUL?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

that why I wrote

Quote:

This is a 100% freak question

I just want to know if there is a better way to do it!