Silicon ChipCircuit Surgery - November 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions: PicoLog Cloud
  5. Back Issues: PICOLOG
  6. Publisher's Letter
  7. Feature: The Fox Report by Barry Fox
  8. Feature: Techno Talk by Mark Nelson
  9. Feature: Net Work by Alan Winstanley
  10. Project: The Christmas Tree that grows! by Tim Blythman
  11. Back Issues: LFSR Random Number Generator Using Logic ICs by Tim Blythman
  12. Project: USB Digital and SPI Interface Board by Tim Blythman
  13. Project: HIGH-POWER 45V/8A VARIABLE LINEAR SUPPLY by Tim Blythman
  14. Feature: P955H PIC Training Circuit by Peter Brunning
  15. Project: Five-way LCD Panel Meter / USB Display by Tim Blythman
  16. Feature: Pedal Power Station! by Julian Edgar
  17. Feature: Make it with Micromite by Phil Boyce
  18. Feature: Circuit Surgery by Ian Bell
  19. Feature: Practically Speaking by Jake Rothman
  20. Feature: Max’s Cool Beans by Max the Magnificent
  21. Feature: AUDIO OUT by Jake Rothman
  22. PCB Order Form: DIRECT BOOK SERVICE
  23. Advertising Index

This is only a preview of the November 2020 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Circuit Surgery Regular clinic by Ian Bell Analogue multipliers T his month’s Circuit Surgery topic was suggested by PE editor Matt Pulzer and is analogue multiplication. This was partly inspired by Julian Edgar’s exercise bike project (see page 41), where measurement of output power would be a useful feature. Power is the product of current and voltage, so multiplication of a voltage and current measurements can provide a power reading. Power measurement is just one possible use of a multiplier circuit, and this article will be looking at this topic in general, not just this application. Multiplication is a mathematical operation and these days we commonly think of mathematical processing of signals as most easily performed by digital processing – signals are converted using digital-to-analogue converters and calculations are performed by microcontrollers or larger processors, depending on the application. However, mathematical operations such as multiplication, logarithms and integration can also be performed by analogue circuits. The well-known op amp (operational amplifier) gets its name because it formed the basis of analogue computers which predated digital computers. Op amp circuits can be configured to perform a variety of basic mathematical operations that can be wired together to form larger circuits which solve complex mathematical problems. Analogue computers were used in applications such as the simulation of dynamic systems (eg, aircraft) before the days of digital computer-aided design. Although op amps are often the basis of analogue circuits that perform mathematical operations, including multiplication, multiplication is a function which can also be implemented using special transistor-level circuits. In most contexts, analogue computers have been supplanted by digital ones with which we are all familiar; however, digital processing of analogue signals is not always the best approach. For example, for high-frequency signals (tens to hundreds of megahertz and 50 above), digital processing requires high-speed DACs and fast digital processing, which can be performed with similar or better performance at lower cost using analogue circuits. If the result is only needed in analogue form, then this eliminates the need for digital processing. In situations such as closed-loop control, direct analogue multiplication can provide the fast response required. If the result is needed digitally (for example to log or display information for users) then a lower-cost data conversion and processing can be used (perhaps a cheap microcontroller). Symbols, scaling and quadrants An analogue multiplier is a circuit which takes two input voltages VX and VY, and produces an output which is proportional to their product (V X × V Y). Usually there is a scaling factor involved, so we write the output as K(VX × VY) or (VX × VY)/K, where K is a constant value. Consider a multiplier circuit working on a 10V supply, with maximum signal values also of 10V. In this scenario, two inputs of 10V and a function of (VX × VY) would imply an output of 100V, which is well beyond the supply and probably impractical. If the multiplied value is divided by 10, so the function is 0.1(VX × VY) or (VX × VY)/10 then the output range is well matched to the input range. Multipliers can be represented as circuit blocks in schematics and typically have a symbol based on a box or circle with an ‘×’ inside it (see Fig.1). Last month, we discussed single-supply op amp circuits – they are convenient in terms of power supply simplicity but are not able to handle input signals of both polarities. The issue of signal polarity is important for multiplier circuits, where we have two input signals, and therefore four possible combinations of input polarities: ++, +−, −+ and −−; these are referred to as four quadrants. If you plotted the two input signals against one another on a graph the pairs of polarities would correspond to the four quarters of the graph, as divided by the axes. VX VY Vo u t = VX Vo u t = VY K = sca VX × VY K VX × VY K l e f a ct o r Fig.1. Multiplier circuit symbols For multiplier circuits we are interested in whether or not a bipolar input signal (one that can be both positive and negative) can be handled or not on each input. This leads to three cases. If both inputs are unipolar, then the circuit only operates in one of the four quadrants and the output will have fixed polarity (which could be either positive or negative). If just one of the signals can be bipolar, then the circuit operates in two of the four quadrants, and the output is bipolar (changing the sign of one term in a multiplication, but not the other, changes the sign of the result). Finally, if both inputs can be bipolar, then the circuit covers all four quadrants and has a bipolar output. Thus, multiplier circuits are classed as one, two or four-quadrant multipliers. Although four quadrants may appear to be the best option, it is not needed in all applications and circuitry may be simpler for fewer quadrants. Mixers and modulators A key application of multiplier circuits is mixers in radio circuits. The term ‘mixer’ is potentially confusing – a typical audiofrequency mixer (as in the circuitry of an analogue mixing desk) adds multiple signals, whereas a typical radio-frequency mixer multiplies two signals. The purpose of multiplicative, or frequency mixing, is to create new frequencies – typically the sum and difference of the two input frequencies. Such circuits may also be also referred to as ‘modulators’ or ‘demodulators’, depending on the application. The shifting of one frequency range to another frequency is sometimes called ‘heterodyning’, particularly in the context of radio circuits such as superheterodyne radio receivers, where received signals Practical Electronics | November | 2020 are shifted to a lower intermediate frequency to make further signal processing easier. Although often associated with radio, multiplicative mixing for frequency shifting can also be used at low frequencies, for example in chopper-stabilised amplifiers for lownoise amplification of low-frequency signals. Another use of multiplicative mixing is in lock-in amplifiers. These instruments can be used to measure very small signals (or more accurately, signals with very high noise levels) at specific frequencies (a single target frequency, so it is a homodyne, rather than a heterodyne circuit). Multiplicative mixing can be achieved without using an obvious multiplier circuit – we can simply apply the sum of two signals to a nonlinear element, typically a diode. A portion of current in the diode will be proportional to the product of the two signals. The diode’s exponential voltage-to-current relationship can be approximated by an expression including the square of the voltage – and squaring the sum of two values produces the product, among other terms. The portions of the current other than the product are small enough to be ignored, or can be filtered out as they are at different frequencies. However, the ideal frequency-shifting mixer is a perfect multiplier circuit. Consider two sinusoidal signals of frequencies f 1 and f 2 , which can be represented as a function of time by Acos(2 f 1t) and Bcos(2 f 2t), where A and B are the signal amplitudes. The 2 factor converts the ordinary frequency of the signal (f) in hertz to an angular frequency in radians. Multiplying the two signals gives: Power measurement R S E N S E P I N = VI N × I I N Frequency-shifting mixing VI N L o a d circuits are not the only VI = VI + – VI – I I N application of multipliers. In VI = I I N × R S E N S E R 2 some cases, we simply want +I –I to perform a multiplication V+ + K P VP = K P × VV × VI operation on two signal values and use the resulting value R 1 VV × VI – directly. As indicated earlier, an V– example of this is in measurement R 1 VV = VV + – VV – VV = VI N × of power. In cases where the R 1 + R 2 voltage (V) is well regulated and can be assumed to be fixed, Fig.2. Power measurement circuit concept power can be obtained simply by measuring current (I) and scaling from early in the nineteenth century, but appropriately, but if the voltage can the technique may date back to ancient then vary this approach will not provide Assyro-Babylonian mathematics. A key accurate power measurement and it will be feature of using quarter-square tables necessary to calculate I×V, or IV for short. for multiplication is the table values Power (P) is the product of voltage can be provided as whole numbers and current (P = IV), so if we have two because the fractional parts cancel voltages, one proportional to the voltage when the difference between the sum applied to a load (VV) and the other and difference quarter squares is taken. Implementing the quarter-square proportional to the current through it multiplication using op amp circuits (VI), then multiplying these voltages requires the straightforward sum, with an analogue voltage multiplier difference and scaling operations. Squaring will produce a signal (VP ) which is is trickier but can be achieved using proportional to the instantaneous piecewise approximation. The basis of a power in the load. Note that we do not circuit which can achieve this is shown in necessarily use the load voltage directly Fig.3 – this is called a piecewise function as it may not be in a range suitable for the generator or diode function generator. multiplier. Fig.2 shows how this might To simplify the explanation, we will be achieved – the current is sensed by assume an idealised diode that conducts a small resistor (RSENSE) in the supply in one direction and not the other, line – the voltage drop across this is ignoring the forward-voltage drop and VI, which is applied to a multiplier. A assuming very low resistance when the potential divider provides a proportion diode is conducting. Consider just the of the supplied voltage (VV) to the other RI1, RB1 and D1 network in Fig.3, along input of the multiplier. The differential multiplier output is converted to singlewith the op amp. For zero input voltage, ended signal and scaled by a constant the potential divider formed by RI1 and (K p) by the amplifier. This circuit is RB1, together with the reference voltage ultipliers similar to part of the LT2940 power (−Vref) set a bias voltage at VB1 of −VrefRI1/ monitor IC from Analogue Devices. (RI1 + RB1); call this voltage −Vbreak1. If we 𝐴𝐴 cos(2𝜋𝜋𝑓𝑓! 𝑡𝑡) 𝐵𝐵cos(2𝜋𝜋𝑓𝑓" 𝑡𝑡) make the assumption that Vref is a very To see the implications of this clearly in large voltage compared to VIN and Vbreak1, Quarter-square multipliers terms1of frequencies1we need to convert so that RB1 is much larger than RI1, then There are a number of ways of cos 𝛼𝛼 cos 𝛽𝛽 = cos(𝛼𝛼 − 𝛽𝛽) + cos(𝛼𝛼 + 𝛽𝛽) the product of two 2cosines to separate implementing analogue multipliers. the current in the potential divider will 2 ogue Multipliers sine or cosine functions. We can use the An approach used in old analogue not change much with varying VIN. This Analogue Multipliers prosthaphaeresis formulas – a set of four computers (for example, in the 1960s) means that VB1 will track VIN, starting 𝐴𝐴 cos(2𝜋𝜋𝑓𝑓 " 𝑡𝑡) 𝐴𝐴𝐵𝐵 𝐴𝐴𝐵𝐵 ! 𝑡𝑡) 𝐵𝐵cos(2𝜋𝜋𝑓𝑓 trigonometric identities, of which we need: was to use quarter-square multipliers. at −Vbreak1 for VIN = 0 and increasing by 𝐴𝐴 cos(2𝜋𝜋𝑓𝑓 𝑡𝑡) 𝐵𝐵cos(2𝜋𝜋𝑓𝑓 𝑡𝑡) ! " nalogue Multipliers cos(2𝜋𝜋(𝑓𝑓! − 𝑓𝑓" )𝑡𝑡) + cos(2𝜋𝜋(𝑓𝑓! + 𝑓𝑓" )𝑡𝑡) 2 2 The quarter-square function is just what an amount equal to VIN as VIN becomes 𝐴𝐴 cos(2𝜋𝜋𝑓𝑓! 𝑡𝑡) 𝐵𝐵cos(2𝜋𝜋𝑓𝑓" 𝑡𝑡) is says on the tin – the square of a value more positive. 1 1 1 by four. For 1 example, cos 𝛼𝛼 cos 𝛽𝛽 = cos(𝛼𝛼 − 𝛽𝛽) + cos(𝛼𝛼 + 𝛽𝛽) divided cos 𝛼𝛼 cos 𝛽𝛽 = cos(𝛼𝛼 − 𝛽𝛽) + cos(𝛼𝛼 + 𝛽𝛽) (𝑥𝑥 + 𝑥𝑥)" 2 (𝑥𝑥 − 𝑥𝑥)" 2 2 the quarter square 2of x is x2/4. 𝑥𝑥𝑥𝑥 = 4 6 1− 4 6 1 R I1 R F D 1 VB 1 4 4 cos 𝛼𝛼 cos 𝛽𝛽 = cos(𝛼𝛼 − 𝛽𝛽) + cos(𝛼𝛼 + 𝛽𝛽) Applying this2 to the multiplied signal If you have two values, x and 2 expression gives: 𝐴𝐴𝐵𝐵 𝐴𝐴𝐵𝐵 y, you can multiply them using VI N 𝐴𝐴𝐵𝐵 cos(2𝜋𝜋(𝑓𝑓! − 𝑓𝑓" )𝑡𝑡) + cos(2𝜋𝜋(𝑓𝑓! + 𝑓𝑓𝐴𝐴𝐵𝐵 " )𝑡𝑡) cos(2𝜋𝜋(𝑓𝑓 − 𝑓𝑓" )𝑡𝑡) + cos(2𝜋𝜋(𝑓𝑓 𝑓𝑓" )𝑡𝑡) – the !quarter square of their ! +sum VO U T 2 2 R B 1 2 2 𝑥𝑥𝑥𝑥𝐴𝐴𝐵𝐵 = antilog[log(𝑥𝑥) + log(𝑥𝑥)] 𝐴𝐴𝐵𝐵 and difference: 2 cos(2𝜋𝜋(𝑓𝑓! − 𝑓𝑓" )𝑡𝑡) + (𝑥𝑥 + 𝑥𝑥)" 2 cos(2𝜋𝜋(𝑓𝑓! + 𝑓𝑓" )𝑡𝑡) (𝑥𝑥 − 𝑥𝑥)" 𝑥𝑥𝑥𝑥 = 4 6−4 6 This𝐼𝐼 shows multiplied signal 4𝑉𝑉𝐵𝐵𝐵𝐵 4 consists 𝐶𝐶 = 𝐼𝐼𝑆𝑆 exp (𝑥𝑥?+𝑉𝑉𝑥𝑥)"<at> (𝑥𝑥 − 𝑥𝑥)" of the 𝑥𝑥𝑥𝑥 sum difference = 4 (f 1 +𝑇𝑇 f62 )−and 4 6 4 4 the same (f1 − f2) frequencies. Using trigonometric identities and a little 𝑥𝑥𝑥𝑥 = antilog[log(𝑥𝑥) + log(𝑥𝑥)] 𝑑𝑑𝐼𝐼𝐶𝐶 it can 𝐼𝐼𝑆𝑆 be shown 𝑉𝑉𝐵𝐵𝐵𝐵 that 𝐼𝐼𝐶𝐶 if one input algebra, 𝑥𝑥𝑥𝑥 𝑔𝑔# = = = antilog[log(𝑥𝑥) exp ? <at> =+ log(𝑥𝑥)] is𝑑𝑑𝑉𝑉 equal 1+Acos(2 𝑉𝑉𝑇𝑇f1t), then 𝑉𝑉𝑇𝑇 the output 𝐵𝐵𝐵𝐵 to𝑉𝑉 𝑇𝑇 also includes that original 𝑉𝑉𝐵𝐵𝐵𝐵 frequency. 𝐼𝐼𝐶𝐶 = 𝐼𝐼𝑆𝑆 exp ? <at> 𝑉𝑉𝑉𝑉𝐵𝐵𝐵𝐵 𝑇𝑇 𝐼𝐼 = 𝐼𝐼 exp ? <at> 𝐶𝐶 𝑆𝑆 | November | 2020 Practical Electronics 𝑉𝑉𝑇𝑇 𝑑𝑑𝐼𝐼𝐶𝐶 𝐼𝐼𝑆𝑆 𝑉𝑉𝐵𝐵𝐵𝐵 𝐼𝐼𝐶𝐶 𝑔𝑔# = 𝑑𝑑𝐼𝐼 = 𝐼𝐼 exp ?𝑉𝑉 <at> = 𝐼𝐼 𝐶𝐶 𝑆𝑆 𝐵𝐵𝐵𝐵 𝐶𝐶 𝑑𝑑𝑉𝑉 𝑉𝑉 𝑉𝑉 𝑉𝑉 𝑔𝑔 = 𝐵𝐵𝐵𝐵 = 𝑇𝑇 exp ? 𝑇𝑇 <at> = 𝑇𝑇 # 𝑑𝑑𝑉𝑉𝐵𝐵𝐵𝐵 𝑉𝑉𝑇𝑇 𝑉𝑉𝑇𝑇 𝑉𝑉𝑇𝑇 𝑥𝑥𝑥𝑥 = 4 (𝑥𝑥 + 𝑥𝑥)" (𝑥𝑥 − 𝑥𝑥)" 6−4 6 4 4 Try it with x = 4 and y = 5. 𝑥𝑥𝑥𝑥 = antilog[log(𝑥𝑥) + log(𝑥𝑥)] Quarter square tables were used + R – VR E F VB 2 I2 R D 2 B 2 – VR E F by people in a similar way to tables of logarithms; tables of 𝑉𝑉𝐵𝐵𝐵𝐵 published Fig.3. Diode function generator example quarter 𝐼𝐼𝐶𝐶 =squares 𝐼𝐼𝑆𝑆 exp ?were <at> 𝑉𝑉𝑇𝑇 𝑔𝑔# = 𝑑𝑑𝐼𝐼𝐶𝐶 𝐼𝐼 𝑉𝑉 𝐼𝐼 = 𝑆𝑆 exp ? 𝐵𝐵𝐵𝐵 <at> = 𝐶𝐶 𝑑𝑑𝑉𝑉𝐵𝐵𝐵𝐵 𝑉𝑉𝑇𝑇 𝑉𝑉𝑇𝑇 𝑉𝑉𝑇𝑇 51 gains. More input networks can be added to more accurately shape the function. 0 1 2 3 4 5 6 VO U T The circuit in Fig.3 has a single input, but more than one input can be – 2 B r e a kp o i n t B r e a kp o i n t connected to each diode via separate V b r e a k2 – 4 V b r e a k1 resistors, as shown in Fig.5 (this shows – 6 just one diode network, but more can be added). This creates a circuit similar to – 8 a standard op amp summing amplifier, – 1 0 but with the piecewise linear function VI N shaping the response, as just discussed. For example, if the function curve was set to follow a square law, then two Fig.4. Diode function generator example of inputs (say VX and VY) on equal resistors input-output relationship. would give an output proportional to Analogue Multipliers (VX + VY)2. If VY was passed through a When VIN is at or below +Vbreak1 then unity-gain before 𝐴𝐴 cos(2𝜋𝜋𝑓𝑓!inverting 𝑡𝑡) 𝐵𝐵cos(2𝜋𝜋𝑓𝑓amplifier " 𝑡𝑡) being applied to this circuit (to obtain D1 is reverse-biased (not conducting) −VY) the output would be (VX − VY)2. and the input is disconnected from the op amp. The op amp output will be These are required to 1 the two functions 1 cos 𝛼𝛼 cos 𝛽𝛽 = cos(𝛼𝛼 − 𝛽𝛽) + cos(𝛼𝛼 multiplier. + 𝛽𝛽) zero. Once VIN rises above +Vbreak1 the implement 2 a quarter-square 2 voltage across the diode will rise above zero and it will conduct. This connects Log/antilog multipliers 𝐴𝐴𝐵𝐵 tables of logarithms the input to the op amp via RIN1, so 𝐴𝐴𝐵𝐵 we As mentioned above, )𝑡𝑡) cos(2𝜋𝜋(𝑓𝑓 − 𝑓𝑓" )𝑡𝑡) + used cos(2𝜋𝜋(𝑓𝑓 ! + 𝑓𝑓"perform have an inverting amplifier with gain were! commonly to help 2 2 RF/RIN1. Thus for VIN below +Vbreak1 the calculations until the pocket calculator became widely available. To multiply x output is zero, and above this it is –(RF/ " (𝑥𝑥 + 𝑥𝑥) (𝑥𝑥 − we 𝑥𝑥)" find the sum and y with logarithms RIN1)VIN. Vbreak is so named because it 𝑥𝑥𝑥𝑥 = 4 6−4 6 of the log 4 of x and the 4log of y, and then represents a breakpoint in the inputtake the antilog of the result: output characteristic of the circuit. Now consider the second input network, RI2, RB2 and D2. This works 𝑥𝑥𝑥𝑥 = antilog[log(𝑥𝑥) + log(𝑥𝑥)] in the same way as the first. If we set In circuit terms, this translates to the +Vbreak2 to a value larger than +Vbreak1 block schematic 𝑉𝑉shown in Fig.6. The then the circuit will operate as described 𝐼𝐼𝐶𝐶 = amplifier 𝐼𝐼𝑆𝑆 exp ? 𝐵𝐵𝐵𝐵is<at>a well-known op summing above until VIN reaches +Vbreak2. At this 𝑉𝑉𝑇𝑇 amp circuit. It is also possible to build point D2 will also connect, so VIN will log and antilog circuits using op amps. be connected to the op amp by both RI1 The basic forms and RI2. Now the inverting amplifier has 𝑑𝑑𝐼𝐼most 𝐼𝐼 𝑉𝑉 of log𝐼𝐼𝐶𝐶and antilog 𝐶𝐶 = = 𝑆𝑆 shown exp ? 𝐵𝐵𝐵𝐵 <at>Fig.7 = and Fig.8. an effective input resistance equal to the 𝑔𝑔#amplifiers 𝑑𝑑𝑉𝑉𝐵𝐵𝐵𝐵 are 𝑉𝑉𝑇𝑇 𝑉𝑉in 𝑉𝑉𝑇𝑇 𝑇𝑇 These circuits use the exponential (exp) parallel combination of RI1 and RI2, so the relationship between the applied voltage gain of the circuit will increase – there is and current in a diode.. The exponential a second breakpoint in the characteristic. function (exp(x) = ex) is the antilog of the Fig.4 shows an example plot of VOUT against VIN. +Vbreak1 is 1V, below this the natural (base e) logarithm (ln). It follows that the voltage drop across a diode is gain is zero and the output is constant proportional to the natural logarithm of at 0V. Above +Vbreak1 the gain is 1; a 3V the current through it. input change from 1V to 4V results in For the log amplifier (Fig.6) the input a 3V output change from 0 to −3V. The voltage causes a current to flow in the second breakpoint is at 4V, where the resistor R1. Assuming an ideal op amp, gain increases to 3.5; a 2V input change the inverting input behaves like ground from 4V to 6V results in a 7V output in this circuit, so the current is VIN/R1. change from −3V to −10V. The circuit in Fig.3 forms the basis For an ideal op amp, which has zero bias of creating a customised input-output current and infinite input impedance, relationship which can be fitted to a all of this current flows into the diode. mathematical function such as squaring The output voltage is equal to the diode by suitable choice of breakpoints and voltage, which is proportional to the R VX R IN VB VY R IN R B D 1 – R 1 VI N – VO U T + Fig.7. Diode logarithmic amplifier. R 1 VI N D 1 – VO U T + Fig.8. Diode exponential/antilog amplifier. natural log of the current in the diode, which is in turn proportional to the input voltage – so the output voltage is proportional to the natural logarithm of the input voltage. For the exponential/antilog amplifier a similar argument shows that the diode current is proportional to the exponential of the input voltage. All of this current flows in the resistor (R1), so the voltage drop across the resistor is proportional to the exponential of the input voltage and the voltage drop across R1 is equal to the output voltage. Log and antilog amplifiers often use transistors instead of diodes and may be much more sophisticated than the circuits shown here. They are interesting and useful circuits and we hope to look at them in more detail in a future article. However, as far as multipliers are concerned, they are not the best option. Transistor multiplier circuits Although the op amp circuits described above can implement multiplication the best approach is to use circuits which implement the multiplication more directly with a few transistors. A widely used circuit is called a ‘Gilbert cell’ multiplier after it’s inventor Barrie Gilbert, who published it in 1967. In fact, a variety of circuits can be based on the same principle which Gilbert termed ‘translinear’ circuits because they are based on the linear dependence F VX L o g a m p lifie r l n ( VX ) VO U T + – VR E F Fig.5. Diode function generator with summed inputs. 52 D 1 S u m m in g a m p lifie r VY L o g a m p lifie r l n ( VY ) l n ( VX VY ) * A n tilo g a m p lifie r VX VY * N o t e : l n ( VX VY ) = l n ( VX ) + l n ( VY ) Fig.6. Block diagram of multiplier based on log and antilog amplifiers. Practical Electronics | November | 2020 This shows that if we apply an input voltage directly to a transistor then the output current will be proportional to IC/VT times the input voltage. If IC is controlled by a second input voltage, then the output will be proportional to the product of the two voltages. A possible implementation of this idea is shown in Fig.9. This is based on the differential amplifier, + V C C which we discussed in detail recently (September 2020) – R 1 R 2 it is suggested that you read VO U T this first if you are not already familiar with these circuits. In place of the fixed current Q 1 Q 2 Q 3 Q 4 source, which would usually provide the operating current VI N to the emitters of Q1 and Q2 we have Q3 and R3, which are driven by input voltage IE 1 IE 2 VY. If the value of R3 is such the voltage dropped across it is much larger than the VBE of Q3, then the emitter current Fig.10. Cross-coupled differential amplifiers. supplied to the differential pair (I E ) will be proportional to V Y VOUT. The more different the bias currents (note that IE = VY/R3). The output of are, the greater the output change will be. More specifically, the circuit behaves the differential pair with respect to as a differential amplifier whose gain is V X is g m V X . As just discussed, g m is proportional to the difference between proportional to this bias current (I E I E1 and I E2. The gain can be positive in this case, specifically gm = IE/2VT, the factor 2 arises because I E splits or negative, depending on which bias current is larger. between the transistors), so the output To complete the voltage multiplier, is proportional to VXVY, and thus the we need a circuit to convert a voltage circuit acts as voltage multiplier. to a current difference – this is exactly The circuit in Fig.9 has a number what a differential amplifier does, so we of deficiencies, which means that it is just need another differential amplifier not a particularly good multiplier. For added to the circuit in Fig.10 to make example, the output depends on VT and a multiplier. This circuit is shown in so it depends on temperature, and VBE Fig.11. The output voltage (V OUT) is drops cause offsets, which vary with input voltage. The Gilbert cell multiplier proportional to V X V Y. This circuit, overcomes these problems and provides or variations of it, is widely used in a much more linear and temperature integrated circuits. independent output. Analogue mathematical operations can be built with discrete op-amp or transistor circuits, but there are also ICs Gilbert cell multiplier available which perform multiplication, Before looking at the full multiplier, and which are likely to deliver higher consider the circuit in Fig.10. This is performance than discrete versions. a pair of cross-connected differential One example is the AD835 250MHz, amplifiers sharing load resistors. Assume Voltage Output 4-Quadrant Multiplier bias currents IE1 and IE2 are equal. The from Analog Devices. two differential amplifiers operate normally, that is a non-zero input voltage difference + V C C (V IN) will cause the bias to split unequally between R 1 R 2 the transistors in the pair, VO U T which normally results in a change in output voltage. However, here the two pairs Q 1 Q 2 Q 3 Q 4 are cross-connected and share resistors, so the effect of each – VX pair on the resistor currents will be equal and opposite. IE 1 IE 2 Therefore, changes in input Q 5 Q 6 voltage have no effect on the output (the output difference, VOUT on Fig.10, remains zero, – VY irrespective of VIN). If the two bias currents in the IE E circuit in Fig.10 are not equal, then the output currents from + V C C the two differential pairs will not exactly cancel and a change in VIN will result in a change of Fig.11. Gilbert cell multiplier. Practical Electronics | November | 2020 53 + V C C R 1 R 2 VO U T – Q 1 + + Q 2 VX – Q 3 + VY pliers R 3 IE – 𝐴𝐴 cos(2𝜋𝜋𝑓𝑓! 𝑡𝑡) 𝐵𝐵cos(2𝜋𝜋𝑓𝑓" 𝑡𝑡) Fig.9. on a variable 1 Multiplier based 1 cos 𝛼𝛼 cos 𝛽𝛽 = cos(𝛼𝛼 − 𝛽𝛽) + cos(𝛼𝛼 + 𝛽𝛽) transconductance 2 2 differential amplifier. of transistor transconductance on 𝐴𝐴𝐵𝐵 𝐴𝐴𝐵𝐵 cos(2𝜋𝜋(𝑓𝑓!operating − 𝑓𝑓" )𝑡𝑡) + current. cos(2𝜋𝜋(𝑓𝑓! + 𝑓𝑓" )𝑡𝑡) 2 2 We discussed the basics of bipolar transistors in Circuit Surgery in July and 2019, which may be helpful " (𝑥𝑥 +August (𝑥𝑥 − 𝑥𝑥) 𝑥𝑥)" 𝑥𝑥𝑥𝑥 =if4 ideas such 6 − 4 as operating 6 point in the 4 4 following discussion are not familiar. The collector current of a bipolar transistor is related 𝑥𝑥𝑥𝑥 = antilog[log(𝑥𝑥) + log(𝑥𝑥)]to the base-emitter voltage by the equation: gue Multipliers 𝑉𝑉 𝐼𝐼𝐶𝐶 = 𝐼𝐼𝑆𝑆 exp ? 𝐵𝐵𝐵𝐵 <at> 𝑉𝑉𝑇𝑇 Here, I S is the base-emitter junction 𝐴𝐴 cos(2𝜋𝜋𝑓𝑓! 𝑡𝑡) 𝐵𝐵cos(2𝜋𝜋𝑓𝑓" 𝑡𝑡) 𝑑𝑑𝐼𝐼 𝐼𝐼 𝑉𝑉 𝐼𝐼 V is the thermal saturation current and 𝐶𝐶 𝑔𝑔# = = 𝑆𝑆 exp ? 𝐵𝐵𝐵𝐵 <at> = 𝐶𝐶 T 𝑑𝑑𝑉𝑉 𝑉𝑉𝑇𝑇 – parameters 𝑉𝑉𝑇𝑇 𝑉𝑉𝑇𝑇 which occurs voltage 𝐵𝐵𝐵𝐵 in many 1semiconductor equations. 1 cosThe 𝛼𝛼 cosgain 𝛽𝛽 = cos(𝛼𝛼 − 𝛽𝛽) + cos(𝛼𝛼 +in 𝛽𝛽)terms 2 of the transistor 2 of input-voltage to output-current is called ‘transconductance’ (symbol 𝐴𝐴𝐵𝐵 g ). This varies𝐴𝐴𝐵𝐵with the operating m cos(2𝜋𝜋(𝑓𝑓 cos(2𝜋𝜋(𝑓𝑓! + 𝑓𝑓" )𝑡𝑡) ! − 𝑓𝑓" )𝑡𝑡) + 2 point (bias value2 of I C). We can find the transconductance graphically by plotting (𝑥𝑥 IC + against V finding the (𝑥𝑥BE−and 𝑥𝑥)" 𝑥𝑥)" 𝑥𝑥𝑥𝑥 =of 4 the graph 6 − 4 at the6 operating slope 4 4 point. We do the same algebraically by differentiating IC with respect to VBE. If you studied+calculus 𝑥𝑥𝑥𝑥 =have antilog[log(𝑥𝑥) log(𝑥𝑥)] you will know (or may recall) that differentiating exp(kx), where k is a constant gives kexp(kx). After differentiating the above 𝑉𝑉𝐵𝐵𝐵𝐵 = 𝐼𝐼𝑆𝑆 exp ? for <at> we can𝐼𝐼𝐶𝐶substitute 𝑉𝑉𝑇𝑇 the expression for IC into the result to get gm = IC/VT: 𝑔𝑔# = 𝑑𝑑𝐼𝐼𝐶𝐶 𝐼𝐼 𝑉𝑉 𝐼𝐼 = 𝑆𝑆 exp ? 𝐵𝐵𝐵𝐵 <at> = 𝐶𝐶 𝑑𝑑𝑉𝑉𝐵𝐵𝐵𝐵 𝑉𝑉𝑇𝑇 𝑉𝑉𝑇𝑇 𝑉𝑉𝑇𝑇 Simulation files