VHDL 字符替换在现实生活中使用过吗?
VHDL 允许以下替换,大概是因为某些计算机可能不支持竖线(或管道符号)(|) 或散列(或井号/数字符号)(#):
case A|B
可以写成 case A!B
16#fff#
可以写成 16:fff:
现在任何计算机都支持竖线和哈希符号,所以我认为没有人使用这些替换...直到有人请求支持感叹号。
我的问题:这是一个单独的案例还是其他人也使用感叹号来代替竖线?有人用冒号吗?
VHDL allows the following substitutions, presumably because some computers might not support the vertical bar (or pipe symbol) (|) or the hash (or pound sign / number sign) (#):
case A|B
can be written as case A!B
16#fff#
can be written as 16:fff:
Any computer nowadays supports the vertical bar and the hash symbol, so I figured nobody uses these substitutions... Until somebody requested support for the exclamation mark.
My question: is this a lone case or are other people also using the exclamation mark as substitute for the vertical bar? Anybody using the colon?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
数据点 1:不是我:)
据我所知,我从未在任何代码中见过它 - 也没有在任何时候教过它(事实上,这是我第一次知道这些替换)。
我快速浏览了一下 Ashenden 的 VHDL 设计指南,当为
引入
语句。|
时,甚至没有提到!
替代方案caseData point 1: Not me :)
And I've never seen it as far as I recall in any code - nor was I taught it at any point (in fact, this is the first I knew of those substitutions).
I had a quick look in Ashenden's Designer's Guide to VHDL, and the
!
alternative is not even mentioned when the|
is introduced forcase
statements.这些是从 Ada 继承的(其中它们自 Ada95 起就已过时)。 Ada83 原理说“出于可移植性的原因,可以用 ISO 字符集的 56 个字符子集编写任何程序。”其中ISO字符集必须理解为ISO-646,又名ASCII(ISO-646有规定替换国家变体的一些字符,ASCII可以理解为ISO-646的美国国家变体)
还有第三种替换: % 可以代替 " 作为字符串分隔符(两者都必须替换)。
我似乎记得 EBCDIC 根据变体使用 | 或 ! 表示相同的代码点。
These are inherited from Ada (in which they are obsolescent since Ada95). The Ada83 Rationale says "For portability reasons, it is possible to write any program in a 56 character subset of the ISO character set." in which ISO character set must be understood as ISO-646, aka ASCII (well ISO-646 has provision for replacing some characters for national variant, ASCII can be understood as the US national variant of ISO-646)
There is a third replacement: % can be use instead of " as string delimitor (both must be replaced).
I seem to remember that EBCDIC is using | or ! for the same code point depending on the variant.