全加器四位串行加法器.最全优质PPT

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

• signal c: std_logic_vector(0 to 4);
• begin
• g0:f_adder
• port map(x(0),y(0),c(0),s(0),c(1));
• x<='0'&a(3 dowgn1to:0f)_; adder
该方法常用于系统数学模型的仿真或是系统工作原理的仿真。
a,b : •in std_logicp_voecrtotr(3mdoawnpto(0x);(1),y(1),c(1),s(1),c(2));
std_logic_1164.
• g2:f_adder 四位串行加法器(逻辑图)
std_logic_unsigned.
e数n据d e流•n式tity电f_路a设dd计per方;o法rt:m通过a对p数(据x流(2在)设,y计(中2的),具c体(2行)为,s的(描2述),来c建(3模)。); • g3:f_adder x<='0'&a(3 downto 0);
• architecture bhv of f_adder is
• begin
• g0:s<=x xor y xor cin;
• g1:cout<=(x and y)or(x and cin)or(y and cin);
• end architecture bhv;
四位串行加法器(逻辑图)
四位串行加法器(结构体式)
• use ieee.std_logic_unsigned.all;
• entity bit_f_adder is
• port(cin: in std_logic;

a,b : in std_logic_vector(3 downto 0);

s: out std_logic_vector(3 downto 0);
全加器(数据流式)
• --quanjia
• library ieee;
• use ieee.std_logic_1164.all;
• entity f_adder is
• port(x,y,cin:in std_logic;

s,cout:out std_logic);
• end entity f_adder;
y<='0'&b(3 downto 0);

z<=x+y+cin;

s(3 downto 0)<=z(3 downto 0);

cout<=z(4);
• end bhv;
谢谢观赏~~~
并行加法器(逻辑图)
全加器四位串行加法器
电路的三种设计方法
• 结构化电路设计方法:通过对电路结构的描述来建模,即 通过对器件的调用(HDL概念称为例化), 运用组件 (component)语句实现。
• 数据流式电路设计方法:通过对数据流在设计中的具体行 为的描述来建模。
• 行为式电路设计方法:是指采用对信号行为级的描述来建 模。抽象程度比数据流描述形式和结构描述形式高得多, 常采用算术运算、关系运算等语句实现。该方法常用于系 统数学模型的仿真或是系统工作原理的仿真。

c4:out std_logic);
• end entity adder4;
• architecture structural of adder4 is
• component f_adder
• port(x,y,cin:in std_logic;

s,cout:out std_logic);
• end component f_adder;
port(cin: in std_logic;
• std_logic_1164.port map(x(3),y(3),c(3),s(3),c(4));
• c(0)<=c0;
• c4<=c(4);
• end structural;
四位全加器(行为描述式)
• ld_logic_1164.all;

cout: out std_logic);
• end bit_f_adder;
• architecture bhv of bit_f_adder is
• signal x,y,z:std_logic_vector(4 downto 0);
• begin

x<='0'&a(3 downto 0);

• --adder4
• library ieee;
• use ieee.std_logic_1164.all;
• entity adder4 is
• port(x,y:in std_logic_vector(3 downto 0);

c0:in std_logic;
• s:out std_logic_vector(3 downto 0);
一般VHDL程序的结构
库声明:实现库的调用,具体调用的是程序包中的内容 实体:描述电路的外部特性,即电路的输入与输出; 结构:描述电路内部实现的功能; VHDL允许一个实体对应多种结构。
库、程序包
设计实体
实体(ENTITY)
结构体 (ARCHITECTURE)
配置 (CONFIGURATION)
全加器(逻辑图)
相关文档
最新文档