20210123 张大佳MCU VHDL常用语法 ---- Port map and OPEN

VHDL常用语法 ---- Port map and OPEN

FPGA---基本功 日常记录 备忘

Two ways to map the PORTS of a COMPONENT during its instantiation:

1 第一种 变量和引脚关联方式 Positional mapping, ports x and y correspond to a and b, respectively.

COMPONENT inverter IS
    PORT (a: IN STD_LOGIC; b: OUT STD_LOGIC); 
END COMPONENT; 
... 

U1 : inverter PORT MAP (X,Y);

2 第二种 变量和引脚关联方式  Nominal mapping would be the following:

U1: inverter PORT MAP (x => a, y => b);
  Positional mapping is easier to write, but nominal mapping is less error-prone.

 3 第三种 变量和引脚关联方式 可以有---open关键词 Ports can also be left unconnected (using the keyword OPEN). 

U2: my_circuit PORT MAP (X => a, y => b, z => OPEN);
4  如何按位置位  =>  used to assign values to individual vector or with keyword others
signal Data_Bus : std_logic_vector (15 downto 0);
... ...

-- 1st way
Data_Bus <= (15 | 7 downto 0 => '1', others => '0');

-- 2nd way
Data_Bus (15 | 7 downto 0) <= '1';
Data_Bus (14 downto 8) <= '0';

 

---------------------------  FPGA 技术交流  -------------------------------

微信:zjwyaonuli

私人邮箱:ainidejiawei@foxmail.com

 

 

 

 

 

  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JIAWEI_Z

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值