VHDL之concurrent之generate
GENERATE
It is another concurrent statement (along with operators and WHEN). It is equivalent to the sequential statement LOOP in the sense that it
allows a section of code to be repeated a number of times, thus creating several instances of the same assignments.
1) FOR / GENERATE: notice that GENERATE must be labeled.
label: FOR identifier IN range GENERATE
(concurrent assignments)
END GENERATE;
2) IF/GENERATE
An irregular form is also available, which uses IF/GENERATE (with an IF equivalent; recall that originally IF is a sequential statement). Here ELSE is not allowed.
label1: FOR identifier IN range GENERATE
...
label2: IF condition GENERATE
(concurrent assignments)
END GENERATE;
...
END GENERATE;
Example 1
SIGNAL x: BIT_VECTOR ( DOWNTO );
SIGNAL y: BIT_VECTOR ( DOWNTO );
SIGNAL z: BIT_VECTOR ( DOWNTO );
...
G1: FOR i IN x'RANGE GENERATE
z(i) <= x(i) AND y(i+);
END GENERATE;
Example 2 Vector Shifter
The output vector must be a shifted version of the input vector, with twice its width and an amount of shift specified by another input.
For example, if the input bus has width 4, and the present value is ‘‘1111’’, then the output should be one of the lines of the following
matrix (the original vector is underscored):
row(0): 0 0 0 0 1 1 1 1
row(1): 0 0 0 1 1 1 1 0
row(2): 0 0 1 1 1 1 0 0
row(3): 0 1 1 1 1 0 0 0
row(4): 1 1 1 1 0 0 0 0
------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
------------------------------------------------
ENTITY shifter IS
PORT ( inp: IN STD_LOGIC_VECTOR ( DOWNTO );
sel: IN INTEGER RANGE TO ;
outp: OUT STD_LOGIC_VECTOR ( DOWNTO ));
END shifter;
------------------------------------------------
ARCHITECTURE shifter OF shifter IS
SUBTYPE vector IS STD_LOGIC_VECTOR ( DOWNTO );
TYPE matrix IS ARRAY ( DOWNTO ) OF vector;
SIGNAL row: matrix;
BEGIN
row() <= "" & inp;
G1: FOR i IN TO GENERATE
row(i) <= row(i-)( DOWNTO ) & '';
END GENERATE;
outp <= row(sel);
END shifter;
------------------------------------------------
VHDL之concurrent之generate的更多相关文章
- VHDL之concurrent之when
WHEN (simple and selected) It is one of the fundamental concurrent statements (along with operators ...
- VHDL之concurrent之block
1 Simple BLOCK The simple block represents only a way of partitioning the code. It allows concurrent ...
- VHDL之concurrent之operators
Using operators Operators can be used to implement any combinational circuit. However, as will becom ...
- Concurrent.Thread.js
(function(){ if ( !this.Data || (typeof this.Data != 'object' && typeof this.Data != 'functi ...
- how to forget about delta cycles for RTL design
A delta cycle is a VHDL construct used to makeVHDL, a concurrent language, executable on asequential ...
- Oracle E-Business Suite Maintenance Guide Release 12.2(Patching Procedures)
更多内容参考: http://docs.oracle.com/cd/E51111_01/current/acrobat/122ebsmt.zip Preparing for Patching For ...
- How to measure IOPS for VMware
http://blog.synology.com/blog/?p=2225 Executive SummaryThis article, intended towards IT Professiona ...
- Generate PDF in Sourcing through concurrent request,在EBS java并发中调用指定am的方法
package oracle.apps.pon.printing.cp; import java.io.InputStream; import java.io.FileOutputStream; im ...
- VHDL基础1
Description Structure 一个可综合的VHDL描述中一般由3部分组成:LIBRARY declarations.ENTITY.ARCHITECTURE Library(库)用来设计重 ...
随机推荐
- 腾讯云,搭建LNMP环境
LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构. Linux是一类Unix计算机操作系统的统称,是目前最流行的免费操作系统.代表版本有:debian.centos ...
- docker的容器可视化工具portainer
1.搜索镜像 [root@holly ~]# docker search portainer 2.下载portainer [root@holly ~]# docker pull portainer/p ...
- Java基础学习总结(74)——Java常见笔试题及答案汇总
1. 下面哪些是合法的标识符?(ABE )--标识符 A. $persons B. TwoUsers C. *point D. this E. _endline 2. 下面程序运行的结果是( D )- ...
- window.parent与window.opener、window.showModalDialog的区别 opener和showModalDialog刷新父页面的方法
项目中使用案例: 父窗体 <s:form namespace="/forexagent" id="listSearchForm" name="t ...
- 2015 Changchun Regional
弱没机会去长春,但拿了题来做了,加上请教各路大牛,理论AC了一发,但没实现~(感谢各路有形无形的大牛的指导) A题~Too Rich 给你1,5,10,20,50,100,200,500,1000,2 ...
- UML类图符号解释
在UML类图中,常见的有以下几种关系: 泛化(Generalization)和 实现(Realization) - 父子关系 依赖(Dependency) - 局部变量.方法參数 聚合(Aggre ...
- Supervisor-进程监控自动重启
Supervisor是一个进程监控程序. 需求一:我现在有一个进程需要每时每刻不断的跑,但是这个进程又有可能由于各种原因有可能中断.当进程中断的时候我希望能自动重新启动它,此时,我就需要使用到了Sup ...
- 初入股市之 Hello Stock
牛市的诱惑 12月3日的深沪股市,再次创出单日成交量的历史记录.这些天.各地证券部里挤满了新开户的股民.这些菜鸟们带着虔诚.希望和身家性命,挤进了一片前途未卜的莽原.当中就包含我.事实上一直有想去尝试 ...
- HDU 2110-Crisis of HDU(母函数)
Crisis of HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) To ...
- 一些求数据库对象的SQL语句
use [mydb] go --存储过程 SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_type='PROCEDURE' AND SP ...