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(库)用来设计重 ...
随机推荐
- SSL常用专业缩略语汇总
JKS - Java KeyStore JAVA密钥库 OCSP - Online Certificate Status Protocol证书在线状态协议. SAN - Subject Alterna ...
- 【codeforces 755F】PolandBall and Gifts
[题目链接]:http://codeforces.com/contest/755/problem/F [题意] n个人; 计划是每个人都拿一个礼物来送给一个除了自己之外的人; 且如果一个人没有送出礼物 ...
- Luogu P3740 [HAOI2014] 贴海报 线段树
线段树版的海报 实际上这个与普通的线段树相差不大,只是貌似数据太水,暴力都可以过啊 本来以为要离散的,结果没打就A了 #include<iostream> #include<cstd ...
- js es6 Object.freeze
将对象冻结,使用Object.freeze方法 const foo = Object.freeze({}); // 常规模式时,下面一行不起作用: // 严格模式时,该行会报错 foo.prop = ...
- CentOS 6.5下mysql的安装与配置
一.通过yum自动安装mysql yum install mysql-server my-client 二.初始化及相关配置 安装完mysql数据库以后,会发现会多出一个mysqld的服务,通过输入 ...
- B - Oulipo
The French author Georges Perec (1936�C1982) once wrote a book, La disparition, without the letter ' ...
- Spring MVC新手教程(一)
直接干货 model 考虑给用户展示什么.关注支撑业务的信息构成.构建成模型. control 调用业务逻辑产生合适的数据以及传递数据给视图用于呈献: view怎样对数据进行布局,以一种优美的方式展示 ...
- Android 下使用opencv
两种方式: 1.java API 2.Native/C++ 方式,OpenCV.mk中默认使用动态库的方式链接opencv,设置OPENCV_LIB_TYPE:=STATIC 以静态库方式调用 htt ...
- Android HAL模块实现
1. HAL介绍 Android的HAL(Hardware Abstract Layer硬件抽象层)是为了保护一些硬件提供商的知识产权而提出的.是为了避开linux的GPL束缚. 思路是把控制硬件的动 ...
- 到底什么是nandflash,norflash,sdram,emmc,rom,ram【转】
本文转载自:http://blog.sina.com.cn/s/blog_6dd8f2b70101le26.html 最近被nandflash,norflash,sdram,emmc,rom,ram搞 ...