VHDL之concurrent之when
WHEN (simple and selected)
It is one of the fundamental concurrent statements (along with operators and GENERATE).
It appears in two forms: WHEN / ELSE (simple WHEN) and WITH / SELECT / WHEN (selected WHEN).
1) WHEN / ELSE:
assignment WHEN condition ELSE
assignment WHEN condition ELSE
...;
2) WITH / SELECT / WHEN:
WITH identifier SELECT
assignment WHEN value,
assignment WHEN value,
...;
Example
Solution 1
------- Solution 1: with WHEN/ELSE --------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
-------------------------------------------
ENTITY mux IS
PORT ( a, b, c, d: IN STD_LOGIC;
sel: IN STD_LOGIC_VECTOR ( DOWNTO );
y: OUT STD_LOGIC);
END mux;
-------------------------------------------
ARCHITECTURE mux1 OF mux IS
BEGIN
y <= a WHEN sel="" ELSE
b WHEN sel="" ELSE
c WHEN sel="" ELSE
d;
END mux1;
-------------------------------------------
Solution 2
--- Solution 2: with WITH/SELECT/WHEN -----
LIBRARY ieee;
USE ieee.std_logic_1164.all;
-------------------------------------------
ENTITY mux IS
PORT ( a, b, c, d: IN STD_LOGIC;
sel: IN STD_LOGIC_VECTOR ( DOWNTO );
y: OUT STD_LOGIC);
END mux;
-------------------------------------------
ARCHITECTURE mux2 OF mux IS
BEGIN
WITH sel SELECT
y <= a WHEN "", -- notice "," instead of ";"
b WHEN "",
c WHEN "",
d WHEN OTHERS; -- cannot be "d WHEN "11" "
END mux2;
--------------------------------------------
VHDL之concurrent之when的更多相关文章
- VHDL之concurrent之block
1 Simple BLOCK The simple block represents only a way of partitioning the code. It allows concurrent ...
- VHDL之concurrent之generate
GENERATE It is another concurrent statement (along with operators and WHEN). It is equivalent to the ...
- 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 ...
- ConCurrent in Practice小记 (3)
ConCurrent in Practice小记 (3) 高级同步技巧 Semaphore Semaphore信号量,据说是Dijkstra大神发明的.内部维护一个许可集(Permits Set),用 ...
- ConCurrent in Practice小记 (2)
Java-ConCurrent2.html :first-child{margin-top:0!important}img.plugin{box-shadow:0 1px 3px rgba(0,0,0 ...
- VHDL基础1
Description Structure 一个可综合的VHDL描述中一般由3部分组成:LIBRARY declarations.ENTITY.ARCHITECTURE Library(库)用来设计重 ...
- 多线程爬坑之路-学习多线程需要来了解哪些东西?(concurrent并发包的数据结构和线程池,Locks锁,Atomic原子类)
前言:刚学习了一段机器学习,最近需要重构一个java项目,又赶过来看java.大多是线程代码,没办法,那时候总觉得多线程是个很难的部分很少用到,所以一直没下决定去啃,那些年留下的坑,总是得自己跳进去填 ...
随机推荐
- 小白神器 - 一篇博客学会HTML
小白神器 - 一篇博客学会HTML 一. 简介 1. HTML 定义 htyper text markup language 即超文本标记语言. 超文本: 就是指页面内可以包含图片.链接,甚至音乐. ...
- unigui菜单【3】
unigui菜单TuniTreeView 根据数据库表中的内容,显示菜单的处理: function TMainForm.CreateMenu: Integer; var myMenuPoint : P ...
- redis学习五,redis集群搭建及添加主从节点
redis集群 java架构师项目实战,高并发集群分布式,大数据高可用,视频教程 在redis3.0之前,出现了sentinel工具来监控各个Master的状态(可以看上一篇博客).如果Master异 ...
- Istio是啥?一文带你彻底了解!
原标题:Istio是啥?一文带你彻底了解! " 如果你比较关注新兴技术的话,那么很可能在不同的地方听说过 Istio,并且知道它和 Service Mesh 有着牵扯. 这篇文章可以作为了解 ...
- springboot优雅的关闭应用
使用actuator,通过发送http请求关闭 将应用注册为linux服务,通过service xxx stop关闭 具体这两种方式如何实现,这里就不说了,网上百度一堆,主要讲一下在这两种情况下web ...
- Square words(codevs 3301)
题目描述 Description 定义square words为: 1.长度为偶数. 2.前一半等于后一半. 比如abcabc和aaaa都是square words,但是abcabcab和aaaaa都 ...
- [bzoj2213][Poi2011]Difference_动态规划
Difference bzoj-2213 Poi-2011 题目大意:已知一个长度为n的由小写字母组成的字符串,求其中连续的一段,满足该段中出现最多的字母出现的个数减去该段中出现最少的字母出现的个数最 ...
- 如何拿CSDN博客上的原图
比如带水印的地址: http://img.blog.csdn.net/20140408122234546?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdT ...
- dataguard switchover to physical stnadby
首先做一系列的check check 当前primary 的 standby redo log是否存在 SQL> select * from v$logfile; GROUP# STATUS T ...
- MongoDB学习笔记一:MongoDB的下载和安装
MongoDB学习笔记一:MongoDB的下载和安装 趁着这几天比較空暇,准备学习一下MongoDB数据库.今天就简单的学习了一些MongoDB的下载和安装.并创建了存储MongoDB的数据仓库. 将 ...