Question

Develop a VHDL modelfor a full adder. The adder has three inputs, A, B, Cinand two...

Develop a VHDL modelfor a full adder. The adder has three inputs, A, B, Cinand two outputs SUM and Cout. All inputs/outputs are of STD_LOGIC. Synthesis and simulate your design to verify it is functionally correct.Submit source code and self-checking testbench.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:------

VHDL Code for Full Adder:---------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity full_adder_vhdl_code is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Cin : in STD_LOGIC;
SUM : out STD_LOGIC;
Cout : out STD_LOGIC);
end full_adder_vhdl_code;

architecture gate_level of full_adder_vhdl_code is

begin
SUM <= A XOR B XOR Cin ;
Cout <= (A AND B) OR (Cin AND A) OR (Cin AND B) ;
end gate_level;

Testbench VHDL Code for Full Adder:----------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY Testbench_full_adder IS
END Testbench_full_adder;

ARCHITECTURE behavior OF Testbench_full_adder IS

-- Component Declaration for the Unit Under Test (UUT)

COMPONENT full_adder_vhdl_code
PORT(
A : IN std_logic;
B : IN std_logic;
Cin : IN std_logic;
SUM : OUT std_logic;
Cout : OUT std_logic
);
END COMPONENT;

--Inputs
signal A : std_logic := '0';
signal B : std_logic := '0';
signal Cin : std_logic := '0';

--Outputs
signal SUM : std_logic;
signal Cout : std_logic;

BEGIN

-- Instantiate the Unit Under Test (UUT)
uut: full_adder_vhdl_code PORT MAP (
A => A,
B => B,
Cin => Cin,
SUM => SUM,
Cout => Cout
);

-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 100 ns;

-- insert stimulus here
A <= '1';
B <= '0';
Cin <= '0';
wait for 10 ns;

A <= '0';
B <= '1';
Cin <= '0';
wait for 10 ns;

A <= '1';
B <= '1';
Cin <= '0';
wait for 10 ns;

A <= '0';
B <= '0';
Cin <= '1';
wait for 10 ns;

A <= '1';
B <= '0';
Cin <= '1';
wait for 10 ns;

A <= '0';
B <= '1';
Cin <= '1';
wait for 10 ns;

A <= '1';
B <= '1';
Cin <= '1';
wait for 10 ns;

end process;

END;

Add a comment
Know the answer?
Add Answer to:
Develop a VHDL modelfor a full adder. The adder has three inputs, A, B, Cinand two...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 3. PRELAB 1. A half adder is a circuit that has two inputs, A and B,...

    3. PRELAB 1. A half adder is a circuit that has two inputs, A and B, and two outputs, sum and carry. It adds A and B according to the rules of binary addition and outputs the sum and carry. Design a half-adder circuit using one XOR gate and one AND gate. Verify your design through truth table and with Multisim. 2. Whereas the half adder added two inputs A and B, the full adder adds three inputs together, A,...

  • DOING NUMBER 7 of VHDL lab "write your own full-adder in VHDL " is my only...

    DOING NUMBER 7 of VHDL lab "write your own full-adder in VHDL " is my only request. Do the rest, if you have time. To verify and apply techniques to build half adders and full adder to perform additions using gates. For each part of the procedure, show the number of that section and include a logic diagram of the circuit, truth table for the circuit, and any other necessary information. Adder Implementation 1. Construct a binary half-adder and record...

  • Design a 2-bit full adder. this circuit would have 5 inputs, two for the number A...

    Design a 2-bit full adder. this circuit would have 5 inputs, two for the number A = (a1,a0), two for the number B = (b1,b0), and one for the carry-in Cin. It would also have three outputs, two for the sum bit S = (s1,s0) and one for the carry out Cout.

  • Do Simulate a 4bit Ripple Carry adder in Simulink and generate the VHDL code to be...

    Do Simulate a 4bit Ripple Carry adder in Simulink and generate the VHDL code to be implemented on DE2 board. Submit the VHDL code generated by the HDL coder and also screen shots from the DE2 board/ Quartus environment. 4 Bit Ripple Carry Adder A(3) B(3) A(2) B(2) A(1) B(1) A(0) B(0) А B A B Cout C64) А в A B C(3) C(2) C(1) C(O) Co Ci Со Ci Co Co Ci Cin S S S S Sum(3) Sum...

  • 4. Design a 4-bit Adder / Subtractor. Follow the steps given below. (a) Write the VHDL...

    4. Design a 4-bit Adder / Subtractor. Follow the steps given below. (a) Write the VHDL code for a 1-bit Full Adder. The VHDL code must include an entity and an architecture. (b) Draw the circuit diagram for a 4-bit Adder / Subtractor. The circuit diagram may include the following logic elements: 1-bit Full Adders (shown as a block with inputs and outputs) Any 2-input logic gates Multiplexers Do not draw the logic circuit for the 1-bit Full Adder.

  • Design a CMOS full adder circuit with inputs A, B, and C (carry in) and outputs...

    Design a CMOS full adder circuit with inputs A, B, and C (carry in) and outputs S (sum) and Co (carry out). Specify device sizes for all MOS transistors in your design using the following properties: n=1.5 p=2n L=0.35um

  • Please help me with 1-7 dale seriäi diagra lor design of a tull adder (fulladder.sch). Full-Adder...

    Please help me with 1-7 dale seriäi diagra lor design of a tull adder (fulladder.sch). Full-Adder Full-adder is the basic building block of many arithmetic aircuits. A single ful-adder adds two bits, A and B, and put the results in S. Cn and Cou signals are added to the full-adder circuit to make it usable for adding mulit-bit numbers. The truth table for a full adder circuit is shown below 0 101 0 10 1 0 3. Construct the K...

  • Design a 2-bit full adder. this circuit would have 5 inputs, two for the number A...

    Design a 2-bit full adder. this circuit would have 5 inputs, two for the number A = (a1,a0), two for the number B = (b1,b0), and one for the carry-in Cin. It would also have three ouputs, two for the sum bit S = (s1,s0) and one for the carry out Cout.

  • A full-adder is a combinational circuit (memory-less) that forms the arithmetic sum of two input bits...

    A full-adder is a combinational circuit (memory-less) that forms the arithmetic sum of two input bits (say a and b) and a carry in (Cin, so three input bits total). The full-adder provides two outputs in the form of the (S)um and the carry out (Cout). The input bits a and b represent the terms to be added, but the full-adder needs to also consider the carry in bit, too. Construct a truth table for the Full-Adder Construct a K-Map...

  • FPGA (Interconnected Adder Modules) In this lab you will implement adder circuits using data flow modelling....

    FPGA (Interconnected Adder Modules) In this lab you will implement adder circuits using data flow modelling. You will also create 3-bit adder by employing interconnected 1-bit full adders. Data flow modelling of a 1-bit full adder circuit. Data flow modelling of a 3-bit adder circuit. There will be 7 inputs (X2, X1, X0, Y2, Y1, YO, Cin) - please put them in that order - Switch 6 will represent X2 and Switch 0 will be the Cin. There should be...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT