2234 views|0 replies

3836

Posts

19

Resources
The OP
 

What is an adder? What is an inverting adder? [Copy link]

1. What is an adder?
An adder is used to perform addition.

That is, it is a device that generates the sum of numbers. A device that takes the addend and the augend as input, and the sum and the carry as output is a half adder. If the addend, the augend, and the carry in the lower position are inputs, and the sum and the carry are outputs, it is a full adder. It is often used as a computer arithmetic logic unit to perform logical operations, shifts, and instruction calls.

For 1-bit binary addition, there are five related quantities: 1, addend A, 2, addend B, 3, the carry of the previous bit CIN, 4, the sum S of the two numbers in this bit, and 5, the carry COUT generated by the addition of the two numbers in this bit. The first three quantities are input quantities, and the last two quantities are output quantities. All five quantities are 1 bit.

For 32-bit binary addition, there are also five related quantities: 1, addend A (32 bits), 2, addend B (32 bits), 3, carry CIN of the previous bit (1 bit), 4, sum S of the two numbers added at this bit (32 bits), 5, carry COUT generated by the addition of the two numbers at this bit (1 bit).

To implement 32-bit binary addition, a natural idea is to repeat the 1-bit binary addition 32 times (i.e., a bit-by-bit carry adder). This is undoubtedly feasible and easy to do, but since each bit of CIN is provided by the previous bit of COUT, the second bit must be calculated after the result of the first bit is calculated before it can be calculated; the third bit must be calculated after the result of the second bit is calculated before it can be calculated, and so on. And the last 32nd bit must be calculated after all the results of the first 31 bits are calculated before it can be calculated. This method makes the time required to implement 32-bit binary addition 32 times the time required to implement 1-bit binary addition.

From the basic method
, it can be seen that the above method performs 32-bit addition serially one bit at a time. To shorten the time of the process, we should try to make the above process parallel.

Types

For the adder with a single unit, there are two basic types: half adder and full adder.

Half adder has two inputs and two outputs. The input can be marked as A, B or X, Y, and the output is usually marked as sum S and base C. A and B are S after XOR operation and C after AND operation.

Full adder introduces the input of base value to calculate larger numbers. To distinguish the two base lines of the full adder, the input end is marked as Ci or Cin, and the output end is marked as Co or Cout. Half adder is abbreviated as HA, and full adder is abbreviated as FA.
Half adder: Circuit diagram of half adder Half adder has two binary inputs, which adds the input values and outputs the result to the sum (Sum) and base (Carry). Although the half adder can generate binary values, it cannot process binary values by itself.

Full adder: One of the three binary inputs of the full adder is a binary input, so the full adder can process binary values. A full adder can be composed of two half adders.

Note that the last OR gate at the binary output can also be replaced by an XOR gate without changing the rest of the parts. This is because the OR gate and the XOR gate are different only when the inputs are all 1, and this possibility no longer exists.

2. Adder Principle
Suppose the i-th input of an n-bit adder is ai, bi, ci, and the output is si and ci+1, where ci is the carry from the low bit, ci+1 (i=n-1, n-2, ..., 1, 0) is the carry to the high bit, c0 is the carry input of the entire adder, and cn is the carry output of the entire adder. Then the sum

si=aiii+ibii+iici+aibici, (1) carry ci+1=aibi+aici+bici, (2)
let gi=aibi, (3)

pi=ai+bi, (4)

Then ci+1= gi+pici, (5)
As long as aibi=1, a carry to the i+1 position will be generated, and g is called the carry generation function; similarly, as long as ai+bi=1, ci will be transferred to the i+1 position, so p is called the carry transfer function. Expanding equation (5), we get: ci+1= gi+ pigi-1+pipi-1gi-2+…+ pipi-1…p1g0+ pipi-1…p0c0(6).

As the number of bits increases, equation (6) will become longer, but the depth of three logic levels will always be maintained, so the delay of forming a carry is a constant that is independent of the number of bits. Once the carry (c1~cn-1) is calculated, the sum can be obtained from equation (1).

The adder that uses the above formula to generate all carries in parallel is a carry-lookahead adder. Generating gi and pi requires one gate delay, ci requires two levels, and si requires two levels, for a total of five gate delays. Compared with the series adder (generally requiring 2n levels of gate delay), the delay time of the carry-lookahead adder is greatly shortened (especially when n is relatively large).

3. Inverting adder equivalent schematic diagram
The inverting adder circuit, also known as the inverting summing circuit, refers to more than one input signal entering the inverting input terminal, and the output result is the absolute value of the sum of multiple signals (the voltage polarity is opposite). As shown in the circuit a in the figure, when R1=R2=R3=R4, its output voltage = the absolute value of IN1+IN2+IN3, which constitutes an inverting adder circuit. When R4>R1, the circuit also has the function of signal amplification.

Figure 2. Inverting adder and equivalent principle diagram


The basic circuit structure of the inverting adder is an inverting amplifier. From its "virtual ground" characteristics, it can be seen that both input terminals are at 0V ground potential. This determines the control purpose of the circuit, which is to make the potential of the inverting input terminal 0V (the target value of the non-inverting input terminal is 0V). Taking the circuit parameters and input signal values of the circuit in Figure a as an example for analysis, the equivalent diagram shown in Figure b above can be obtained. The bias circuit of the inverting adder is still a series voltage division circuit overall, but the input circuit involves the circuit principle of resistor parallel shunt, which can be listed as follows: IR4=IR1+IR2+IR3. The "secret" of the inverting adder is thus revealed.

Since the inverting input terminal is at the ground potential of 0V, when the input signal IN3=0V, no signal current is generated in this branch, which is equivalent to no signal input, thus becoming IN1+IN2=-OUT. When IR1 (1V/10k) = 0.1mA, IR2 (1V/10k) = 0.1mA, only when the OUT output is -2V, the condition of IR4 = IR1 + IR2 is satisfied.

If the principle equivalent diagram is further simplified (see circuit c in the figure), a very familiar figure will come into our mind: Isn't this an inverting amplifier circuit? Yes, that's right, the inverting summation (inverting adder) circuit is an inverting (including amplification and attenuation) device. In practical

applications, due to the obvious defects of the in-phase adder, due to the extremely high input impedance, the signal input current can only form a loop through multiple IN terminals (which will cause the input signal voltage to be involved and change, resulting in large calculation errors). Unless the internal resistance of various IN signal sources is very small, it will not affect the calculation accuracy. Therefore, it is less used. The inverting summing circuit has a very low input impedance due to its "virtual ground" characteristics, which allows the input currents of various signals to enter the input terminal in a "convergence mode" and does not cause current flow between the input signals. Therefore, it can ensure the accuracy of calculation and has many applications.

4. Inverting adder circuit and principle (Figure)

This post is from Analogue and Mixed Signal

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list