Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe

VHDL Tutorial – 21: Designing an 8-bit, full-adder circuit using VHDL

By Ashutosh Bhatt February 16, 2021

Note: it’s recommended to follow this VHDL tutorial series in order, starting with the first tutorial.

In the previous tutorial, VHDL Tutorial – 20, we learned how to design 4-bit binary-to-gray & gray-to-binary code converters by using VHDL.

In this tutorial, we will:

  • Write a VHDL program that builds an 8-bit, full-adder circuit
  • Verify the output waveform of the program (the digital circuit) with the circuit operation

The 8-bit, full-adder block diagram:

Now, let’s write, compile, and simulate a VHDL program. Then, we’ll get the waveform output and verify it.

Before starting, be sure to review the step-by-step procedure provided in VHDL Tutorial – 3 to design the project. It will ensure that you properly edit and compile the program and the waveform file, as well as the final output.

For this project, we’ve used a structural modeling style to build the 8-bit, full-adder circuit. A 1-bit, full-adder is used as the component.

VHDL program

library ieee;
use ieee.std_logic_1164.all;

entity FA_8bit is
port(x,y : in std_logic_vector(7 downto 0);
     cin : in std_logic;
      sum : out std_logic_vector(7 downto 0);
      co : out std_logic);
end FA_8bit;

architecture FA_arch of FA_8bit is
signal cary : std_logic_vector(6 downto 0);

component full_adder is
  port (p,q,r:in std_logic; sm,cr: out std_logic);
end component;
  begin
     a0:full_adder port map (x(0),y(0),cin,sum(0),cary(0));
     a1:full_adder port map (x(1),y(1),cary(0),sum(1),cary(1));
     a2:full_adder port map (x(2),y(2),cary(1),sum(2),cary(2));
     a3:full_adder port map (x(3),y(3),cary(2),sum(3),cary(3));
     a4:full_adder port map (x(4),y(4),cary(3),sum(4),cary(4));
     a5:full_adder port map (x(5),y(5),cary(4),sum(5),cary(5));
     a6:full_adder port map (x(6),y(6),cary(5),sum(6),cary(6));
     a7:full_adder port map (x(7),y(7),cary(6),sum(7),co);
end FA_arch;

library ieee;
use ieee.std_logic_1164.all;
entity full_adder is
   port (p,q,r:in std_logic; sm,cr: out std_logic);
end full_adder;

architecture FA_arc of full_adder is
  begin
    sm <= p xor q xor r;
    cr <= (p and q) or (q and r) or (r and p);
   end FA_arc;

It may help to review the first two VHDL tutorials (1 and 2) of this series to refresh you memory about how this works.

Next, compile the above program, creating and then saving a waveform file with all of the necessary inputs and outputs that are listed (ensuring you apply all of the different input combinations). Then, simulate the project. You should get the following result…

Simulation waveform

As can be noted in this figure, the sum of x, y, and cin are highlighted in red and blue.

In next tutorial, we’ll learn how to design a digital comparator by using VHDL.


Filed Under: Tutorials, VHDL, VHDL

 

Next Article

← Previous Article
Next Article →

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



Tell Us What You Think!! Cancel reply

Log in to leave a comment:

Lost your password?

Don't have an account? Register here

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Sensors
In this Tech Toolbox, we cover some of those technologies driving the next generation of connected systems, including ultra-low-power sensing strategies that extend node battery life, and 60 GHz CMOS radar for contactless health and presence detection.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

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!


RSS EDABOARD.com Discussions.

  • Trouble regarding identification of the pin numbers of an IC
  • Is it possible for a sequential cell’s D pin to have both setup_rising and hold_falling timing arcs in a Liberty file?
  • RFID tag simulation at CST
  • Does Machine Constant in Torque Equation for Repulsion Motor Depends on Supply Frequency like Proportionality constant in induction motor?
  • Non-synchronized SMPS's are fine?

RSS Electro-Tech-Online.com Discussions

  • DC question
  • My Advanced Realistic Humanoid Robots Project
  • Mitsubishi Electric IPM module lot code format - how to decode?
  • washing machine motor wiring
  • effect of calibration on s-parameters

Featured Tutorials

Learn - VHDL Tutorials (22 Part)

  • VHDL Tutorial – 11: Designing half and full-subtractor circuits
    VHDL Tutorial – 11: Designing half and full-subtractor circuits
  • VHDL Tutorial – 12: Design a 8-bit parity generator and circuit checker
    VHDL Tutorial – 12: Design a 8-bit parity generator and circuit checker
  • VHDL tutorial 13: Design 3×8 decoder and 8×3 encoder using VHDL
    VHDL tutorial 13: Design 3×8 decoder and 8×3 encoder using VHDL
  • VHDL Tutorial 14: Design 1×8  demultiplexer and 8×1 multiplexer using VHDL
    VHDL Tutorial 14: Design 1×8  demultiplexer and 8×1 multiplexer using VHDL
  • VHDL Tutorial 17: Design a JK flip-flop (with preset and clear) using VHDL
    VHDL Tutorial 17: Design a JK flip-flop (with preset and clear) using VHDL
  • VHDL Tutorial 18: Design a T flip-flop (with enable and an active high reset input) using VHDL
    VHDL Tutorial 18: Design a T flip-flop (with enable and an active high reset input) using VHDL
More Tutorials >

Recent Articles

  • Qorvo adds SOI RF switches to 30 GHz
  • Bourns ferrite beads lower loss in high-current designs
  • Diodes adds 6A automotive intelligent load switch
  • Q Tech launches 400MHz to 1.3GHz oscillators
  • Molex expands hybrid connectors with 25.0A contacts

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2026 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

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe