码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Verilog学习之Andgate


    Create a module that implements an AND gate.

    创建一个实现与门的模块。

    This circuit now has three wires (a, b, and out). Wires a and b already have values driven onto them by the input ports. But wire out currently is not driven by anything. Write an assign statement that drives out with the AND of signals a and b.

    该电路现在有三根线(a、b 和 out)。连线 a 和 b 已经有输入端口驱动到它们的值。但是目前的wire out不是由任何东西驱动的。编写一个用信号 a 和 b 的 AND 驱动的赋值语句。

    Note that this circuit is very similar to the NOT gate, just with one more input. If it sounds different, it's because I've started describing signals as being driven (has a known value determined by something attached to it) or not driven by something. Input wires are driven by something outside the module. assign statements will drive a logic level onto a wire. As you might expect, a wire cannot have more than one driver (what is its logic level if there is?), and a wire that has no drivers will have an undefined value (often treated as 0 when synthesizing hardware).

    请注意,该电路与非门非常相似,只是多了一个输入。如果听起来不同,那是因为我已经开始将信号描述为被驱动(具有由附加的东西决定的已知值)或不被某物驱动。输入线由模块外部的东西驱动。分配语句会将逻辑电平驱动到线路上。如您所料,一条线不能有多个驱动程序(如果有,它的逻辑级别是多少?),没有驱动程序的线将有一个未定义的值(在综合硬件时通常被视为 0)。

     

    Module Declaration

    module top_module( 
        input a, 
        input b, 
        output out );

    Verilog has separate bitwise-AND (&) and logical-AND (&&) operators, like C. Since we're working with a one-bit here, it doesn't matter which we choose.

    Verilog 有单独的按位与 (&) 和逻辑与 (&&) 运算符,就像 C 一样。由于我们在这里使用一位,所以我们选择哪个并不重要。

     

    1. module top_module(
    2. input a,
    3. input b,
    4. output out );
    5. assign out = a&&b;
    6. endmodule

     

  • 相关阅读:
    MAC上使用Wireshark常见问题
    Vue项目中使用element-plus的el-table组件-组件使用-样式修改
    Okaleido tiger NFT即将登录Binance NFT平台,NFT权益时代即将开启
    JavaScript 数据结构相关知识点 如何判断对象是否为空
    Seal库官方示例(三):levels.cpp解析
    《小程序从入门到入坑》框架语法
    std::async简单使用
    网络系统结构与设计的基本原则
    【网络安全 ---- 靶场搭建】凡诺企业网站管理系统靶场详细搭建过程(asp网站,练习Access数据库的 sql注入)
    聊一聊系统重构
  • 原文地址:https://blog.csdn.net/m0_58153897/article/details/126324196
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号