SlideShare a Scribd company logo
1 of 6
Download to read offline
VHDL Code
      For
Carry Save Adder




                   Done By
              Atchyuth Sonti
library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.NUMERIC_STD.ALL;



entity main is

port( a:in std_logic_vector(3 downto 0);

   b:in std_logic_vector(3 downto 0);

                carry:in std_logic;

                outsum:out std_logic_vector(3 downto 0);

                outcarry:out std_logic);

end main;



architecture Behavioral of main is

signal c0,c1,sum0,sum1:std_logic_vector(3 downto 0);

signal carry0,carry1:std_logic;

component fulladder is

port(a,b,cin :in std_logic;

        sum,cout: out std_logic);

end component;

begin

carry0<=carry;

carry1<=not carry;

fa01:fulladder port map(a(0),b(0),carry0,sum0(0),c0(0));
fa02:fulladder port map(a(1),b(1),c0(0),sum0(1),c0(1));

fa03:fulladder port map(a(2),b(2),c0(1),sum0(2),c0(2));

fa04:fulladder port map(a(3),b(3),c0(2),sum0(3),c0(3));

fa11:fulladder port map(a(0),b(0),carry1,sum1(0),c1(0));

fa12:fulladder port map(a(1),b(1),c1(0),sum1(1),c1(1));

fa13:fulladder port map(a(2),b(2),c1(1),sum1(2),c1(2));

fa14:fulladder port map(a(3),b(3),c1(2),sum1(3),c1(3));

process(carry)

begin

if(carry='0') then

outcarry<=c0(3);

outsum<=sum0;

else

outcarry<=c1(3);

outsum<=sum1;

end if;

end process;

end Behavioral;
Sub Program For Full Adder



library IEEE;

use IEEE.STD_LOGIC_1164.ALL;



-- Uncomment the following library declaration if using

-- arithmetic functions with Signed or Unsigned values

--use IEEE.NUMERIC_STD.ALL;



-- Uncomment the following library declaration if instantiating

-- any Xilinx primitives in this code.

--library UNISIM;

--use UNISIM.VComponents.all;



entity fulladder is

  Port ( a : in STD_LOGIC;

      b : in STD_LOGIC;

      cin : in STD_LOGIC;

      sum : out STD_LOGIC;

      cout : out STD_LOGIC);

end fulladder;



architecture Behavioral of fulladder is
begin

sum<= a xor b xor cin;

cout<=(a and b)or(b and cin)or(cin and a);

end Behavioral;

More Related Content

What's hot

File 1 proteus tutorial for digital circuit design
File 1 proteus tutorial for digital circuit designFile 1 proteus tutorial for digital circuit design
File 1 proteus tutorial for digital circuit designSanjeev Singh
 
Booths algorithm for Multiplication
Booths algorithm for MultiplicationBooths algorithm for Multiplication
Booths algorithm for MultiplicationVikas Yadav
 
Programmable asic i/o cells
Programmable asic i/o cellsProgrammable asic i/o cells
Programmable asic i/o cellsYalagoud Patil
 
Fan-in and Fan-out.ppt
Fan-in and Fan-out.pptFan-in and Fan-out.ppt
Fan-in and Fan-out.pptvsnishok
 
1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.MdFazleRabbi18
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic familiesBLESSINAR0
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesSrikrishna Thota
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilogvenravi10
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Piyush Rochwani
 
Special of 80386 registers
Special of 80386 registersSpecial of 80386 registers
Special of 80386 registersTanmoy Mazumder
 
Adder Presentation
Adder PresentationAdder Presentation
Adder PresentationMoeez Ahmad
 
Modified booth's algorithm Part 2
Modified booth's algorithm Part 2Modified booth's algorithm Part 2
Modified booth's algorithm Part 2babuece
 

What's hot (20)

File 1 proteus tutorial for digital circuit design
File 1 proteus tutorial for digital circuit designFile 1 proteus tutorial for digital circuit design
File 1 proteus tutorial for digital circuit design
 
Adder
Adder Adder
Adder
 
Booths algorithm for Multiplication
Booths algorithm for MultiplicationBooths algorithm for Multiplication
Booths algorithm for Multiplication
 
Programmable asic i/o cells
Programmable asic i/o cellsProgrammable asic i/o cells
Programmable asic i/o cells
 
Adder ppt
Adder pptAdder ppt
Adder ppt
 
06 floating point
06 floating point06 floating point
06 floating point
 
Ripple Carry Adder
Ripple Carry AdderRipple Carry Adder
Ripple Carry Adder
 
Unit 4-booth algorithm
Unit 4-booth algorithmUnit 4-booth algorithm
Unit 4-booth algorithm
 
Fan-in and Fan-out.ppt
Fan-in and Fan-out.pptFan-in and Fan-out.ppt
Fan-in and Fan-out.ppt
 
1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.
 
Usb Overview
Usb OverviewUsb Overview
Usb Overview
 
Advanced micro -processor
Advanced micro -processorAdvanced micro -processor
Advanced micro -processor
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic families
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilog
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
 
Special of 80386 registers
Special of 80386 registersSpecial of 80386 registers
Special of 80386 registers
 
Adder Presentation
Adder PresentationAdder Presentation
Adder Presentation
 
4 bit Binary counter
4 bit Binary counter4 bit Binary counter
4 bit Binary counter
 
Modified booth's algorithm Part 2
Modified booth's algorithm Part 2Modified booth's algorithm Part 2
Modified booth's algorithm Part 2
 

Viewers also liked

Carry save adder Type 2
Carry save adder Type 2Carry save adder Type 2
Carry save adder Type 2Atchyuth Sonti
 
Design & implementation of high speed carry select adder
Design & implementation of high speed carry select adderDesign & implementation of high speed carry select adder
Design & implementation of high speed carry select adderssingh7603
 
Carry save addition
Carry save additionCarry save addition
Carry save additionMICKYJINDAL
 
Design and development of carry select adder
Design and development of carry select adderDesign and development of carry select adder
Design and development of carry select adderABIN THOMAS
 
Design and Simulation of a Modified Architecture of Carry Save Adder
Design and Simulation of a Modified Architecture of Carry Save AdderDesign and Simulation of a Modified Architecture of Carry Save Adder
Design and Simulation of a Modified Architecture of Carry Save AdderCSCJournals
 
Low power & area efficient carry select adder
Low power & area efficient carry select adderLow power & area efficient carry select adder
Low power & area efficient carry select adderSai Vara Prasad P
 
Project report on design & implementation of high speed carry select adder
Project report on design & implementation of high speed carry select adderProject report on design & implementation of high speed carry select adder
Project report on design & implementation of high speed carry select adderssingh7603
 
Carry save multiplier
Carry save multiplierCarry save multiplier
Carry save multiplieryoussef ramzy
 
DESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_edited
DESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_editedDESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_edited
DESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_editedShital Badaik
 
Digital logic circuit
Digital logic circuit Digital logic circuit
Digital logic circuit Prabhu R
 
implementation and design of 32-bit adder
implementation and design of 32-bit adderimplementation and design of 32-bit adder
implementation and design of 32-bit adderveereshwararao
 
Explain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth TableExplain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth Tableelprocus
 

Viewers also liked (19)

Carry save adder Type 2
Carry save adder Type 2Carry save adder Type 2
Carry save adder Type 2
 
Design & implementation of high speed carry select adder
Design & implementation of high speed carry select adderDesign & implementation of high speed carry select adder
Design & implementation of high speed carry select adder
 
Carry save addition
Carry save additionCarry save addition
Carry save addition
 
Design and development of carry select adder
Design and development of carry select adderDesign and development of carry select adder
Design and development of carry select adder
 
Design and Simulation of a Modified Architecture of Carry Save Adder
Design and Simulation of a Modified Architecture of Carry Save AdderDesign and Simulation of a Modified Architecture of Carry Save Adder
Design and Simulation of a Modified Architecture of Carry Save Adder
 
Low power & area efficient carry select adder
Low power & area efficient carry select adderLow power & area efficient carry select adder
Low power & area efficient carry select adder
 
Project report on design & implementation of high speed carry select adder
Project report on design & implementation of high speed carry select adderProject report on design & implementation of high speed carry select adder
Project report on design & implementation of high speed carry select adder
 
My Report on adders
My Report on addersMy Report on adders
My Report on adders
 
Adder Presentation
Adder PresentationAdder Presentation
Adder Presentation
 
carry select adder
carry select addercarry select adder
carry select adder
 
Report adders
Report addersReport adders
Report adders
 
Carry save multiplier
Carry save multiplierCarry save multiplier
Carry save multiplier
 
Ramya Project
Ramya ProjectRamya Project
Ramya Project
 
DESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_edited
DESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_editedDESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_edited
DESIGN AND PERFORMANCE ANALYSIS OF BINARY ADDERS_edited
 
Digital logic circuit
Digital logic circuit Digital logic circuit
Digital logic circuit
 
implementation and design of 32-bit adder
implementation and design of 32-bit adderimplementation and design of 32-bit adder
implementation and design of 32-bit adder
 
Toll plaza ppt
Toll plaza pptToll plaza ppt
Toll plaza ppt
 
Explain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth TableExplain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth Table
 
Low Power Techniques
Low Power TechniquesLow Power Techniques
Low Power Techniques
 

Similar to Carry save adder vhdl

Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manualSanthosh Poralu
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxSANTIAGO PABLO ALBERTO
 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESkarthik kadava
 
gate level modeling
gate level modelinggate level modeling
gate level modelingVandanaBR2
 
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)jon_bell
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECERamesh Naik Bhukya
 
SICP勉強会について
SICP勉強会についてSICP勉強会について
SICP勉強会についてYusuke Sasaki
 

Similar to Carry save adder vhdl (12)

Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
VHDL Programs
VHDL ProgramsVHDL Programs
VHDL Programs
 
Eecs 317 20010209
Eecs 317 20010209Eecs 317 20010209
Eecs 317 20010209
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
OFDMA MATLAB CODE.pdf
OFDMA MATLAB CODE.pdfOFDMA MATLAB CODE.pdf
OFDMA MATLAB CODE.pdf
 
mod-4.pptx
mod-4.pptxmod-4.pptx
mod-4.pptx
 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLES
 
gate level modeling
gate level modelinggate level modeling
gate level modeling
 
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)
CROCHET - Checkpoint Rollback in JVM (ECOOP 2018)
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECE
 
SICP勉強会について
SICP勉強会についてSICP勉強会について
SICP勉強会について
 
Presentation1.pdf
Presentation1.pdfPresentation1.pdf
Presentation1.pdf
 

Recently uploaded

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 

Recently uploaded (20)

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 

Carry save adder vhdl

  • 1. VHDL Code For Carry Save Adder Done By Atchyuth Sonti
  • 2.
  • 3. library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity main is port( a:in std_logic_vector(3 downto 0); b:in std_logic_vector(3 downto 0); carry:in std_logic; outsum:out std_logic_vector(3 downto 0); outcarry:out std_logic); end main; architecture Behavioral of main is signal c0,c1,sum0,sum1:std_logic_vector(3 downto 0); signal carry0,carry1:std_logic; component fulladder is port(a,b,cin :in std_logic; sum,cout: out std_logic); end component; begin carry0<=carry; carry1<=not carry; fa01:fulladder port map(a(0),b(0),carry0,sum0(0),c0(0));
  • 4. fa02:fulladder port map(a(1),b(1),c0(0),sum0(1),c0(1)); fa03:fulladder port map(a(2),b(2),c0(1),sum0(2),c0(2)); fa04:fulladder port map(a(3),b(3),c0(2),sum0(3),c0(3)); fa11:fulladder port map(a(0),b(0),carry1,sum1(0),c1(0)); fa12:fulladder port map(a(1),b(1),c1(0),sum1(1),c1(1)); fa13:fulladder port map(a(2),b(2),c1(1),sum1(2),c1(2)); fa14:fulladder port map(a(3),b(3),c1(2),sum1(3),c1(3)); process(carry) begin if(carry='0') then outcarry<=c0(3); outsum<=sum0; else outcarry<=c1(3); outsum<=sum1; end if; end process; end Behavioral;
  • 5. Sub Program For Full Adder library IEEE; use IEEE.STD_LOGIC_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity fulladder is Port ( a : in STD_LOGIC; b : in STD_LOGIC; cin : in STD_LOGIC; sum : out STD_LOGIC; cout : out STD_LOGIC); end fulladder; architecture Behavioral of fulladder is
  • 6. begin sum<= a xor b xor cin; cout<=(a and b)or(b and cin)or(cin and a); end Behavioral;