HDLBits学习笔记(44~50)

HDLBits学习笔记(44~50)

学习阶段:有问题发873727286@qq.com大家一起讨论。

题目44 Exams/m2014 q4h

题干:Implement the following circuit:
在这里插入图片描述
题目大意:实现如下所示电路。

题目分析:assign连续赋值。

答案:

module top_module (
    input in,
    output out);
	assign out = in;
endmodul

题目45 Exams/m2014 q4i

题干:Implement the following circuit:
在这里插入图片描述

题目分析:out接地输出恒为零,用连续赋值语句。

答案:

module top_module (
    output out);
	assign out = 1'b0;
endmodule

题目46 Exams/m2014 q4e

题干:Implement the following circuit:
在这里插入图片描述
题目分析:输入输出通过或非门连接输出out,组合逻辑电路使用连续赋值语句。

答案:

module top_module (
    input in1,
    input in2,
    output out);
    assign out = ~(in1|in2);
endmodule

题目47 Exams/m2014 q4f

题干:Implement the following circuit:在这里插入图片描述
题目分析:输入in1与in2的非通过与门与out相连。组合逻辑电路用连续赋值语句。

答案:

module top_module (
    input in1,
    input in2,
    output out);
    assign out = (in1)&(~in2);
endmodule

题目48 Exams/m2014 q4g

题干:Implement the following circuit:
在这里插入图片描述
题目分析:输入in1 in2通过异或非门连接,其输出值与输入值in3通过异或门,与out相连。

答案:

module top_module (
    input in1,
    input in2,
    input in3,
    output out);
    assign out = ~((in1)^(in2))^(in3);
endmodule

题目49 Gates

题干:Build a combinational circuit with two inputs, a and b.There are 7 outputs, each with a logic gate driving it:

out_and: a and b
out_or: a or b
out_xor: a xor b
out_nand: a nand b
out_nor: a nor b
out_xnor: a xnor b
out_anotb: a and-not b

题目大意:构建一个两个输入a,b七个输出组合逻辑电路。

题目分析:按照要去分别用assign去赋值。

答案:

module top_module( 
    input a, b,
    output out_and,
    output out_or,
    output out_xor,
    output out_nand,
    output out_nor,
    output out_xnor,
    output out_anotb
);
    assign out_and = a&b;
    assign out_or  = a|b;
    assign out_xor = a^b;
    assign out_nand= ~out_and;
    assign out_nor = ~out_or;
    assign out_xnor= ~out_xor;
    assign out_anotb=  a&(~b);
endmodule

题目50 7420

题干:The 7420 is a chip with two 4-input NAND gates.
Create a module with the same functionality as the 7420 chip. It has 8 inputs and 2 outputs.
在这里插入图片描述
题目大意:按图完成7420芯片的电路搭建。

题目分析:两个四输入与非门。使用连续赋值语句完成。

答案:

module top_module ( 
    input p1a, p1b, p1c, p1d,
    output p1y,
    input p2a, p2b, p2c, p2d,
    output p2y );
    assign p1y = ~(p1a&p1b&p1c&p1d);
    assign p2y = ~(p2a&p2b&p2c&p2d);
endmodule
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值