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


    One drawback of the ripple carry adder (See previous exercise) is that the delay for an adder to compute the carry out (from the carry-in, in the worst case) is fairly slow, and the second-stage adder cannot begin computing its carry-out until the first-stage adder has finished. This makes the adder slow. One improvement is a carry-select adder, shown below. The first-stage adder is the same as before, but we duplicate the second-stage adder, one assuming carry-in=0 and one assuming carry-in=1, then using a fast 2-to-1 multiplexer to select which result happened to be correct.

    纹波进位加法器的一个缺点(参见前面的练习)是加法器计算进位的延迟(从进位,在最坏的情况下)相当慢,并且第二级加法器无法开始计算其执行直到第一级加法器完成。这使加法器变慢。一种改进是进位选择加法器,如下所示。第一级加法器与之前相同,但我们复制第二级加法器,一个假设进位=0,一个假设进位=1,然后使用快速2对1多路复用器选择哪个结果碰巧是正确的。

    In this exercise, you are provided with the same module add16 as the previous exercise, which adds two 16-bit numbers with carry-in and produces a carry-out and 16-bit sum. You must instantiate three of these to build the carry-select adder, using your own 16-bit 2-to-1 multiplexer.

    在本练习中,为您提供与前一练习相同的模块 add16,它将两个 16 位数字与进位相加,并产生一个进位和 16 位和。您必须使用您自己的 16 位 2 对 1 多路复用器来实例化其中的三个以构建进位选择加法器。

    Connect the modules together as shown in the diagram below. The provided module add16 has the following declaration:

    如下图所示将模块连接在一起。提供的模块 add16 具有以下声明:

    module add16 ( input[15:0] a, input[15:0] b, input cin, output[15:0] sum, output cout );

     

    Module Declaration

    module top_module(
        input [31:0] a,
        input [31:0] b,
        output [31:0] sum
    );
    1. module top_module(
    2. input [31:0] a,
    3. input [31:0] b,
    4. output [31:0] sum
    5. );
    6. wire carry;
    7. wire [31:16] sum0;
    8. wire [31:16] sum1;
    9. add16 al(a[15:0],b[15:0],1'b0,sum[15:0],carry);
    10. add16 ah0(a[31:16],b[31:16],1'b0,sum0[31:16],);
    11. add16 ah1(a[31:16],b[31:16],1'b1,sum1[31:16],);
    12. assign sum[31:16] = carry?sum1:sum0;
    13. endmodule

     

  • 相关阅读:
    Python中Mock和Patch的区别
    【原创】H3C路由器OSPF测试
    java计算机毕业设计足球赛会管理系统源程序+mysql+系统+lw文档+远程调试
    【前段工程化】node运行npm run 命令的时候报错JavaScript heap out of memory 内存超限
    AI大模型日报#0420:开源模型击败GPT-4、西湖大学蛋白质通用大模型、GPT的七条经验
    指针和数组笔试题深度剖析
    P1830 轰炸III
    前端注释工具的优雅使用指南
    异步编程 - 05 基于JDK中的Future实现异步编程(中)_CompletableFuture
    【Java】[junit] (一)Java 测试入门 ,junit的基本操作 ,@Test等注解的用法
  • 原文地址:https://blog.csdn.net/m0_58153897/article/details/126416807
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | 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号