Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Arithmetic Circuits – DE Part 10

By Hai Prasaath K

The previous tutorials laid the foundation for logic synthesis and design of digital circuits. The digital circuits in general always have application as computing devices either as processor, controller or application specific ICs. As a computing device, the digital circuitry of a processor, controller or ASIC must be essentially able to perform arithmetic operations. The implementation of arithmetic operations by digital circuitry is further used to build up complex computing logics and mathematical functions.

In a processor/controller/ASIC, the arithmetic operations on integer binary numbers are performed by  Arithmetic Logic Unit (ALU) while arithmetic operations on floating point numbers are performed by Floating Point Unit (FPU). A Floating Point Unit itself is built from multiple ALUs. Within a Central Processing Unit (CPU) or Graphics Processing Unit (GPU) of a computer/computing device, there are many ALU and/or FPU (where FPU themselves are built from multiple ALU).   

The digital circuits can be either of the two types – 1) Combinational Logic Circuits or 2) Sequential Logic Circuits. In a combinational circuit, the output of the circuit depends only on the input values at that time. In sequential circuits, the output depends not only on the present input but also past output values. The ALU are built by combinational circuits. The ALU is typically designed to perform the following operations –

1) Arithmetic Operations – Generally, the arithmetic operations supported by the ALU are addition, addition with carry, subtraction, subtraction with borrow, two’s complement, increment, decrement and pass through.

2) Bitwise Logical Operations –  The logical operations supported by the ALU are AND, OR, Exclusive-OR and One’s Complement.

3) Bit Shift Operations – The bit shift operations implemented in an ALU include arithmetic shift, logical shift, rotate and rotate through carry.

So, ALU can perform arithmetic operations like addition and subtraction, and so multiplication and division on integer binary numbers. A binary number may be available to the ALU of a digital processor either as parallel 8-bit, 16-bit, 32-bit or 64-bit input depending upon if it is 8-bit, 16-bit, 32-bit or 64-bit processor. The basic building blocks of the ALU are adders. The adder circuits are built by logic gates and flip-flops. The semiconductor adder circuits can perform addition in a time less than 1 microseconds.

Let us learn about various combinational circuits – half-adder, full-adder, half-subtractor, full-subtractor, N-bit parallel adder, N-bit parallel subtractor etc that are generally part of an ALU.

Half Adder –

The half adder is a simple combinational circuit which performs the arithmetic addition of two binary digits or addition of two bits. It has two inputs and two outputs. The two inputs are the two 1-bit numbers A and B while the two outputs are the sum (S) of A and B and the carry (C).  The truth table for a half adder is as follow –

From the above truth table, it must be clear that the sum is 1 if either of the two inputs is 1 else if both inputs are 1 or 0, the sum is 0. This can be implemented by connecting the inputs to an exclusive OR gate. The carry is 1 only if both inputs are 1 else it is 0. This can be implemented by connecting the inputs to AND gate. So, the half adder has the following circuit –  

Half Adder Circuit Diagram

Fig. 1: Half Adder Circuit

 

Full Adder –

A half adder has only two inputs and there is no provision to add a carry coming from the lower order bits when multiple bit addition is performed. For this purpose full adder is designed. A full adder is designed to perform the arithmetic sum of three input bits and produces a sum output and a carry. The truth table for a full adder is as follow –

From the truth table, it must be clear that the full adder has three inputs and two outputs. The two input variables are denoted by A and B, which represents the two significant bits to be added. The third input Cin represents the carry from the previous low significant position. The outputs aresum (S) and Carry (C). From the truth table, it can be seen that Sum is 1 if either input is 1 or all inputs are 1. This can be implemented by exclusive-OR of all the inputs. The carry is 1 when either two inputs are 1 or all inputs are 1. This can be implemented as sum of product expression of all the inputs. So, the full adder has the following circuit –

Full Adder Circuit Diagram

Fig. 2: Full Adder Circuit

 

It can be noted that full adder is formed by two half adder circuits and an OR gate.

Half Subtractor –

The half subtractor is a simple combinational circuit designed to perform subtraction of two bits. It has two inputs, X and Y and two outputs Difference (D) and Borrow out (Bout). The truth table for a half subtractor is as follow –

 

From the truth table, it can be seen that the difference D is 1 if either input is 1 else if both inputs are 1 or 0, the D is 0. This can be implemented by connecting the inputs to an exclusive OR gate. The Borrow Out (Bout) is 1 only if Y is 1 but not X. The borrow output Bout is 1 whenever X is lesser than Y, then the subtraction is done by borrowing 1 from the next higher order bit. This can be implemented by AND operation between Y and NOT of X. So, the half subtractor has the following circuit –   

Half Subtractor Circuit Diagram

Fig. 3: Half Subtractor Circuit

Full Subtractor –

A full subtractor is designed to perform subtraction involving three bits, namely minuend bit, subtrahend bit and borrow from previous stage. In full subtractor, it has three inputs X, Y and Bin, and two outputs Difference (D) and Borrow (Bout). It has the following truth table –

From the truth table, it can be seen that Difference is 1 if either input is 1 or all inputs are 1. This can be implemented by exclusive-OR of all the inputs. The Borrow Out is 1 if either two inputsis 1 or all inputs are 1. This can be implemented as OR operation between two half subtractor. So, the full subtractor has the following circuit diagram –

Full Subtractor Circuit Diagram

Fig. 4: Full Subtractor Circuit

N-Bit Parallel Adder –

The Full Adder is capable of adding only two single digit binary number along with a carry input. Practically, there is need to add binary numbers which are much longer than just one bit. To add two n-bit binary numbers there need to use the n-bit parallel adder. It uses a number of full adders in cascade. The carry output of the previous full adder is connected to carry input of the next full adder.

Like a 4-bit parallel adder, can be constructed by cascading four full-adder circuits. In the circuit A0 and B0 represent the LSB of the four bit words A and B where Full Adder-0 is the lowest stage. Hence its Cin has been permanently made 0. The rest of the connections are exactly same as those of n-bit parallel adder. The four bit parallel adder is a very common logic circuit. A 4-bit parallel adder can be shown by the following block diagram –

4-Bit Parallel Adder Block Diagram

Fig. 5: 4-Bit Parallel Adder Block Representation

N-Bit Parallel Subtractor –

The subtraction can be carried out by taking the 1’s or 2’s complement of the number to be subtracted. For example, the subtraction (A-B) can be performed by adding either 1’s or 2’s complement of B to A. So, a binary adder can be used to perform the binary subtraction. Just as a parallel binary adder can be implemented by cascading several full adders, a parallel binary subtractor can also be implemented by cascading several full subtractors.

Like a 4 – bit binary parallel subtractor that subtracts a 4 – bit number Y3 Y2 Y1 Y0 from another 4 – bit number X3 X2 X1 X0 will have  4 difference outputs and borrow output (Bout). The Bin of the LSB full subtractor is connected to 0 and Bout of previous  full subtractor is connected to Bin of next full subtractor.  A 4-bit parallel subtractor can be shown by the following block diagram –

4-Bit Parallel Subtractor Block Diagram

Fig. 6: 4-Bit Parallel Subtractor Block Representation

In the next tutorial, learn about gate level minimization and logic gate implementation of the arithmetic circuits discussed above. 

 

Filed Under: Recent Articles

 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What is a loop calibrator? 
  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Passive Harmonics Filter
  • file edit
  • RCF Subwoofer Amplifier PIC16F870-I/SP please help me about hex code
  • Active Balun Design
  • What was before microcontrollers ?

RSS Electro-Tech-Online.com Discussions

  • Control Bare LCD With ATmega328p
  • Need a ducted soldering fan for solder smoke extraction
  • Identify a circuit.
  • Sla ir li ion
  • Question about ultrasonic mist maker
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering