Full Adder Interpretation in Ayantrik Lab

@VijayashekarCMarch 21, 20264 Min Read

Full Adder Interpretation in Ayantrik Lab

TL;DR: In this project we simulate a Full Adder circuit using Arduino, three slide switches, XOR gates, AND gates, OR gate, and two LEDs in Ayantrik Lab. The switches act as inputs, logic gates calculate Sum and Carry, and LEDs display the result of binary addition with carry input.


The Problem / Why This Matters

Digital systems perform arithmetic using special circuits called Adders.

In real processors, addition is done using Full Adders, not half adders, because numbers are added bit-by-bit with carry from the previous stage.

Full adders are used in:

  • CPUs
  • Microcontrollers
  • ALU (Arithmetic Logic Unit)
  • Digital calculators
  • Embedded systems

A Full Adder can add:

  • Input A
  • Input B
  • Carry Input (Cin)

and produces:

  • Sum
  • Carry Output (Cout)

In this tutorial, we simulate the Full Adder using Ayantrik Lab, so we can understand how real digital addition works. Try it here


Basic Theory of Full Adder

A Full Adder adds three binary inputs.

Inputs:

  • A
  • B
  • Cin (Carry input)

Outputs:

  • Sum (S)
  • Carry (Cout)

Full Adder uses:

  • XOR gates
  • AND gates
  • OR gate

Boolean Expressions

  • S = A ⊕ B ⊕ Cin
  • Cout = (A · B) + (Cin · (A ⊕ B))

Explanation:

  • XOR → calculates Sum
  • AND → generates carry parts
  • OR → combines carry outputs

Truth Table of Full Adder

ABCinSumCout
00000
00110
01010
01101
10010
10101
11001
11111

In this project:

  • Switch 1 → A
  • Switch 2 → B
  • Switch 3 → Cin
  • Blue LED → Sum
  • Red LED → Carry

Prerequisites

Components used:

  • Arduino Uno
  • 3 Slide Switches
  • 2 XOR Gates
  • 2 AND Gates
  • 1 OR Gate
  • 2 LEDs

All available in Ayantrik Lab component library.


Steps to Create the Project in Ayantrik Lab

1. Open New Project

Open Ayantrik Lab → Create new project.

Create New ProjectCreate New Project


2. Add Components

Click Add Components.

ToolbarToolbar

Add:

  • Arduino Uno
  • 3 Slide Switches
  • XOR Gate ×2
  • AND Gate ×2
  • OR Gate
  • 2 LEDs

Arrange properly in the canvas.


3. Make Connections

Full Adder ConnectionFull Adder Connection

Switch Inputs

Switch 1

  • Right → 5V
  • COM → D2

Switch 2

  • Right → 5V
  • COM → D3

Switch 3

  • Right → 5V
  • COM → D4

Arduino to Gates

  • D13 → A
  • D12 → B
  • D11 → Cin

Send signals to XOR and AND gates.


Gate Logic

First XOR → A ⊕ B Second XOR → Sum

First AND → A·B Second AND → Cin·(A⊕B) OR → Carry


Output LEDs

Sum → Blue LED Carry → Red LED

LED cathodes → GND


Code

cpp
const int swt1 = 2; const int swt2 = 3; const int swt3 = 4; const int input1 = 12; const int input2 = 13; const int input3 = 11; int swt1State = 0; int swt2State = 0; int swt3State = 0; void setup() { pinMode(input1, OUTPUT); pinMode(input2, OUTPUT); pinMode(input3, OUTPUT); pinMode(swt1, INPUT); pinMode(swt2, INPUT); pinMode(swt3, INPUT); } void loop() { swt1State = digitalRead(swt1); swt2State = digitalRead(swt2); swt3State = digitalRead(swt3); digitalWrite(input1, swt1State); digitalWrite(input2, swt2State); digitalWrite(input3, swt3State); }

Click Run to simulate.


Expected Behavior

ABCinSumCarry
000OFFOFF
001ONOFF
010ONOFF
011OFFON
100ONOFF
101OFFON
110OFFON
111ONON

This confirms correct Full Adder operation.


Built-in Debugging in Ayantrik Lab

Ayantrik Lab has a built-in debugger that checks:

  • Wrong wiring
  • Missing power
  • Incorrect pins
  • Code errors

DebuggingDebugging

This makes learning digital logic easier.


Conclusion

In this tutorial, we simulated a Full Adder using Arduino in Ayantrik Lab.

You learned:

  • Binary addition with carry
  • Difference between Half Adder and Full Adder
  • XOR, AND, OR combination
  • Sum and Carry generation

Full adders are used in:

  • ALU
  • CPU
  • Digital processors
  • Multi-bit adders

Next try:

  • 4-bit Adder
  • Subtractor
  • Multiplexer
  • Decoder
  • Flip-Flops

Happy learning with Ayantrik Lab !

Continue Reading

How to Teach Electronics Remotely — A Guide for Indian Teachers

How to Teach Electronics Remotely — A Guide for Indian Teachers

remote teaching
June 3, 20267 Min

By Nalini Vijayakumar

Remote electronics teaching doesn't mean a watered-down curriculum. Discover how Indian teachers are using browser-based virtual labs to run richer experiments, eliminate hardware failures, and assess students more rigorously — without a single physical component.

Read Article