全加器,四位串行加法器_第1页
全加器,四位串行加法器_第2页
全加器,四位串行加法器_第3页
全加器,四位串行加法器_第4页
全加器,四位串行加法器_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、VHDL硬件描述语言全加器四位串行加法器电路的三种设计方法 结构化电路设计方法:通过对电路结构的描述来建模,即通过对器件的调用(HDL概念称为例化), 运用组件(component)语句实现。 数据流式电路设计方法:通过对数据流在设计中的具体行为的描述来建模。 行为式电路设计方法:是指采用对信号行为级的描述来建模。抽象程度比数据流描述形式和结构描述形式高得多,常采用算术运算、关系运算等语句实现。该方法常用于系统数学模型的仿真或是系统工作原理的仿真。一般VHDL程序的结构库、程序包实体(ENTITY)结构体 (ARCHITECTURE)配置(CONFIGURATION)设计实体 库声明:实现库的

2、调用,具体调用的是程序包中的内容库声明:实现库的调用,具体调用的是程序包中的内容 实体:描述电路的外部特性,即电路的实体:描述电路的外部特性,即电路的输入输入与与输出输出; 结构:描述电路内部实现的结构:描述电路内部实现的功能功能; VHDLVHDL允许一个实体对应多种结构。允许一个实体对应多种结构。全加器(逻辑图)全加器(数据流式) -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

3、f_adder; 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;四位串行加法器(逻辑图)四位串行加法器(结构体式) -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_log

4、ic_vector(3 downto 0); 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; signal c: std_logic_vector(0 to 4); begin g0:f_adder port map(x(0),y(0),c(0),s(0),c(1); g1:f_adder port map(x(1

5、),y(1),c(1),s(1),c(2); g2:f_adder port map(x(2),y(2),c(2),s(2),c(3); g3:f_adder port map(x(3),y(3),c(3),s(3),c(4); c(0)=c0; c4=c(4); end structural;四位全加器(行为描述式)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity bit_f_adder is port(cin: in std_logic;a,b : in std_logic_vec

6、tor(3 downto 0);s: out std_logic_vector(3 downto 0);cout: out std_logic);end bit_f_adder;architecture bhv of bit_f_adder issignal x,y,z:std_logic_vector(4 downto 0);beginx=0&a(3 downto 0);y=0&b(3 downto 0);z=x+y+cin;s(3 downto 0)=z(3 downto 0);cout=z(4);end bhv;谢谢观赏并行加法器(逻辑图)library ieee;use ieee.std_logic_1164.all;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);cout: out std_logic);end bit_f_adder;architecture bhv of bit_f_adder issignal x,y,z:std_logic_vector(4 downto 0);beginx

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论