SlideShare a Scribd company logo
1 of 2
Download to read offline
1) Simulate an 8-bit VHDL Adders circuit built using Integer Arithmetic.
2) Simulate an 8-bit Adder/Subtractor circuit built using LPM.
Solution
2)using LPM:
LIBRARY ieee ;
USE ieee.std_logic_1164.all ;
LIBRARY lpm ;
USE lpm.lpm_components.all ;
entity LPM_8bit_Add_Sub is
PORT ( Cin : IN STD_LOGIC ;
A, B : IN STD_LOGIC_VECTOR(15 DOWNTO 0) ;
Sum : OUT STD_LOGIC_VECTOR(15 DOWNTO 0) ;
Cout : OUT STD_LOGIC ) ;
end LPM_8bit_Add_Sub;
architecture Behavioral of LPM_8bit_Add_Sub is
begin
instance: lpm_add_sub
GENERIC MAP (LPM_WIDTH => 16)
PORT MAP ( cin => Cin, dataa => A, datab => B,
result => Sum, cout => Cout ) ;
end Behavioral;
1)Integer Arithmetic:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
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 Adder_int_8bit is
Port ( A,B : in STD_LOGIC_VECTOR (7 downto 0);
S : out STD_LOGIC_VECTOR (7 downto 0);
Cout : out STD_LOGIC);
end Adder_int_8bit;
architecture Behavioral of Adder_int_8bit is
signal A1,B1,S1: STD_LOGIC_VECTOR (8 downto 0);
begin
A1<=0&A;
B1<=0&B;
S1<=A1+B1;
S<=S1(7 downto 0);
Cout<=S1(8);
end Behavioral;

More Related Content

Similar to 1) Simulate an 8-bit VHDL Adders circuit built using Integer Arithme.pdf

Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
Spitiq
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
mkazree
 
Xcs 234 microprocessors
Xcs 234 microprocessorsXcs 234 microprocessors
Xcs 234 microprocessors
sweta suman
 
Embedded system (Chapter 2) part A
Embedded system (Chapter 2) part AEmbedded system (Chapter 2) part A
Embedded system (Chapter 2) part A
Ikhwan_Fakrudin
 
Alu design-project
Alu design-projectAlu design-project
Alu design-project
alphankg1
 
Pipeline stalling in vhdl
Pipeline stalling in vhdlPipeline stalling in vhdl
Pipeline stalling in vhdl
Sai Malleswar
 

Similar to 1) Simulate an 8-bit VHDL Adders circuit built using Integer Arithme.pdf (20)

Picmico
PicmicoPicmico
Picmico
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
Presentation
PresentationPresentation
Presentation
 
Libpcap
LibpcapLibpcap
Libpcap
 
Micro
MicroMicro
Micro
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 
Xcs 234 microprocessors
Xcs 234 microprocessorsXcs 234 microprocessors
Xcs 234 microprocessors
 
Embedded system (Chapter 2) part A
Embedded system (Chapter 2) part AEmbedded system (Chapter 2) part A
Embedded system (Chapter 2) part A
 
Intro2 Robotic With Pic18
Intro2 Robotic With Pic18Intro2 Robotic With Pic18
Intro2 Robotic With Pic18
 
Ii avr-basics(1)
Ii avr-basics(1)Ii avr-basics(1)
Ii avr-basics(1)
 
Dsp Datapath
Dsp DatapathDsp Datapath
Dsp Datapath
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
 
Ee6008 mcbsd notes
Ee6008 mcbsd notesEe6008 mcbsd notes
Ee6008 mcbsd notes
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processor
 
Alu design-project
Alu design-projectAlu design-project
Alu design-project
 
Pipeline stalling in vhdl
Pipeline stalling in vhdlPipeline stalling in vhdl
Pipeline stalling in vhdl
 
Learn microcontroller pic16f84a
Learn microcontroller pic16f84aLearn microcontroller pic16f84a
Learn microcontroller pic16f84a
 
Tutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsTutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applications
 
EE6008 MCBSD - Introduction to PIC Micro controller
EE6008 MCBSD - Introduction to PIC Micro controller EE6008 MCBSD - Introduction to PIC Micro controller
EE6008 MCBSD - Introduction to PIC Micro controller
 
EE6008 MBSD
EE6008  MBSDEE6008  MBSD
EE6008 MBSD
 

More from info785431

Compare and contrast the messages about science and integrity in Fra.pdf
Compare and contrast the messages about science and integrity in Fra.pdfCompare and contrast the messages about science and integrity in Fra.pdf
Compare and contrast the messages about science and integrity in Fra.pdf
info785431
 
Write a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdfWrite a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdf
info785431
 
Why has one prominent textbook author described IO management as the.pdf
Why has one prominent textbook author described IO management as the.pdfWhy has one prominent textbook author described IO management as the.pdf
Why has one prominent textbook author described IO management as the.pdf
info785431
 
What is the value of studying humanities in a business or technical .pdf
What is the value of studying humanities in a business or technical .pdfWhat is the value of studying humanities in a business or technical .pdf
What is the value of studying humanities in a business or technical .pdf
info785431
 
USING JAVAImplement the quicksort optimization median-of-three, i.pdf
USING JAVAImplement the quicksort optimization median-of-three, i.pdfUSING JAVAImplement the quicksort optimization median-of-three, i.pdf
USING JAVAImplement the quicksort optimization median-of-three, i.pdf
info785431
 
The Task For this assignment you will write a rudimentary text edi.pdf
The Task For this assignment you will write a rudimentary text edi.pdfThe Task For this assignment you will write a rudimentary text edi.pdf
The Task For this assignment you will write a rudimentary text edi.pdf
info785431
 

More from info785431 (20)

Carbon dioxide (CO_2) is a non-polar molecule. Is this consistent wit.pdf
Carbon dioxide (CO_2) is a non-polar molecule. Is this consistent wit.pdfCarbon dioxide (CO_2) is a non-polar molecule. Is this consistent wit.pdf
Carbon dioxide (CO_2) is a non-polar molecule. Is this consistent wit.pdf
 
Compare and contrast the messages about science and integrity in Fra.pdf
Compare and contrast the messages about science and integrity in Fra.pdfCompare and contrast the messages about science and integrity in Fra.pdf
Compare and contrast the messages about science and integrity in Fra.pdf
 
Briely, what was Darwins explanation for the appearance of design.pdf
Briely, what was Darwins explanation for the appearance of design.pdfBriely, what was Darwins explanation for the appearance of design.pdf
Briely, what was Darwins explanation for the appearance of design.pdf
 
A router receives a message addressed 172.16.15.75. The relevant rou.pdf
A router receives a message addressed 172.16.15.75. The relevant rou.pdfA router receives a message addressed 172.16.15.75. The relevant rou.pdf
A router receives a message addressed 172.16.15.75. The relevant rou.pdf
 
A study of sandflies in Panama classified flies caught in light traps.pdf
A study of sandflies in Panama classified flies caught in light traps.pdfA study of sandflies in Panama classified flies caught in light traps.pdf
A study of sandflies in Panama classified flies caught in light traps.pdf
 
___Tissue found in the brain, spinal cord, and peripheral nerves. The.pdf
___Tissue found in the brain, spinal cord, and peripheral nerves. The.pdf___Tissue found in the brain, spinal cord, and peripheral nerves. The.pdf
___Tissue found in the brain, spinal cord, and peripheral nerves. The.pdf
 
You have been exposed to each of the 8 microbes below. One of them h.pdf
You have been exposed to each of the 8 microbes below. One of them h.pdfYou have been exposed to each of the 8 microbes below. One of them h.pdf
You have been exposed to each of the 8 microbes below. One of them h.pdf
 
Write a snippet of C code that will enable the ADC to continuously r.pdf
Write a snippet of C code that will enable the ADC to continuously r.pdfWrite a snippet of C code that will enable the ADC to continuously r.pdf
Write a snippet of C code that will enable the ADC to continuously r.pdf
 
Write a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdfWrite a JAVA LinkedListRec class that has the following methods siz.pdf
Write a JAVA LinkedListRec class that has the following methods siz.pdf
 
Write a BFS algorithm using only arrays and no other data structure..pdf
Write a BFS algorithm using only arrays and no other data structure..pdfWrite a BFS algorithm using only arrays and no other data structure..pdf
Write a BFS algorithm using only arrays and no other data structure..pdf
 
Why has one prominent textbook author described IO management as the.pdf
Why has one prominent textbook author described IO management as the.pdfWhy has one prominent textbook author described IO management as the.pdf
Why has one prominent textbook author described IO management as the.pdf
 
which is true of the data shown in the histogram Which is true of th.pdf
which is true of the data shown in the histogram Which is true of th.pdfwhich is true of the data shown in the histogram Which is true of th.pdf
which is true of the data shown in the histogram Which is true of th.pdf
 
What is the value of studying humanities in a business or technical .pdf
What is the value of studying humanities in a business or technical .pdfWhat is the value of studying humanities in a business or technical .pdf
What is the value of studying humanities in a business or technical .pdf
 
What are the two components of dynamic pressureVelocity and densi.pdf
What are the two components of dynamic pressureVelocity and densi.pdfWhat are the two components of dynamic pressureVelocity and densi.pdf
What are the two components of dynamic pressureVelocity and densi.pdf
 
USING JAVAImplement the quicksort optimization median-of-three, i.pdf
USING JAVAImplement the quicksort optimization median-of-three, i.pdfUSING JAVAImplement the quicksort optimization median-of-three, i.pdf
USING JAVAImplement the quicksort optimization median-of-three, i.pdf
 
There are 40 students in our class. How many ways they can be lined .pdf
There are 40 students in our class. How many ways they can be lined .pdfThere are 40 students in our class. How many ways they can be lined .pdf
There are 40 students in our class. How many ways they can be lined .pdf
 
The Task For this assignment you will write a rudimentary text edi.pdf
The Task For this assignment you will write a rudimentary text edi.pdfThe Task For this assignment you will write a rudimentary text edi.pdf
The Task For this assignment you will write a rudimentary text edi.pdf
 
The SIP handles what functionsA.) establishes a call through the .pdf
The SIP handles what functionsA.) establishes a call through the .pdfThe SIP handles what functionsA.) establishes a call through the .pdf
The SIP handles what functionsA.) establishes a call through the .pdf
 
The NBA decides to look into the use of meldonium in the league foll.pdf
The NBA decides to look into the use of meldonium in the league foll.pdfThe NBA decides to look into the use of meldonium in the league foll.pdf
The NBA decides to look into the use of meldonium in the league foll.pdf
 
The organelle that serves as the digestive system in the cell is the .pdf
The organelle that serves as the digestive system in the cell is the .pdfThe organelle that serves as the digestive system in the cell is the .pdf
The organelle that serves as the digestive system in the cell is the .pdf
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 

1) Simulate an 8-bit VHDL Adders circuit built using Integer Arithme.pdf

  • 1. 1) Simulate an 8-bit VHDL Adders circuit built using Integer Arithmetic. 2) Simulate an 8-bit Adder/Subtractor circuit built using LPM. Solution 2)using LPM: LIBRARY ieee ; USE ieee.std_logic_1164.all ; LIBRARY lpm ; USE lpm.lpm_components.all ; entity LPM_8bit_Add_Sub is PORT ( Cin : IN STD_LOGIC ; A, B : IN STD_LOGIC_VECTOR(15 DOWNTO 0) ; Sum : OUT STD_LOGIC_VECTOR(15 DOWNTO 0) ; Cout : OUT STD_LOGIC ) ; end LPM_8bit_Add_Sub; architecture Behavioral of LPM_8bit_Add_Sub is begin instance: lpm_add_sub GENERIC MAP (LPM_WIDTH => 16) PORT MAP ( cin => Cin, dataa => A, datab => B, result => Sum, cout => Cout ) ; end Behavioral; 1)Integer Arithmetic: library IEEE; use IEEE.STD_LOGIC_1164.ALL; 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 Adder_int_8bit is Port ( A,B : in STD_LOGIC_VECTOR (7 downto 0); S : out STD_LOGIC_VECTOR (7 downto 0); Cout : out STD_LOGIC);
  • 2. end Adder_int_8bit; architecture Behavioral of Adder_int_8bit is signal A1,B1,S1: STD_LOGIC_VECTOR (8 downto 0); begin A1<=0&A; B1<=0&B; S1<=A1+B1; S<=S1(7 downto 0); Cout<=S1(8); end Behavioral;