Complicated Algebra Using Circuits

Thread Starter

magikal

Joined Nov 23, 2008
31
How does one do complicated mathematical operations with input/output voltage such as ln, e^x, division and multiplication with micro processors? Is there a chip that does it?
 

beenthere

Joined Apr 20, 2004
15,819
You might have to write your own routines, but they can all add and subtract. The definition of computer is that it is a numeric engine, which is to say: a machine that runs on numbers.

Get the data sheet for one and look at the instruction set. Remember that if there is no explicit instruction to take a square root, you can write a routing that follows an algorithm and get that result.
 

steveb

Joined Jul 3, 2008
2,436
sorry, I meant to say without a micro controller. Is it still possible?
Yes, it's possible to do all of the functions you mention. There are logarithmic amplifiers and multiplier chips; even division. As you might imagine, the multiplication and division can be done with logarithmic amplifiers combined with adders and subtractors. It's tricky stuff though. There are dynamic range limits and temperature sensitivity issues.
 

steveb

Joined Jul 3, 2008
2,436
Could you give me some examples of such chips? My range does not need to be very big.
I'm not up on this stuff. I used a multiplier chip years ago, but can't remember which one. I think it might have been an Analog Devices chip. I recommend looking at the Analog Devices web site and read through the data sheets. If I remember right, these parts aren't cheap. Nowadays, you would be much better off with a digital approach. Maybe the only advantage of analog parts (for this type of application) could be high bandwidth. Since we don't know your application, it's hard to say much more.
 

Thread Starter

magikal

Joined Nov 23, 2008
31
What is the difference between a digital and analogue approach? Also, around how much do these chips typically cost?
 

Thread Starter

magikal

Joined Nov 23, 2008
31
Also, how easy is it to use the four quadrant multiplier? How reliable and accurate is it? And how can addition and subtraction be done?
 

beenthere

Joined Apr 20, 2004
15,819
Please get the data sheet for one and see how those functions are performed.

For that matter, reviewing the history of analog computing is about the only way to get into the accurate and reliable area.

My experience is that analog computation can be very accurate. Our ship had a Mark 119 analog fire control computer. We hit a drone once with an unguided missile at a distance of 20 miles (the missile was launched with only a correct solution off the rail).

They took a lot of upkeep,though. I was constantly adjusting the Fire Control Data Converter, essentially a digital to servo and servo to digital converter. The full alignment took 20 hours. But it worked fine when you had it tweaked up!

Digital computers work with values whose accuracy is limited by the precision of the A to D converter. But when you're up above 16 bits, the external circuitry is the source of any errors.
 

dude521

Joined Nov 1, 2008
37
Op-Amps can do all of this. Search google for op-amp integrator, differentiator. They both use capacitors to integrate or differentiate a given signal. For multiplication, you need to use a standard inverting configuration and adjust the values of the input and feedback resistors. For addition, you need to use two input resistors in parallel on the input, so the signals get added by superposition.

I don't have a lot of time to go into details right now, but these are common op-amp configurations with lots of info on the net. Note, this will all be done with analogue, not digital.
 

steveb

Joined Jul 3, 2008
2,436
Op-Amps can do all of this. Search google for op-amp integrator, differentiator. They both use capacitors to integrate or differentiate a given signal. For multiplication, you need to use a standard inverting configuration and adjust the values of the input and feedback resistors. For addition, you need to use two input resistors in parallel on the input, so the signals get added by superposition.

I don't have a lot of time to go into details right now, but these are common op-amp configurations with lots of info on the net. Note, this will all be done with analogue, not digital.
Certainly these linear operations you speak of can be done with OPAMPs, but the original question was about nonlinear operations (log, exponential, multiply divide etc). When you say multiply with OPAMPs, what you really mean is multiply by a constant which is a linear operation.

In principle you can use OPAMPS with transistors to make log-amps and exponential amps, multipliers and dividers. However, temperature effects make this not practical with discrete components. You really need an integrated chip solution using the most advanced temperature compensation techniques. Analog Devices, seems to be one of the few companies that have stayed up on this technology.

However, the OP has not provided any information on the application, nor any critical specifications such as bandwidth. So, who knows what he really needs.
 
Last edited:

leftyretro

Joined Nov 25, 2008
395
How does one do complicated mathematical operations with input/output voltage such as ln, e^x, division and multiplication with micro processors? Is there a chip that does it?
Yes, virtual any programmable microprocessor could be programmed to perform those kinds operations. If you can perform it with a handheld calculator you can be performed with a microprocessor, but only with the proper programming. So in reality the microprocessor is not really solving the problem, but rather the software language you use to tell the microprocessor what basic steps to perform to reach the end solution.

It's much like how you were taught how to do long division by hand, it's a bunch of little basic steps that ends up giving the final answer. The microprocessor performs those little basic steps but it's up to the person programming the micro to know what steps are needed to find the final answer. Some programming languages make it easier to write such programs as many already have built in high level math functions that will then convert to the instructions needed by the micro.
 

beenthere

Joined Apr 20, 2004
15,819
The principle is the same as for two. Remember that there is a practical limit to the op amp output. Adding 10 volts to 8 volts with a supply voltage of 15 volts means that the voltages have to be scaled down. The magnitude of the errors remains the same, but their effect is increased with scaling.

That is just one of the many reasons why it's easier to do the manipulations in digital form.
 
Top