Adder (electronics)

Short description: Digital circuit that produces sums from inputs

An adder, or summer,[1] is a digital circuit that performs addition of numbers. In many computers and other kinds of processors, adders are used in the arithmetic logic units (ALUs). They are also used in other parts of the processor, where they are used to calculate addresses, table indices, increment and decrement operators and similar operations.

Although adders can be constructed for many number representations, such as binary-coded decimal or excess-3, the most common adders operate on binary numbers. In cases where two's complement or ones' complement is being used to represent negative numbers, it is trivial to modify an adder into an adder–subtractor. Other signed number representations require more logic around the basic adder.

## Contents

* 1 History
* 2 Binary adders
* 2.1 Half adder
* 2.2 Full adder
* 2.3 Adders supporting multiple bits
* 2.3.1 Ripple-carry adder
* 2.3.2 Carry-lookahead adder
* 2.3.3 Carry-save adders
* 2.4 3:2 compressors
* 3 Quantum adders
* 4 Analog adders
* 5 See also
* 6 References
* 7 Further reading
* 8 External links

## History

In 1937, Claude Shannon demonstrated binary addition in his graduate thesis at MIT.[2]

## Binary adders

### Half adder

The half adder adds two single binary digits A and B. It has two outputs, sum (S) and carry (C). The carry signal represents an overflow into the next digit of a multi-digit addition. The value of the sum is 2C+S. The simplest half-adder design, pictured on the right, incorporates an XOR gate for S and an AND gate for C. The Boolean logic for the sum (in this case S) will be A⊕B whereas for the carry (C) will be A⋅B. With the addition of an OR gate to combine their carry outputs, two half adders can be combined to make a full adder.[3] The half adder adds two input bits and generates a carry and sum, which are the two outputs of a half adder. The input variables of a half adder are called the augend and addend bits. The output variables are the sum and carry.

The truth table for the half adder is:

Inputs | Outputs

|

A | B | Cout | S
0 | 0 | 0 | 0
0 | 1 | 0 | 1
1 | 0 | 0 | 1
1 | 1 | 1 | 0

Various half adder digital logic circuits:

* Half adder in action.

* Schematic of half adder implemented with one XOR gate and one AND gate.

* Schematic of half adder implemented with five NAND gates.

* Error creating thumbnail: Unable to save thumbnail to destination

Schematic symbol for a 1-bit half adder.

### Full adder

A full adder adds binary numbers and accounts for values carried in as well as out. A one-bit full-adder adds three one-bit numbers, often written as A, B, and Cin; A and B are the operands, and Cin is a bit carried in from the previous less-significant stage.[4] The full adder is usually a component in a cascade of adders, which add 8, 16, 32, etc. bit binary numbers. The circuit produces a two-bit output. Output carry and sum are typically represented by the signals Cout and S, where the sum equals 2Cout+S.

A full adder can be implemented in many different ways such as with a custom transistor-level circuit or composed of other gates. The most common implementation is with:

S=A⊕B⊕Cin
Cout=(A⋅B)+(Cin⋅(A⊕B))

The above expressions for S and Cin can be derived from using a Karnaugh map to simplify the truth table.

In this implementation, the final OR gate before the carry-out output may be replaced by an XOR gate without altering the resulting logic. This is because when A and B are both 1, the term (A⊕B) is always 0, and hence (Cin⋅(A⊕B)) can only be 0. Thus, the inputs to the final OR gate can never be both 1's (this is the only combination for which the OR and XOR outputs differ).

Due to the functional completeness property of the NAND and NOR gates, a full adder can also be implemented using nine NAND gates,[5] or nine NOR gates.

Using only two types of gates is convenient if the circuit is being implemented using simple integrated circuit chips which contain only one gate type per chip.

A full adder can also be constructed from two half adders by connecting A and B to the input of one half adder, then taking its sum-output S as one of the inputs to the second half adder and Cin as its other input, and finally the carry outputs from the two half-adders are connected to an OR gate. The sum-output from the second half adder is the final sum output (S) of the full adder and the output from the OR gate is the final carry output (Cout). The critical path of a full adder runs through both XOR gates and ends at the sum bit S. Assumed that an XOR gate takes 1 delays to complete, the delay imposed by the critical path of a full adder is equal to:

TFA=2⋅TXOR=2D

The critical path of a carry runs through one XOR gate in adder and through 2 gates (AND and OR) in carry-block and therefore, if AND or OR gates take 1 delay to complete, has a delay of:

Tc=TXOR+TAND+TOR=D+D+D=3D

The truth table for the full adder is:

Inputs | Outputs

|

A | B | Cin | Cout | S
0 | 0 | 0 | 0 | 0
0 | 0 | 1 | 0 | 1
0 | 1 | 0 | 0 | 1
0 | 1 | 1 | 1 | 0
1 | 0 | 0 | 0 | 1
1 | 0 | 1 | 1 | 0
1 | 1 | 0 | 1 | 0
1 | 1 | 1 | 1 | 1

Inverting all inputs of a full adder also inverts all of its outputs, which can be used in the design of fast ripple-carry adders, because there is no need to invert the carry.[6]

Various full adder digital logic circuits:

* Full adder in action.

* Schematic of full adder implemented with two XOR gates, two AND gates, one OR gate.

* Schematic of full adder implemented with nine NAND gates.

* Schematic of full adder implemented with nine NOR gates.

* Error creating thumbnail: Unable to save thumbnail to destination

Full adder with inverted outputs with single-transistor carry propagation delay in CMOS[6]

* Schematic symbol for a 1-bit full adder with Cin and Cout drawn on sides of block to emphasize their use in a multi-bit adder

### Adders supporting multiple bits

#### Ripple-carry adder

4-bit adder with logical block diagram shown Decimal 4-digit ripple carry adder. FA = full adder, HA = half adder.

It is possible to create a logical circuit using multiple full adders to add N-bit numbers. Each full adder inputs a Cin, which is the Cout of the previous adder. This kind of adder is called a ripple-carry adder (RCA), since each carry bit "ripples" to the next full adder. Note that the first (and only the first) full adder may be replaced by a half adder (under the assumption that Cin=0).

The layout of a ripple-carry adder is simple, which allows fast design time; however, the ripple-carry adder is relatively slow, since each full adder must wait for the carry bit to be calculated from the previous full adder. The gate delay can easily be calculated by inspection of the full adder circuit. Each full adder requires three levels of logic. In a 32-bit ripple-carry adder, there are 32 full adders, so the critical path (worst case) delay is 3 (from input to carry in first adder) + 31 × 2 (for carry propagation in latter adders) = 65 gate delays.[7] The general equation for the worst-case delay for a n-bit carry-ripple adder, accounting for both the sum and carry bits, is:

TCRA(n)=THA+(n−1)⋅Tc+Ts=TFA+(n−1)⋅Tc=3D+(n−1)⋅2D=(2n+1)⋅D

A design with alternating carry polarities and optimized AND-OR-Invert gates can be about twice as fast.[8][6]

#### Carry-lookahead adder

4-bit adder with carry lookahead 64-bit adder with carry lookahead

To reduce the computation time, engineers devised faster ways to add two binary numbers by using carry-lookahead adders (CLA). They work by creating two signals (P and G) for each bit position, based on whether a carry is propagated through from a less significant bit position (at least one input is a 1), generated in that bit position (both inputs are 1), or killed in that bit position (both inputs are 0). In most cases, P is simply the sum output of a half adder and G is the carry output of the same adder. After P and G are generated, the carries for every bit position are created. Some advanced carry-lookahead architectures are the Manchester carry chain, Brent–Kung adder (BKA),[9] and the Kogge–Stone adder (KSA).[10][11]

Some other multi-bit adder architectures break the adder into blocks. It is possible to vary the length of these blocks based on the propagation delay of the circuits to optimize computation time. These block based adders include the carry-skip (or carry-bypass) adder which will determine P and G values for each block rather than each bit, and the carry-select adder which pre-generates the sum and carry values for either possible carry input (0 or 1) to the block, using multiplexers to select the appropriate result when the carry bit is known.

By combining multiple carry-lookahead adders, even larger adders can be created. This can be used at multiple levels to make even larger adders. For example, the following adder is a 64-bit adder that uses four 16-bit CLAs with two levels of lookahead carry units.

Other adder designs include the carry-select adder, conditional sum adder, carry-skip adder, and carry-complete adder.

#### Carry-save adders

Main article: Carry-save adder

If an adding circuit is to compute the sum of three or more numbers, it can be advantageous to not propagate the carry result. Instead, three-input adders are used, generating two results: a sum and a carry. The sum and the carry may be fed into two inputs of the subsequent 3-number adder without having to wait for propagation of a carry signal. After all stages of addition, however, a conventional adder (such as the ripple-carry or the lookahead) must be used to combine the final sum and carry results.

### 3:2 compressors

A full adder can be viewed as a 3:2 lossy compressor: it sums three one-bit inputs and returns the result as a single two-bit number; that is, it maps 8 input values to 4 output values. Thus, for example, a binary input of 101 results in an output of 1 + 0 + 1 = 10 (decimal number 2). The carry-out represents bit one of the result, while the sum represents bit zero. Likewise, a half adder can be used as a 2:2 lossy compressor, compressing four possible inputs into three possible outputs.

Such compressors can be used to speed up the summation of three or more addends. If the number of addends is exactly three, the layout is known as the carry-save adder. If the number of addends is four or more, more than one layer of compressors is necessary, and there are various possible designs for the circuit: the most common are Dadda and Wallace trees. This kind of circuit is most notably used in multiplier circuits, which is why these circuits are also known as Dadda and Wallace multipliers.

## Quantum adders

Quantum full adder, using Toffoli and CNOT gates. The CNOT-gate that is surrounded by a dotted square in this picture can be omitted if uncomputation to restore the B output is not required.

Using only the Toffoli and CNOT quantum logic gates, it is possible to produce quantum full- and half-adders.[12][13][14] The same circuits can also be implemented in classical reversible computation, as both CNOT and Toffoli are also classical logic gates.

Since the quantum Fourier transform have a low circuit complexity, it can efficiently be used for adding numbers as well.[15][16]

## Analog adders

Just as in Binary adders, combining two input currents effectively adds those currents together. Within the constraints of the hardware, non-binary signals (i.e. with a base higher than 2) can be added together to calculate a sum. Also known as a "summing amplifier",[17] this technique can be used to reduce the number of transistors in an addition circuit.

## See also

* Binary multiplier
* Subtractor
* Electronic mixer — for adding analog signals

## References

1. ↑ Singh, Ajay Kumar (2010). Digital VLSI Design. Prentice Hall India. p. 321. ISBN 9788120341876. https://books.google.com/books?id=Gr023E8Kd5QC&dq=adder+summer+circuit&pg=PA321.
2. ↑ "Computer Circuits :: CC 210 Textbook". https://textbooks.cs.ksu.edu/cc210/03-boolean-logc/06-computer-circuits/embed.html.
3. ↑ Excel HSC Software Design and Development. Pascal Press. 2004. p. 180. ISBN 978-1-74125175-3. https://books.google.com/books?id=PZkDpS4m0fMC&pg=PA180.
4. ↑ Digital Logic and Computer Design. Prentice-Hall. 1979. pp. 119–123. ISBN 978-0-13-214510-7. https://archive.org/details/digitallogiccomp00mano/page/119.
5. ↑ Half Adder and Full Adder Circuits, 2021-04-15, https://www.electronicshub.org/half-adder-and-full-adder-circuits/#Full_Adder_using_NAND_Gates, retrieved 2021-07-27
6. ↑ 6.0 6.1 6.2 Fischer, P.. "Einfache Schaltungsblöcke". Universität Heidelberg. https://sus.ziti.uni-heidelberg.de/Lehre/WS1617_DST/DST_Fischer_06_Einfache_Bloecke_FF.pptx.pdf. Retrieved 2021-09-05.
7. ↑ Design and Implementation of Carry Select Adder Using T-Spice. Anchor Academic Publishing. 2016. p. 22. ISBN 978-3-96067058-2. https://books.google.com/books?id=F_AWDQAAQBAJ&pg=PA22.
8. ↑ "Fast Ripple-Carry Adders in Standard-Cell CMOS VLSI". 20th IEEE Symposium on Computer Arithmetic. 2011. pp. 103–111. http://ieeexplore.ieee.org/Xplore/login.jsp?url=http://ieeexplore.ieee.org/iel5/5991607/5992089/05992115.pdf?arnumber=5992115&authDecision=-203.
9. ↑ "A Regular Layout for Parallel Adders". IEEE Transactions on Computers C-31 (3): 260–264. March 1982. doi:10.1109/TC.1982.1675982. ISSN 0018-9340. http://www.dtic.mil/get-tr-doc/pdf?AD=ADA074455.
10. ↑ "A Parallel Algorithm for the Efficient Solution of a General Class of Recurrence Equations". IEEE Transactions on Computers C-22 (8): 786–793. August 1973. doi:10.1109/TC.1973.5009159.
11. ↑ Reynders, Nele; Dehaene, Wim (2015). Ultra-Low-Voltage Design of Energy-Efficient Digital Circuits. Analog Circuits and Signal Processing (1 ed.). Cham, Switzerland: Springer International Publishing AG Switzerland. doi:10.1007/978-3-319-16136-5. ISBN 978-3-319-16135-8.
12. ↑ Feynman, Richard P. (1986). "Quantum mechanical computers". Foundations of Physics (Springer Science and Business Media LLC) 16 (6): 507–531. doi:10.1007/bf01886518. ISSN 0015-9018. Bibcode: 1986FoPh...16..507F.
13. ↑ "Code example: Quantum full adder". QuTech (Delft University of Technology (TU Delft) and the Netherlands Organisation for Applied Scientific Research (TNO)). https://www.quantum-inspire.com/kbase/full-adder/.
14. ↑ Dibyendu Chatterjee, Arijit Roy (2015). "A transmon-based quantum half-adder scheme". Progress of Theoretical and Experimental Physics 2015 (9): 093A02. doi:10.1093/ptep/ptv122. Bibcode: 2015PTEP.2015i3A02C. https://paperity.org/p/73955611/a-transmon-based-quantum-half-adder-scheme.
15. ↑ Draper, Thomas G. (7 Aug 2000). "Addition on a Quantum Computer". arXiv:quant-ph/0008033.
16. ↑ Ruiz-Perez, Lidia; Juan Carlos, Garcia-Escartin (2 May 2017). "Quantum arithmetic with the quantum Fourier transform". Quantum Information Processing 16 (6): 152. doi:10.1007/s11128-017-1603-1. Bibcode: 2017QuIP...16..152R.
17. ↑ "Summing Amplifier is an Op-amp Voltage Adder". 22 August 2013. https://www.electronics-tutorials.ws/opamp/opamp_4.html.

## Further reading

* "Optimal One-Bit Full-Adders with Different Types of Gates". IEEE Transactions on Computers (Bell Laboratories: IEEE) C-23 (1): 63–70. January 1974. doi:10.1109/T-C.1974.223778. ISSN 0018-9340.
* "Minimum Binary Parallel Adders with NOR (NAND) Gates". IEEE Transactions on Computers (IEEE) C-28 (9): 648–659. September 1979. doi:10.1109/TC.1979.1675433.
* Introduction to VLSI Systems (1 ed.). Reading, MA, USA: Addison-Wesley. 1980. ISBN 978-0-20104358-7. Bibcode: 1980aw...book.....M. https://archive.org/details/introductiontovl00mead. Retrieved 2018-05-12.
* Digital Systems, with algorithm implementation (1 ed.). Philips Research Laboratory, Brussels, Belgium: John Wiley & Sons , a Wiley-Interscience Publication. 1983. ISBN 978-0-471-10413-1.
* "Review of High-Speed Addition Techniques". Proc. IEE 188 (1): 29–35. January 1971. doi:10.1049/piee.1971.0004.

## External links

* Hardware algorithms for arithmetic modules, includes description of several adder layouts with figures.
* 8-bit Full Adder and Subtractor, a demonstration of an interactive Full Adder built in JavaScript solely for learning purposes.
* Interactive Full Adder Simulation (requires Java), Interactive Full Adder circuit constructed with Teahlab's online circuit simulator.
* Interactive Half Adder Simulation (requires Java), Half Adder circuit built with Teahlab's circuit simulator.
* 4-bit Full Adder Simulation built in Verilog, and the accompanying Ripple Carry Full Adder Video Tutorial
* Shirriff, Ken (November 2020). "Reverse-engineering the carry-lookahead circuit in the Intel 8008 processor". http://www.righto.com/2020/11/reverse-engineering-carry-lookahead.html.

* v
* t
* e

Processor technologies

Models|

* Turing machine
* Universal
* Post–Turing
* Quantum
* Belt machine
* Stack machine
* Finite-state machine
* with datapath
* Hierarchical
* Queue automaton
* Register machines
* Counter
* Pointer
* Random-access
* Random-access stored program

Architecture|

* Microarchitecture
* Von Neumann
* Harvard
* modified
* Dataflow
* Transport-triggered
* Cellular
* Endianness
* Memory access
* NUMA
* HUMA
* Load/store
* Register/memory
* Cache hierarchy
* Memory hierarchy
* Virtual memory
* Secondary storage
* Heterogeneous
* Fabric
* Multiprocessing
* Cognitive
* Neuromorphic

Instruction set
architectures|

| Types|

* CISC
* RISC
* Application-specific
* EDGE
* TRIPS
* VLIW
* EPIC
* MISC
* OISC
* NISC
* ZISC
* comparison
* addressing modes

|

* x86
* ARM
* MIPS
* Power ISA
* SPARC
* Itanium
* Unicore
* MicroBlaze
* RISC-V
* others

Execution|

| Instruction pipelining|

* Pipeline stall
* Operand forwarding
* Classic RISC pipeline

|

Hazards|

* Data dependency
* Structural
* Control
* False sharing

Out-of-order|

* Tomasulo algorithm
* Reservation station
* Re-order buffer
* Register renaming

Speculative|

* Branch prediction
* Memory dependence prediction

Parallelism|

| Level|

* Bit
* Bit-serial
* Word
* Instruction
* Pipelining
* Scalar
* Superscalar
* Task
* Thread
* Process
* Data
* Vector
* Memory
* Distributed

|

Multithreading|

* Temporal
* Simultaneous
* Hyperthreading
* Speculative
* Preemptive
* Cooperative

Flynn's taxonomy|

* SISD
* SIMD
* SWAR
* SIMT
* MISD
* MIMD
* SPMD

Processor
performance|

* Transistor count
* Instructions per cycle (IPC)
* Cycles per instruction (CPI)
* Instructions per second (IPS)
* Floating-point operations per second (FLOPS)
* Transactions per second (TPS)
* Synaptic updates per second (SUPS)
* Performance per watt (PPW)
* Cache performance metrics
* Computer performance by orders of magnitude

Types|

* Central processing unit (CPU)
* Graphics processing unit (GPU)
* GPGPU
* Vector
* Barrel
* Stream
* Coprocessor
* ASIC
* FPGA
* CPLD
* Multi-chip module (MCM)
* System in package (SiP)

| By application|

* Microprocessor
* Microcontroller
* Mobile
* Notebook
* Ultra-low-voltage
* ASIP

|

Systems
on chip|

* System on a chip (SoC)
* Multiprocessor (MPSoC)
* Programmable (PSoC)
* Network on a chip (NoC)

Hardware
accelerators|

* AI accelerator
* Vision processing unit (VPU)
* Physics processing unit (PPU)
* Digital signal processor (DSP)
* Tensor processing unit (TPU)
* Secure cryptoprocessor
* Network processor
* Baseband processor

Word size|

* 1-bit
* 2-bit
* 4-bit
* 8-bit
* 16-bit
* 32-bit
* 48-bit
* 64-bit
* 128-bit
* 256-bit
* 512-bit
* others
* variable

Core count|

* Single-core
* Multi-core
* Manycore
* Heterogeneous architecture

Components|

* Core
* Cache
* CPU cache
* replacement policies
* coherence
* Bus
* Clock rate
* Clock signal
* FIFO

| Functional units|

* Arithmetic logic unit (ALU)
* Address generation unit (AGU)
* Floating-point unit (FPU)
* Memory management unit (MMU)
* Load–store unit
* Translation lookaside buffer (TLB)
* Integrated memory controller (IMC)

|

Logic|

* Combinational
* Sequential
* Glue
* Logic gate
* Quantum
* Array

Registers|

* Processor register
* Status register
* Stack register
* Register file
* Memory buffer
* Program counter

Control unit|

* Instruction unit
* Data buffer
* Write buffer
* Microcode ROM
* Counter

Datapath|

* Multiplexer
* Demultiplexer
* Adder
* Multiplier
* CPU
* Binary decoder
* Address decoder
* Sum addressed decoder
* Barrel shifter

Circuitry|

* Integrated circuit
* 3D
* Mixed-signal
* Power management
* Boolean
* Digital
* Analog
* Quantum
* Switch

Power
management|

* PMU
* APM
* ACPI
* Dynamic frequency scaling
* Dynamic voltage scaling
* Clock gating
* Performance per watt (PPW)
* Race to sleep

Related|

* History of general-purpose CPUs
* Microprocessor chronology
* Processor design
* Digital electronics
* Hardware security module
* Semiconductor device fabrication
* Tick–tock model

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Adder (electronics). Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Engineering:Adder_(electronics)&oldid=310424"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template