当前位置:网站首页>【Verilog向SystemVerilog过渡遇到的问题】~ 信号变量类型的转变、 == 和 ===的区别
【Verilog向SystemVerilog过渡遇到的问题】~ 信号变量类型的转变、 == 和 ===的区别
2022-06-13 11:11:00 【AI很不错呦】
1. 信号变量类型的转变(reg、wire ===> logic)
很多刚开始学习SV的朋友不理解 为什么 Verilog 中的reg和wire直接可以改成logic运行,确实如此,这是不会有任何编译错误的。但是,随着学习的深入,我觉得有必要理清楚他们的关系。
区别如下:
- reg 或者 wire 它是 类型;而我们的logic是 数据类型;不能相提并论,我们的logic可以和bit相提并论。
- reg原本的作用是储存数据,对应于SV中的var logic,SV默认就是var型的,所以这就是一般我们不去写出var,而直接写logic的原因;wire就相当于一根线连接就完事了,在SV中我们可以写成wire logic。
- 在SV当中,如果我们用于驱动数据的时候,用logic(var logic)就行;如果我们是用于监测数据的时候,我们一般是用wire logic,虽然此时也可以用logic,这就看我们怎么理解了,监测也可以理解成将被监测的数据保存下来。这就因人而异了。
2. 关于 == 和 === , != 和 !== 的区别
== 和 != :这两种表示逻辑符合与逻辑不符合。只能比较’0’和’1’;如若其中存在有x或者z,那么得到的结果 则是z。
=== 和 !== : 表示全等符号,可以比较x和z,严格匹配x与z,但此条语句不可综合。
代码举例:点击查看
==============================================================================
持续更新中…
边栏推荐
- Actual combat analysis of malicious code lab05-01
- 【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
- 判定二分图和二分图最大匹配
- [tcapulusdb knowledge base] tcapulusdb tmonitor module architecture introduction
- ST表学习
- Easyclick run code snippet out null
- 作为一个测试人员,这些基础知识必不可少
- Folder data synchronization tool sync folders Pro
- C#/VB.NET 在Word转PDF时生成目录书签
- The road of ospo construction of Weibo: how to promote enterprise open source through ospo construction?
猜你喜欢

Meta universe land: what makes digital real estate valuable

数据库学习笔记(第十六章)

The leader said he would go online tomorrow, but he didn't know the development process at all
![[tcapulusdb knowledge base] tcapulusdb cluster management introduction](/img/c1/62276c344ded6c260070f0d60bce81.png)
[tcapulusdb knowledge base] tcapulusdb cluster management introduction

Vivo large scale kubernetes cluster automation operation and maintenance practice

Database learning notes (Chapter 15)

2021CCPC网络赛榜单

Go 要加个箭头语法,这下更像 PHP 了!

MIIdock文件分布

终于,月入 20000 !!
随机推荐
COM的模式变化引起的IPdu Handling【接收截止日期监控】
[tcapulusdb knowledge base] tcapulusdb cluster management introduction
Apache APISIX v2.14.1 探索性版本发布,进军更多领域
socket编程(中)
【TcaplusDB知识库】Tmonitor后台一键安装介绍(二)
Environ. Sci. Technol. (if=9.028) | impact of urban greening on atmospheric environment
宝塔中navicat连接mysql
数据库学习笔记(第十六章)
判定二分图和二分图最大匹配
Similarities and differences between commonAPI and AUTOSAR AP communication management
区间修改乘和加(理解懒标记的好例题)
22. Class E power amplifier design of ads usage record (Part 2)
宝塔添加一个网站:PHP项目
Socket programming (Part 1)
Nature communications - modeling armed conflict risk under climate change using machine learning and time series data
Vivo large scale kubernetes cluster automation operation and maintenance practice
第七章 文件管理作业
21世纪以来的历次“粮食危机”,发生了什么?
[tcapulusdb knowledge base] Introduction to tmonitor background one click installation (II)
很妙的贪心(F2. Nearest Beautiful Number (hard version))