OpenCores
URL https://opencores.org/ocsvn/generic_booth_multipler/generic_booth_multipler/trunk

Subversion Repositories generic_booth_multipler

[/] [generic_booth_multipler/] [trunk/] [rtl/] [modules/] [00.Adder.vhd] - Diff between revs 2 and 6

Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 6
library IEEE;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_1164.ALL;
 
 
entity Adder is
entity Adder is
 
        generic(
 
                size : integer:= 4
 
        );
        port(
        port(
                A               : in  std_logic_vector;
                A               : in  std_logic_vector(size-1 downto 0);
                B               : in  std_logic_vector;
                B               : in  std_logic_vector(size-1 downto 0);
                Cin     : in  std_logic;
                Cin     : in  std_logic;
                S               : out std_logic_vector;
                S               : out std_logic_vector(size-1 downto 0);
                Cout    : out std_logic);
                Cout    : out std_logic);
end Adder;
end Adder;
 
 
architecture Behavioral of Adder is
architecture Behavioral of Adder is
        component FullAdder is
        component FullAdder is
                port(
                port(
                        A        :in    std_logic;
                        A        :in    std_logic;
                        B        :in    std_logic;
                        B        :in    std_logic;
                        Cin :in std_logic;
                        Cin :in std_logic;
                        Sum :out std_logic;
                        Sum :out std_logic;
                        Cout:out std_logic);
                        Cout:out std_logic);
        end component;
        end component;
        signal carry : std_logic_vector(A'length downto 0);
        signal carry : std_logic_vector(A'length downto 0);
begin
begin
        carry(0) <= cin;
        carry(0) <= cin;
        cout <= carry(A'length);
        cout <= carry(A'length);
        AdderGen : for i in A'range generate
        AdderGen : for i in A'range generate
                FA : FullAdder port map(A(i),B(i),carry(i),S(i),carry(i+1));
                FA : FullAdder port map(A(i),B(i),carry(i),S(i),carry(i+1));
        end generate;
        end generate;
 
 
 
 
end Behavioral;
end Behavioral;
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.