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(库)用来设计重 ...
随机推荐
- git 删除某次指定的提交
reset命令有3种方式: 1:git reset –mixed:此为默认方式,不带任何参数的git reset,即时这种方式,它回退到某个版本,只保留源码,回退commit和index信息 2:gi ...
- mysql中的sql查询优化
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在where 及order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中对字段进行null 值判断,否则将导致引擎放弃使用索引而进 ...
- [bzoj4796][CERC2016]Key Knocking_乱搞
Key Knocking bzoj-4796 CERC-2016 题目大意:描述没有题面短系列..题目链接 注释:$1\le n\le 10^5$. 想法: 乱搞稳AC.考试的时候调试信息又一次杀死了 ...
- 如何快速恢复SLAVE从库上某几张表
在日常工作中,同步报错是DBA遇到最多的一个问题,如果修复后发现还没有解决,通常的办法是在master上重新导入一份备份,然后在slave上恢复,这个方案是针对整个库不是很大的情况,那么如果是数据库比 ...
- 小胖说事14--------IOS字体大小,字号的问题 PX转化为UIFont
PX和Font之间相互转换公示表: 计算公式为:font=(像素PX)/(96/72).
- LinkedHashMap源代码阅读
LinkedHashMap LinkedHashMap内部採用了散列表和链表实现Map接口,并能够保证迭代的顺序,和HashMap不同,其内部维护一个指向全部元素的双向链表,其决定了遍历的顺序,一般是 ...
- 从头认识Spring-2.7 自己主动检測Bean(1)-@Component @Repository @Service @Controller
这一章节我们来讨论一下自己主动检測Bean. 1.domain 厨师类: package com.raylee.my_new_spring.my_new_spring.ch02.topic_1_19; ...
- 垃圾回收GC:.Net自己主动内存管理 上(二)内存算法
垃圾回收GC:.Net自己主动内存管理 上(二)内存算法 垃圾回收GC:.Net自己主动内存管理 上(一)内存分配 垃圾回收GC:.Net自己主动内存管理 上(二)内存算法 垃圾回收GC:.Net自己 ...
- outlook创建收信规则,将收到的所有邮件,转发到qq邮箱,然后删除
因为outlook默认只有400M的空间. 使用企业邮箱的时候,很快就满了. 本来是打算在qq邮箱中,添加其他邮箱来收取的. http://service.mail.qq.com/cgi-bin/he ...
- Spring:验证用户登录
利用 Spring IOC 技术实现用户登录的验证机制,对用户进行登录验证. 首先利用 Spring 的自动装配模式将 User 对象注入到控制器中,然后将用户输入的用户名和密码与系统中限定的合法用户 ...