找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6135|回复: 0
收起左侧

VHDL除法器宏模块及编程调用

[复制链接]
ID:262 发表于 2014-10-17 18:51 | 显示全部楼层 |阅读模式
1.在要调用项目的文件夹创建除法器宏模块
    按下图设置和添加宏模块
































Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.std_logic_unsigned.all;
Use ieee.std_logic_arith.all;
Entity dddd is
Port(a:in std_logic_vector(6 downto 0);
     b:in std_logic_vector(3 downto 0);
   x:out std_logic_vector(6 downto 0);
   y:out std_logic_vector(3 downto 0));
end ;
architecture dd of dddd is
--------定义调用宏模块
component chufa is
port(numer:in std_logic_vector(6 downto 0);
     denom:in std_logic_vector(3 downto 0);
   quotient:out std_logic_vector(6 downto 0);
     remain:out std_logic_vector(3 downto 0) );
end component;
-----------------结束定义
begin
U:chufa port map(a,b,x,y);  -----调用
end;

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表