当前位置: 首页 > news >正文

校园网站建设的要素新开发的app怎么推广

校园网站建设的要素,新开发的app怎么推广,dedecms 网站首页,wordpress 4.2.8关注 望森FPGA 查看更多FPGA资讯 这是望森的第 10 期分享 作者 | 望森 来源 | 望森FPGA 目录 1 Half adder | 半加器 2 Full adder | 全加器 3 3-bit binary adder | 3位二进制加法器 4 Adder | 加法器 5 Signed addition overflow | 有符号数的加法溢出 6 100-bit bi…

关注 望森FPGA  查看更多FPGA资讯

这是望森的第 10 期分享

作者 | 望森
来源 | 望森FPGA

目录

1 Half adder | 半加器

2 Full adder | 全加器

3 3-bit binary adder | 3位二进制加法器

4 Adder | 加法器

5 Signed addition overflow | 有符号数的加法溢出

6 100-bit binary adder | 100位二进制加法器

7 4-digit BCD adder | 4位BCD加法器


本文中的代码都能够正常运行,请放心食用😋~

练习的官方网站是:https://hdlbits.01xz.net/

注:作者将每个练习的知识点都放在了题目和答案之后


1 Half adder | 半加器

题目:

创建一个半加器。半加器将两位相加(无进位),然后得出和与进位。

答案:

module top_module( input a, b,output cout, sum );always@(*) beginsum = a ^ b;cout = a & b;endendmodule

2 Full adder | 全加器

题目:

创建一个全加器。全加器将三位(包括进位)相加,并得出和与进位。

答案:

module top_module( input a, b, cin,output cout, sum );always@(*) beginsum = a ^ b ^ cin;cout = a & b | a & cin | b & cin;endendmodule

3 3-bit binary adder | 3位二进制加法器

题目:

现在您已经知道如何构建全加器,请创建 3 个实例以创建 3 位二进制行波进位加法器。该加法器将两个 3 位数和一个进位相加,以产生 3 位和并输出进位。为了鼓励您实际实例化全加器,还要在行波进位加法器中输出每个全加器的进位。cout[2] 是最后一个全加器的最终进位,也是您通常看到的进位。

答案:

module top_module( input [2:0] a, b,input cin,output [2:0] cout,output [2:0] sum );full_adder adder0(.a(a[0]),.b(b[0]),.cin(cin),.cout(cout[0]),.sum(sum[0]));full_adder adder1(.a(a[1]),.b(b[1]),.cin(cout[0]),.cout(cout[1]),.sum(sum[1]));full_adder adder2(.a(a[2]),.b(b[2]),.cin(cout[1]),.cout(cout[2]),.sum(sum[2]));endmodulemodule full_adder( input a, b, cin,output cout, sum );always@(*) beginsum = a ^ b ^ cin;cout = a & b | a & cin | b & cin;endendmodule

4 Adder | 加法器

题目:

实现以下电路:

("FA" is a full adder)

答案:

module top_module (input [3:0] x,input [3:0] y, output [4:0] sum);wire [2:0] cout;full_adder adder0(.a(x[0]),.b(y[0]),.cin(1'b0),.cout(cout[0]),.sum(sum[0]));full_adder adder1(.a(x[1]),.b(y[1]),.cin(cout[0]),.cout(cout[1]),.sum(sum[1]));full_adder adder2(.a(x[2]),.b(y[2]),.cin(cout[1]),.cout(cout[2]),.sum(sum[2]));full_adder adder3(.a(x[3]),.b(y[3]),.cin(cout[2]),.cout(sum[4]),.sum(sum[3]));endmodulemodule full_adder( input a, b, cin,output cout, sum );always@(*) beginsum = a ^ b ^ cin;cout = a & b | a & cin | b & cin;endendmodule
参考答案:
module top_module (input [3:0] x,input [3:0] y,output [4:0] sum
);// This circuit is a 4-bit ripple-carry adder with carry-out.assign sum = x+y;        // Verilog addition automatically produces the carry-out bit.// Verilog quirk: Even though the value of (x+y) includes the carry-out, (x+y) is still considered to be a 4-bit number (The max width of the two operands).// This is correct:// assign sum = (x+y);// But this is incorrect:// assign sum = {x+y};        // Concatenation operator: This discards the carry-out
endmodule

5 Signed addition overflow | 有符号数的加法溢出

题目:

假设有两个 8 位 2 的补码数,a[7:0] 和 b[7:0]。这两个数相加得到 s[7:0]。还要计算是否发生了(有符号)溢出。

答案:

module top_module (input [7:0] a,input [7:0] b,output [7:0] s,output overflow
); //wire [8:0] sum;assign sum = {a[7],a} + {b[7],b};assign s = sum[7:0];assign overflow = sum[8] ^ sum[7];endmodule

知识点:

提示:当两个正数相加产生负数,或者两个负数相加产生正数时,就会发生带符号溢出。有几种检测溢出的方法:可以通过比较输入和输出数字的符号来计算溢出,也可以从位n和n-1的进位导出溢出。


6 100-bit binary adder | 100位二进制加法器

题目:

创建一个 100 位二进制加法器。该加法器将两个 100 位数字和一个进位相加,得到一个 100 位和及进位输出。

答案:

module top_module( input [99:0] a, b,input cin,output cout,output [99:0] sum );wire [100:0] a_t,b_t;assign a_t = {1'b0,a};assign b_t = {1'b0,b};assign {cout,sum} = a_t + b_t + cin;endmodule
参考答案:
module top_module (input [99:0] a,input [99:0] b,input cin,output cout,output [99:0] sum
);// The concatenation {cout, sum} is a 101-bit vector.assign {cout, sum} = a+b+cin;endmodule

7 4-digit BCD adder | 4位BCD加法器

题目:

为您提供了一个名为 bcd_fadd 的 BCD(二进制编码的十进制)一位数加法器,它将两个 BCD 数字和进位相加,并产生一个和及进位输出。

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

实例化 bcd_fadd 的 4 个副本以创建一个 4 位 BCD 行波进位加法器。您的加法器应将两个 4 位 BCD 数字(打包成 16 位向量)和一个进位相加,以产生一个 4 位和及进位输出。

答案:

module top_module ( input [15:0] a, b,input cin,output cout,output [15:0] sum );wire [2:0] cout_t;bcd_fadd addr0(.a(a[3:0]),.b(b[3:0]),.cin(cin),.cout(cout_t[0]),.sum(sum[3:0]));bcd_fadd addr1(.a(a[7:4]),.b(b[7:4]),.cin(cout_t[0]),.cout(cout_t[1]),.sum(sum[7:4]));bcd_fadd addr2(.a(a[11:8]),.b(b[11:8]),.cin(cout_t[1]),.cout(cout_t[2]),.sum(sum[11:8]));bcd_fadd addr3(.a(a[15:12]),.b(b[15:12]),.cin(cout_t[2]),.cout(cout),.sum(sum[15:12]));endmodule

- END -

公z号/CSDN搜索【望森FPGA】,查看更多FPGA资讯~

相关文章请到我的主页查看

http://www.hkea.cn/news/227554/

相关文章:

  • 做最好的言情网站官网seo优化
  • 云南建设监理协会网站营销失败案例分析
  • 怎么样做淘宝优惠券网站搜索引擎营销的优缺点
  • wordpress动态订单seo社区
  • 网站域没到期不能续费吗google谷歌搜索
  • 厦门好的做网站公司网络营销推广方式都有哪些
  • 重庆市建设工程信息官网站自己做网站的流程
  • 网站建设公司怎么做网络营销网站推广
  • 360应用商店seo服务套餐
  • 废橡胶网站建设个人博客网页设计
  • 什么网站做一手项目好域名查询官网
  • 做日用品的要找什么网站好站长工具端口检测
  • 贵州软件开发 网站开发手机版百度一下
  • 企业网站建立答辩问题百度怎么发布广告
  • 温州快建网站地推拉新接单网
  • 濉溪县城乡建设委员会燃气办网站热狗网站排名优化外包
  • 网站能不能自己做免费的seo教程
  • 湖南的商城网站建设优化教程网下载
  • 做网站需要哪些工程师西安seo诊断
  • tp做的网站封装成app2023北京封控了
  • 增城做网站要多少钱推广普通话手抄报
  • 石家庄网站系统开发智能搜索引擎
  • 迅速网站网络营销平台推广方案
  • 学前端要逛那些网站微信引流主动被加软件
  • 韩国flash网站免费手机网站建站平台
  • 东莞做网站卓诚网络昆明长尾词seo怎么优化
  • WordPress个性萌化插件郑州seo优化哪家好
  • 专业手机移动网站建设免费的seo优化
  • 西安网站建设王永杰域名注册 万网
  • 网站营销优化方案北京做的好的seo公司