Coder Social home page Coder Social logo

rohiit2005 / full_adder_subtractor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from naavaneetha/full_adder_subtractor

0.0 0.0 0.0 282 KB

License: GNU General Public License v3.0

VHDL 52.88% Verilog 12.32% Standard ML 1.48% Stata 16.98% HTML 16.34%

full_adder_subtractor's Introduction

FULL_ADDER_SUBTRACTOR

Implementation-of-Full-Adder-and-Full-subtractor-circuit

AIM:

To design a Full Adder and Full Subtractor circuit and verify its truth table in Quartus using Verilog programming.

Equipments Required:

Hardware – PCs, Cyclone II , USB flasher

Software – Quartus prime

Full Adder and Full Subtractor

Full Adder

Full adder is a digital circuit used to calculate the sum of three binary bits. It consists of three inputs and two outputs. Two of the input variables, denoted by A and B, represent the two significant bits to be added. The third input, Cin, represents the carry from the previous lower significant position. Two outputs are necessary because the arithmetic sum of three binary digits ranges in value from 0 to 3, and binary 2 or 3 needs two digits. The two outputs are sum and carry.

Sum =A’B’Cin + A’BCin’ + ABCin + AB’Cin’ = A ⊕ B ⊕ Cin

Carry = AB + ACin + BCin

image

Figure -1 FULL ADDER

Full Subtractor

A full subtractor is a combinational circuit that performs subtraction involving three bits, namely minuend, subtrahend, and borrow-in . It accepts three inputs: minuend, subtrahend and a borrow bit and it produces two outputs: difference and borrow.

image

Diff = A ⊕ B ⊕ Bin

Borrow out = A'Bin + A'B + BBin

Truthtable

Full Adder

Screenshot 2024-03-25 at 9 03 58 AM

Full Subtractor

Screenshot 2024-03-25 at 9 02 42 AM

Procedure

  1. Type the program in Quartus software.

  2. Compile and run the program.

  3. Generate the RTL schematic and save the logic diagram.

  4. Create nodes for inputs and outputs to generate the timing diagram.

  5. For different input combinations generate the timing diagram.

Program:

/* Program to design a half subtractor and full subtractor circuit and verify its truth table in quartus using Verilog programming. */

Developed By: Rohiit.A.S
Register number: 212223100047
module FULL_addsub(a,b,cin,sum,carry,BO,DIFF);
input a,b,cin;
output sum,carry,BO,DIFF;
assign sum = a^b^cin;
assign carry = (a&b) | (b&cin) | (a&cin);
wire a0;
not (a0,a);
//Write syntax for full subtractor Borrow and Difference in data flow modelling
assign DIFF = a^b^cin;
assign BO = (a0&b) | (b&cin) | (a0&cin);
endmodule

RTL Schematic

WhatsApp Image 2024-03-30 at 10 12 53

Output Timing Waveform

WhatsApp Image 2024-03-30 at 10 12 52

Result:

Thus the Full Adder and Full Subtractor circuits are designed and the truth tables is verified using Quartus software.

full_adder_subtractor's People

Contributors

naavaneetha avatar rohiit2005 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.