The Design and Implementation of the Ripple-Carry Adder: a Review of the Fundamentals of Digital Electronics

Total Page:16

File Type:pdf, Size:1020Kb

The Design and Implementation of the Ripple-Carry Adder: a Review of the Fundamentals of Digital Electronics The Design and Implementation of the Ripple-Carry Adder: a Review of the Fundamentals of Digital Electronics Michael Stirchak June 1, 2016 Abstract To gain an understanding of digital electronics, I designed and implemented a 4-bit, ripple-carry adder using discrete n-type MOSFET's. To accomplish this, I first studied the design of bipolar junction and field-effect transistors to understand the physics of electronic switching. Next, I reviewed the principles of Boolean algebra in order to develop logic gates. Using these gates, I was able to design and build a digital circuit capable of binary addition under the 2's complement encoding scheme. 1 Contents 1 Introduction 3 2 Transistor Design 4 2.1 The Bipolar Junction Transistor . .5 2.2 The Field-Effect Transistor . .6 2.3 Transistor Comparison for Digital Electronics . .9 3 Boolean Algebra 10 3.1 Logical Operations and Truth Tables . 10 3.1.1 Example: The XOR Gate . 12 3.1.2 Example: Implementation of the NAND gate using MOSFET's . 14 3.2 Binary Encoding: the 2's Complement Method . 15 3.2.1 Limitations of 2's Complement . 17 4 The Ripple-Carry Adder 17 4.1 Design of the Adder . 18 4.1.1 Binary Addition . 18 4.1.2 The 1-Bit Adder . 19 4.1.3 The 4-Bit Adder . 21 4.1.4 Overflow Detection . 22 4.2 Implementation of the Adder . 24 5 Conclusion 26 6 Acknowledgments 26 Appendices 27 A Appendix I: Transistor-Level Implementations of Logic Gates 27 B Appendix II: Laws of Boolean Algebra 29 C Appendix III: Transistor-Level Diagrams of the Adder 30 D Appendix IV: Technologies and Materials Used 31 Bibliography 33 2 1 Introduction The 20th century has been called the Quantum Century for the breathtaking advances made in the field of physics during that time. The quality and breadth of these break- throughs, particularly in the latter half of the 20th century, were due in no small part to the advent of the digital computer. Computers allowed physicists to tackle problems that had previously been deemed unsolvable, and also gave these scientists an invaluable tool with which to attack future problems. Today, there is no single tool more indispensable to physics research than the digital computer. The theory and construction of computers, then, should be of great interest to physicists. Computers have been around in some form or another for thousands of years. Ancient computers like the Greek Antikythera were intricate, but purely mechanical; more recent computers employed bulky vacuum tubes to regulate the flow of electric signals in a produc- tive manner; finally, almost all modern computers contain vast arrays of transistors capable of performing billions of calculations every second. A common theme in most of these devices is the digital nature of their inputs and outputs: they work with signals that are either high (on) or low (off). Transistors in particular have proven themselves to be indispensable to the construction of digital circuits, as they function as highly-efficient electronic switches. Indeed, the overall goal of this paper is to explore how transistors can be used to perform some logical and arithmetic operations on electronic signals. Although transistors are the basis of almost all components in a modern computer, in- cluding memory, storage, and processors, this paper will focus solely on the construction of a simple arithmetic logic unit capable of binary addition. To that end, I will first study the design of bipolar junction and field-effect transistors to understand the physics behind electronic switching. Next, to explore the mathematical basis for logical and arithmetic oper- ations, an overview of Boolean algebra will be given. Finally, with this theoretical foundation I will design and implement a 4-bit, ripple-carry adder. 3 Figure 1: Diagram of a discrete npn-type bipolar junction transistor. As current flows into the base, the positively-charged holes are attracted to the emitter region, causing electrons to pass to the collector. This results in a steady current from collector to emitter. 2 Transistor Design Prior to 1947, the dominant switching component in electronics was the vacuum tube. These devices performed their job adequately, but they were by nature large, cumbersome to use, prone to failure, and inefficient in terms of power consumption. Physicists and engineers, recognizing the growing importance of these devices, sought to improve on them by making a smaller, safer, and more efficient electronic switch. The result of these efforts were realized in December 1947, when Bell Laboratories created the first bipolar junction transistor [1]. The BJT was compact, efficient, and most of all easy to manufacture, and as a result they quickly replaced vacuum tubes in electronics. Research on transistors did not stop there, however, and after a few more years the first field-effect transistors were being manufactured as well. Today, most digital circuits use FET's instead of BJT's, for reasons I shall discuss. Nevertheless, both types of transistors can be used in digital circuits and are worth discussing. 4 2.1 The Bipolar Junction Transistor The bipolar junction transistor was the first transistor to be widely used in industry. Its general structure, as seen in Figure 1, consists of the collector, base, and emitter regions. There are two distinct varieties of BJT's: npn and pnp. npn transistors consist of a collector doped with electrons, an emitter heavily doped with electrons so that it is more negatively charged than the collector, and a positively-charged base region sandwiched between them. pnp transistors are just the opposite, with a negatively-doped base in between the positively- doped collector and emitter regions. In either case, the BJT effectively consists of two pn- junctions which allows it to act as a current-controlled diode [2]. If, for example, there is no current IB running into the base of the transistor, there is effectively a pn-junction between the collector and emitter that prevents current from flowing between them. However, if IB is increased, the positive charge-carrying holes flowing into the base will be attracted to the emitter, causing the emitter electrons to flow into the base and emitter. This results in a controllable current flow from collector to emitter. From Figure 1 it is clear that the collector current is dependent on the base current. Exactly what relationship the two currents have depends on the specific type of the BJT; in general however, IC is directly proportional to IB and a unit-less variable β, which is usually around 50-100 [2]. In other words, IC = β · IB: This relationship makes BJT's phenomenally useful as current amplifiers, as a small base current can be used to drive a much larger collector current [2]. However, the exact value of β depends on the base current, the transistor's temperature, and a few other factors, meaning that IC may be inconsistent during continuous operation. Usually though, a BJT is used an an amplifier when the exact output current does not matter, so long as it is sufficiently large. There are limits on the amplifying behavior of BJT's. To understand these limits, it 5 is useful to study BJT's not only as current-driven driven devices, but also as voltage- driven devices. If we define VC , VE, and VB to be the voltages at the three terminals of the transistor, we can define the emitter current in terms of the voltage difference at the base-emitter junction: VBE V IE = IS(e T − 1); where VT = kT=e; k being Boltzmann's Constant, T being the transistor's temperature, and e being the charge of an electron. IS is the reverse-saturation current across the base- emitter junction (leakage current), and is usually in the pA-fA range. This is known as the Ebers-Moll equation, and it is the mathematical foundation for the behavior of BJT's [3]. From it, we can see that the emitter current will increase as VBE increases, but only until the transistor becomes saturated. Also, an increase in temperature could cause significant change in emitter current. These will be important quantities to keep in mind as other types of transistors are introduced. These two relationships, IC = β · IB and the Ebers-Moll equation, represent two separate and equally valid ways of analyzing the behavior of bipolar junction transistors. For digital electronics, it is usually preferable to take the current-driven view of BJT's because the relationship between IB and IC is relatively linear. In the voltage-driven view, current depends exponentially on VBE, which is needlessly complex for a circuit whose signals need only be \high" or \low." Having established that the BJT is a current-driven device for our purposes, it will be interesting to begin an analysis of the design of the field-effect transistor. 2.2 The Field-Effect Transistor The design of the field-effect transistor is in many ways less complex than the bipolar junction transistor, but also more subtle. Similar to the BJT, the FET consists of three terminals, now called the gate, source, and drain (see Figure 2). Also like the BJT, FET's come in two flavors, the n-type FET and p-type FET. In both cases, the drain and source are 6 Figure 2: Diagram of an n-type Metal Oxide Semiconductor Field-Effect Transistor (MOS- FET). The main body is a positively-doped silicon substrate, while the drain and source are negatively-doped. As a voltage is applied across the gate, positive charge accumulates on the terminal's plate, attracting electrons from the body and forming the conductive channel.
Recommended publications
  • Arithmetic Logic UNIT
    Louisiana State University LSU Digital Commons LSU Master's Theses Graduate School 2003 Arithmetic logic UNIT (ALU) design using reconfigurable CMOS logic Chandra Srinivasan Louisiana State University and Agricultural and Mechanical College, [email protected] Follow this and additional works at: https://digitalcommons.lsu.edu/gradschool_theses Part of the Electrical and Computer Engineering Commons Recommended Citation Srinivasan, Chandra, "Arithmetic logic UNIT (ALU) design using reconfigurable CMOS logic" (2003). LSU Master's Theses. 2891. https://digitalcommons.lsu.edu/gradschool_theses/2891 This Thesis is brought to you for free and open access by the Graduate School at LSU Digital Commons. It has been accepted for inclusion in LSU Master's Theses by an authorized graduate school editor of LSU Digital Commons. For more information, please contact [email protected]. ARITHMETIC LOGIC UNIT (ALU) DESIGN USING RECONFIGURABLE CMOS LOGIC A Thesis Submitted to the Graduate Faculty of the Louisiana State University and Agricultural and Mechanical College in partial fulfillment of the requirements for the degree of Master of Science in Electrical Engineering in The Department of Electrical and Computer Engineering by Chandra Srinivasan Bachelor of Engineering, Mysore University, 1997 December 2003 To My parents and in loving memory of my grandmother ii Acknowledgements I would like to acknowledge certain people who have encouraged, supported and helped me complete my thesis at LSU. I am very grateful to my advisor Dr. A. Srivastava for his guidance, patience and understanding throughout this work. His suggestions, discussions and constant encouragement has helped me to get a deep insight in the field of VLSI design. I would like to thank Dr.
    [Show full text]
  • Quantum Modular Adder Over GF(2N-1)
    applied sciences Article Quantum Modular Adder over GF(2n − 1) without Saving the Final Carry Aeyoung Kim 1 , Seong-Min Cho 2 , Chang-Bae Seo 2 , Sokjoon Lee 3 and Seung-Hyun Seo 2,4,∗ 1 The College of Information Technology, Hanshin University, Osan 18101, Korea; [email protected] 2 The Department of Electronic & Electrical Engineering, Graduate School, Hanyang University, Seoul 04763, Korea; [email protected] (S.-M.C.); [email protected] (C.-B.S.) 3 Cryptographic Engineering Research Section, Electronics and Telecommunications Research Institute, Daejeon 34129, Korea; [email protected] 4 The Division of Electrical Engineering, Hanyang University (ERICA), Ansan 15588, Korea * Correspondence: [email protected]; Tel.: +82-31-400-5163 Abstract: Addition is the most basic operation of computing based on a bit system. There are various addition algorithms considering multiple number systems and hardware, and studies for a more efficient addition are still ongoing. Quantum computing based on qubits as the information unit asks for the design of a new addition because it is, physically, wholly different from the existing frequency- based computing in which the minimum information unit is a bit. In this paper, we propose an efficient quantum circuit of modular addition, which reduces the number of gates and the depth. The proposed modular addition is for the Galois Field GF(2n − 1), which is important as a finite field basis in various domains, such as cryptography. Its design principle was from the ripple carry addition (RCA) algorithm, which is the most widely used in existing computers. However, unlike conventional RCA, the storage of the final carry is not needed due to modifying existing diminished-1 modulo 2n − 1 adders.
    [Show full text]
  • Half Adder and Full Adder
    ADDER AND SUBTRACTOR INTRODUCTION OBJECTIVE: • HALF ADDER • FULL ADDER • BINARY PARALLEL ADDER • HALF SUBTRACTOR • FULL SUBTRACTOR What is Adder? Adder : In electronics an adder is digital circuit that perform addition of numbers. In modern computer adder reside in the arithmetic logic unit (ALU). Adders : Adders are important not only in the computer but also in many types of digital systems in which the numeric data are processed. Types of adder: Half adder Full adder Half adder : The half adder accepts two binary digits on its inputs and produce two binary digits outputs, a sum bit and a carry bit. The half adder is an example of a simple, functional digital circuit built from two logic gates. The half adder adds to one-bit binary numbers (AB). The output is the sum of the two bits (S) and the carry (C). Note that how the same two inputs are directed to two different gates. The inputs to the XOR gate are also the inputs to the AND gate. The input "wires" to the XOR gate are tied to the input wires of the AND gate; thus, when voltage is applied to the A input of the XOR gate, the A input to the AND gate receives the same voltage. Half adder truth table S=A B (Exclusive OR) C=A.B (AND) Full adder : The full adder accepts two inputs bits and an input carry and generates a sum output and an output carry. The full-adder circuit adds three one-bit binary numbers (Cin, A ,B) and outputs two one-bit binary numbers, a sum (S) and a carry (Cout).
    [Show full text]
  • Design and Implementation of 4-Bit Arithmetic and Logic Unit Chip with the Constraint of Power Consumption
    IOSR Journal of Electronics and Communication Engineering (IOSR-JECE) e-ISSN: 2278-2834,p- ISSN: 2278-8735.Volume 9, Issue 3, Ver. V (May - Jun. 2014), PP 36-43 www.iosrjournals.org Design and Implementation of 4-Bit Arithmetic and Logic Unit Chip with the Constraint of Power Consumption Priyanka Yadav, Gaurav Kumar, Sumita Gupta Assistant Professor Department of Electronics & Communication HITM,Agra Research Analyst ONE97 Communication LTD. Noida Assistant Professor Department of Electronics & Communication HITM,Agra Abstract: By increasing the demand of enhancing the ability of processors to handle the more complex and challenging processors has resulted in the integration of a number of processor cores into one chip. Still the load of on the processor is not less in generic system. An Arithmetic Logic Unit (ALU) is the heart of all microprocessors. It is a combinational logic unit that performs its logical or arithmetic operations. ALU is getting smaller and more complex nowadays to enable the development of a more powerful but smaller computer. In this proposed paper a 4 bit ALU chip has been design to the benefits of all the computations are done in parallel and available simultaneously, so no clock resources are wasted. The MUX is then simply used to select the required output. Index Terms: ALU, CMOS, VLSI and TTL I. Introduction ALU is getting smaller and more complex nowadays to enable the development of a more powerful but smaller computer. However there are a few limiting factors that slow down the development of smaller and more complex IC chip and they are IC fabrication technology, designer productivity and design cost.
    [Show full text]
  • Quantum Carry-Save Arithmetic
    Quantum Carry-Save Arithmetic Phil Gossett Silicon Graphics, Inc. 2011 N. Shoreline Blvd. Mountain View, CA 94043-1389 e-mail:[email protected] August 29, 1998 Abstract: This paper shows how to design efficient arithmetic elements out of quan- tum gates using “carry-save” techniques borrowed from classical computer design. This allows bit-parallel evaluation of all the arithmetic elements required for Shor’s algorithm, including modular arithmetic, deferring all carry propagation until the end of the entire computation. This reduces the quantum gate delay from O(N^3) to O(N log N) at a cost of increasing the number of qubits required from O(N) to O(N^2). 1.0 Introduction Of the recent advances in quantum algorithms, one of the most impressive to date is Shor’s algorithm for discrete logs and factorization [1], which gives an exponential speedup over classical algorithms. Vedral, Barenco and Ekert [2] have shown how to implement the necessary modular exponentiation operations in quantum gates with a num- ber of qubits linear in the number of input bits. These networks use “ripple carry” for the propagation of carries in the additions required for the computation. Ripple carry adders have delay linear in the number of bits. Classical computer designs have long used “carry-save” addition [3] to defer carry propa- gation until the very end of a computation, with the intermediate additions having delay constant in number of bits. Since these can be arranged in binary trees, the cumulative gate delay for a classical carry-save implementation is logarithmic in number of bits.
    [Show full text]
  • Quantum Plain and Carry Look-Ahead Adders
    Quantum Plain and Carry Look-Ahead Adders Kai-Wen Cheng Chien-Cheng Tseng [email protected] [email protected] Department of Computer and Communication Engineering, National Kaohsiung First University of Science and Technology, Yenchao, Kaohsiung, Taiwan, Republic of China May 22, 2002 Abstract In this paper, two quantum networks for the addition operation are presented. One is the Modified Quantum Plain(MQP)adder, and the other is the Quantum Carry Look-Ahead(QCLA)adder. The MQP adder is obtained by modifying the Conventional Quantum Plain(CQP)adder. The QCLA adder is an extension of conventional digital Carry Look-Ahead adder. Compared with the CQP adder, two main advantages are as follows: First, the proposed MQP and QCLA adders have less number of elementary gates than the CQP adder. Secondly, the number of processing stages of the MQP and QCLA adder are less than ones of the CQP adder. As a result, the throughput time for computing the sum of two numbers on the quantum computer can be improved. Keywords:Carry Look-Ahead Adder, Quantum Plain Adder, Quantum Arithmetic, parallel architecture 1 1. Introduction In 1994, Shor showed that prime factorization and discrete logarithms can be done quickly on a quantum computer [1][2]. One application of Shor’s quantum prime factorization algorithm is to break RSA cryptosystems. To implement Shor's algorithm, a lot of researchers have devoted themselves to design quantum arithmetic networks. In 1995, Vedral, Barenco and Ekert provided the quantum network for the modular exponentiation, which is one of the main arithmetic tasks of Shor’s prime factorization algorithm [3].
    [Show full text]