文件名称:si四位加法器
介绍说明--下载内容来自于网络,使用问题请自行百度
内含三个普通的四位加法器,adder,adder4-2,adder4-3(library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity full_adder is
port(
a,b,ci :in std_logic;
s,co :out std_logic);
end entity;
architecture rtl of full_adder is
begin
s<=a xor b xor ci;
co<=(a and b)or(a and ci)or(b and ci);
end rtl;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity adder4_3 is
port(
A,B :in std_logic_vector(3 downto 0);
Ci :in std_logic;
S : out std_logic_vector(3 downto 0);
Co : out std_logic);
end entity;
architecture rtl of adder4_3 is
signal C0,C1,C2,C3,C4:std_logic;
component full_adder is
port(
a,b,ci :in std_logic;
s,co :out std_logic);
end component;
begin
u0:full_adder port map(A(0),B(0),C0,S(0),C1);
u1:full_adder port map(A(1),B(1),C1,S(1),C2);
u2:full_adder port map(A(2),B(2),C2,S(2),C3);
u3:full_adder port map(A(3),B(3),C3,S(3),C4);
end rtl;)
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity full_adder is
port(
a,b,ci :in std_logic;
s,co :out std_logic);
end entity;
architecture rtl of full_adder is
begin
s<=a xor b xor ci;
co<=(a and b)or(a and ci)or(b and ci);
end rtl;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity adder4_3 is
port(
A,B :in std_logic_vector(3 downto 0);
Ci :in std_logic;
S : out std_logic_vector(3 downto 0);
Co : out std_logic);
end entity;
architecture rtl of adder4_3 is
signal C0,C1,C2,C3,C4:std_logic;
component full_adder is
port(
a,b,ci :in std_logic;
s,co :out std_logic);
end component;
begin
u0:full_adder port map(A(0),B(0),C0,S(0),C1);
u1:full_adder port map(A(1),B(1),C1,S(1),C2);
u2:full_adder port map(A(2),B(2),C2,S(2),C3);
u3:full_adder port map(A(3),B(3),C3,S(3),C4);
end rtl;)
相关搜索: 四位加法器
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
adder4_3.vhd | 974 | 2018-04-04 |
硬件描述语言实验三.doc | 36352 | 2018-03-21 |
硬件描述语言实验四.doc | 34816 | 2018-03-27 |
硬件描述语言实验五.doc | 35840 | 2018-04-03 |
adder4.vhd | 673 | 2018-03-21 |
adder4_2.vhd | 457 | 2018-04-11 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.