VHDL中行为和数据流模型程序之间的混淆(Confusion between Behavioural and Dataflow model Programs in VHDL)
我正在使用Douglas L Perry,第四版的教科书“VHDL:Programming By Example”。 他在第4页中给出了Dataflow编程模型的示例:
代码I:
ENTITY mux IS PORT ( a, b, c, d : IN BIT; s0, s1 : IN BIT; x, : OUT BIT); END mux; ARCHITECTURE dataflow OF mux IS SIGNAL select : INTEGER; BEGIN select <= 0 WHEN s0 = ‘0’ AND s1 = ‘0’ ELSE 1 WHEN s0 = ‘1’ AND s1 = ‘0’ ELSE 2 WHEN s0 = ‘0’ AND s1 = ‘1’ ELSE 3; x <= a AFTER 0.5 NS WHEN select = 0 ELSE b AFTER 0.5 NS WHEN select = 1 ELSE c AFTER 0.5 NS WHEN select = 2 ELSE d AFTER 0.5 NS; END dataflow;
现在,在第17页, 代码II
LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; ENTITY mux4 IS PORT ( i0, i1, i2, i3, a, b : IN std_logic; PORT ( i0, i1, i2, i3, a, q : OUT std_logic); END mux4; ARCHITECTURE mux4 OF mux4 IS SIGNAL sel: INTEGER; BEGIN WITH sel SELECT q <= i0 AFTER 10 ns WHEN 0, q <= i1 AFTER 10 ns WHEN 1, q <= i2 AFTER 10 ns WHEN 2, q <= i3 AFTER 10 ns WHEN 3, q <= ‘X’ AFTER 10 ns WHEN OTHERS; sel <= 0 WHEN a = ‘0’ AND b = ‘0’ ELSE 1 WHEN a = ‘1’ AND b = ‘0’ ELSE 2 WHEN a = ‘0’ AND b = ‘1’ ELSE 3 WHEN a = ‘1’ AND b = ‘1’ ELSE 4; END mux4;
根据同一本教科书,这应该是一种行为模型 。 除了变量名称的差异之外,我在这里看到的唯一主要区别是有一个额外的声明
WITH sel SELECT
在第二种情况下,和小的语法差异。 本守则II同时发布。 但是从互联网上的其他来源(如下所列),我已经看到行为模型应该是顺序的。 我应该相信哪一个?
现在来自互联网的其他一些来源,这些模型的定义如下:
行为 - 电路被描述为使用过程内的顺序语句的I / O关系。
数据流 - 使用并发语句描述电路
- 圣何塞州立大学
行为 - 描述输出如何使用结构化语句从输入中获得。
数据流 - 描述数据如何流动。
- 阿克伦大学工程学院
在这里,我不明白结构化陈述的含义。
在行为级别,存在流程关键字
在数据流级别中,存在并发语句(<=)
这是在一个在线论坛上看到的。
行为模型是强制性的流程声明吗?
代码I和II之间的实际差异是什么? 据作者说,他们有不同的模型,数据流和行为。 我看不出这是怎么可能的。 我应该相信什么?
最后,在佩里DL,第45页,46:
LIBRARY IEEE; USE IEEE.std_logic_1164ALL; ENTITY mux IS PORT (i0, i1, i2, i3, a, b : IN std_logic; PORT (q : OUT std_logic); END mux; ARCHITECTURE better OF mux IS BEGIN PROCESS ( i0, i1, i2, i3, a, b ) VARIABLE muxval : INTEGER; BEGIN muxval := 0; IF (a = ‘1’) THEN muxval := muxval + 1; END IF; IF (b = ‘1’) THEN muxval := muxval + 2; END IF; CASE muxval IS WHEN 0 => q <= I0 AFTER 10 ns; WHEN 1 => q <= I1 AFTER 10 ns; WHEN 2 => q <= I2 AFTER 10 ns; WHEN 3 => q <= I3 AFTER 10 ns; WHEN OTHERS => NULL; END CASE; END PROCESS; END better;
这是MUX的顺序版本。 根据其他定义,这应该是行为,但作者没有这样说。 你能否清楚我对这些模型的困惑?
I'm using the textbook "VHDL: Programming By Example" by Douglas L Perry, Fourth Edition. He gave an example of the Dataflow programming model in page 4:
Code I:
ENTITY mux IS PORT ( a, b, c, d : IN BIT; s0, s1 : IN BIT; x, : OUT BIT); END mux; ARCHITECTURE dataflow OF mux IS SIGNAL select : INTEGER; BEGIN select <= 0 WHEN s0 = ‘0’ AND s1 = ‘0’ ELSE 1 WHEN s0 = ‘1’ AND s1 = ‘0’ ELSE 2 WHEN s0 = ‘0’ AND s1 = ‘1’ ELSE 3; x <= a AFTER 0.5 NS WHEN select = 0 ELSE b AFTER 0.5 NS WHEN select = 1 ELSE c AFTER 0.5 NS WHEN select = 2 ELSE d AFTER 0.5 NS; END dataflow;
Now in page 17, Code II
LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; ENTITY mux4 IS PORT ( i0, i1, i2, i3, a, b : IN std_logic; PORT ( i0, i1, i2, i3, a, q : OUT std_logic); END mux4; ARCHITECTURE mux4 OF mux4 IS SIGNAL sel: INTEGER; BEGIN WITH sel SELECT q <= i0 AFTER 10 ns WHEN 0, q <= i1 AFTER 10 ns WHEN 1, q <= i2 AFTER 10 ns WHEN 2, q <= i3 AFTER 10 ns WHEN 3, q <= ‘X’ AFTER 10 ns WHEN OTHERS; sel <= 0 WHEN a = ‘0’ AND b = ‘0’ ELSE 1 WHEN a = ‘1’ AND b = ‘0’ ELSE 2 WHEN a = ‘0’ AND b = ‘1’ ELSE 3 WHEN a = ‘1’ AND b = ‘1’ ELSE 4; END mux4;
This is supposed to be a behavioural model, as per the same textbook. Aside from the differences in variable name, the only major difference I see here is that there is an extra statement
WITH sel SELECT
in the second case, and small syntax differences. This Code II is concurrent. But from other sources in the internet(listed below), I've seen that a behavioural model is supposed to be sequential. Which one should I believe?
Now from some other sources of the internet, the definition of these models are as follows:
Behavioral – Circuit is described as an i/o relationship using sequential statements inside a process.
Dataflow – Circuit is described using concurrent statements
-San Jose State university
Behavioral – describes how the output is derived from the inputs using structured statements.
Dataflow – describes how the data flows.
-University of Akron College of Engineering
Here I do not understand what structured statements mean.
in Behaviour level, process keyword is present
in dataflow level , concurrent statement (<=) is present
This was seen in an online forum.
Is process statement compulsory for Behavioural model?
What is the actual difference between codes I and II? According to the author, they have different models, dataflow and behavioural. I cannot see how this is possible. What should I believe?
Lastly, in Perry D L, Page 45, 46:
LIBRARY IEEE; USE IEEE.std_logic_1164ALL; ENTITY mux IS PORT (i0, i1, i2, i3, a, b : IN std_logic; PORT (q : OUT std_logic); END mux; ARCHITECTURE better OF mux IS BEGIN PROCESS ( i0, i1, i2, i3, a, b ) VARIABLE muxval : INTEGER; BEGIN muxval := 0; IF (a = ‘1’) THEN muxval := muxval + 1; END IF; IF (b = ‘1’) THEN muxval := muxval + 2; END IF; CASE muxval IS WHEN 0 => q <= I0 AFTER 10 ns; WHEN 1 => q <= I1 AFTER 10 ns; WHEN 2 => q <= I2 AFTER 10 ns; WHEN 3 => q <= I3 AFTER 10 ns; WHEN OTHERS => NULL; END CASE; END PROCESS; END better;
This is a sequential version of MUX. According to the other definitions, this is supposed to be behavioural, but the author does not state so. Could you clear up my confusion regarding these models?
原文:https://stackoverflow.com/questions/18682019
最满意答案
您将分配可排序的分类,并将它们分成两个不同的组。 因此,更改html和Js中其中一个组的类,将它们初始化为另一个组。
You will gave to separate the sortables, and divide them in two different groups. So change the class of one of the groups in html and Js to initialize them as another group.
相关问答
更多-
也许你在编写代码时已经过时了:两次排序,不必要的事件取消,已经连接的连接列表等等。 最后一组陷入底部或消失的问题似乎是每次更新列表时重新附加.sortable()的问题,这是重复发生的意外行为。 但简单地消除这种重复使你的列表不像你所期望的那样行事,所以一些额外的重构是必要的: 1)只使用一个.sortable()调用,然后定义哪些项目可以排序(即分别针对单个和分组排序的.row和.locked )。 对于你的意图已经足够了。 这里唯一的问题是,将一个组拖入另一个组的中间会增加另一个嵌套层次; 2)为了防止 ...
-
jQuery UI Sortable:滚动整个页面以及容器(jQuery UI Sortable: Scroll entire page as well as container)[2022-12-20]
这确实与可滚动溢出冲突。 在这种情况下,可拖动的帮助器元素被限制为其父元素,可能是因为试图“超出”父元素只会导致扩大其可滚动区域。 解决方法是传递一个helper函数,该函数克隆拖拽的元素并将其返回到页面主体下。 这样,可拖动的帮助器元素将从一开始就位于其原始父级之外,因此将滚动整个页面: $(".sort").sortable({ connectWith: ".sort", handle: ".handle", helper: function(event, element) { ... -
您可以通过克隆帮助器元素然后从DOM中删除原始元素来完成此操作。 请注意,您必须清除样式属性,因为它具有position:absolute用于拖动的position:absolute集,这可以防止克隆在ul正确定位。 当然,你可以更详细地了解这一点,并添加/删除类等。 $('.container').droppable( { accept: '.sortable li', drop: function(event, ui) { ui.draggable.clone().attr("sty ...
-
我想你正在寻找收容选项: $(function () { $(".drag_wrapper").sortable({ connectWith: ".drag_wrapper", containment: ".drag_wrapper" }).disableSelection(); }); I think you are looking for the containment option: $(function () { $(".drag_wrapp ...
-
检查你的ajax调用的结果总是一个好主意。 另外,在每次更新时发送整个事件都是浪费资源,因为更新事件被调用来源和目标都可排序。 至于刷新,只需要在需要刷新时设置一个布尔变量,然后将一个事件绑定到.ajaxStop()以在所有Ajax请求完成时运行。 $(function(){ var refreshNeeded = false; $("#draft, #trash, #a_bunch_more_divs, #buttonmaker").sortable({ connectW ...
-
http://jsfiddle.net/MMyP3/5/ 编辑:代码请求: HTML:Element 1Element 4您将分配可排序的分类,并将它们分成两个不同的组。 因此,更改html和Js中其中一个组的类,将它们初始化为另一个组。 You will gave to separate the sortables, and divide them in two different groups. So change the class of one of the groups in html and Js to initialize them as another group.
jQuery UI可以使用.parent()排序项目标准进行排序(jQuery UI Sortable with .parent() Sortable Items Criteria)[2022-09-22]
我认为你要找的是:has-selector $("div.multibuttonset").sortable({ items: '.button:has(.active)' }); 演示: 小提琴 I think what you are looking for is the :has-selector $("div.multibuttonset").sortable({ items: '.button:has(.active)' }); Demo: FiddlejQuery可以使用包含父级和不同的项高度进行排序(jQuery sortable with containment parent and different item heights)[2023-09-07]
添加选项cursorAt: { top:1 }可以解决问题。 链接到文档 。 不幸的是,我后来发现在尝试将高项目拖到列表底部时存在同样的问题。 最后,我的解决方案是破解_intersectsWithPointer函数。 我已经取代了: var c = this.options.axis === "x" || a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, b.top, b.height), 有: var c = this.optio ...使用jQuery ui sortable将项目排序到固定容器中(Sort items into fixed container with jQuery ui sortable)[2022-10-07]
看起来你的not-fixed类元素不是一个设置的宽度,所以它出现在fixed类元素上。 这就是为什么即使你拖过fixed列表它仍然排序你的第一个列表。 尝试像在not-fixed类上设置宽度一样简单。 .not-fixed { width: 50px; } 小提琴 注意:更改父div的宽度将影响可以拖动元素的区域。 玩弄它,看看哪种宽度最适合您的目的。 It looks like your not-fixed class element was not a set width so it was a ...相关文章
更多- 十分钟了解分布式计算:Google Dataflow
- rails model的一点疑惑。。。。。
- Storm数据流模型的分析及讨论
- Hibernate中如何实现一个model和多个表关联
- Cannot expose request attribute 'website' because of an existing model object of the same name 的解决方案
- 微信XML消息model定义之微信公众平台(一)
- 顶 Storm[技术博客] Storm数据流模型的分析以及讨论
- Hadoop MapReduce数据流
- jsp页面表单和数据库之间的动态更新
- Discretized Streams, 离散化的流数据处理
最新问答
更多- h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
- 创建一个功能(Create a function)
- 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
- PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
- Qt冻结循环的原因?(Qt freezing cause of the loop?)
- TableView重复youtube-api结果(TableView Repeating youtube-api result)
- 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
- SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
- 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
- 以编程方式创建UITableView(Creating a UITableView Programmatically)
- 如何打破按钮上的生命周期循环(How to break do-while loop on button)
- C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
- 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
- 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
- Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
- 设置kotlin扩展名(Setting a kotlin extension)
- 如何并排放置两个元件?(How to position two elements side by side?)
- 如何在vim中启用python3?(How to enable python3 in vim?)
- 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
- 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
- Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
- dedecms如何安装?
- 在哪儿学计算机最好?
- 学php哪个的书 最好,本人菜鸟
- 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
- 如何覆盖错误堆栈getter(How to override Error stack getter)
- 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
- USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
- 电脑高中毕业学习去哪里培训
- 正则表达式验证SMTP响应(Regex to validate SMTP Responses)