- 博客(4)
- 收藏
- 关注
原创 HDLBits(5)----D latch
1. D latchImplement the following circuit:Note that this is a latch, so a Quartus warning about having inferred a latch is expected.module top_module ( input d, input ena, output q); always@(*) begin if(ena) q &
2021-11-16 23:24:29
788
原创 HDLBits(3)_Adder
Exams/m2014 q4j看到这个电路,我的想法是用生成块,把进位相连。module top_module ( input [3:0] x, input [3:0] y, output [4:0] sum); wire [3:0]cout; assign {cout[0],sum[0]} = x[0]+y[0]; genvar i; generate for(i=1;i<4;i=i+1) begin:cot
2021-11-13 00:05:28
489
原创 HDbits(2)-Multiplexers
Multiplexers#Mux256to1题目要求:创建一个 1 位宽,256 比 1 的多路复用器。256 个输入全部包装成一个 256 位输入载体。sel=0 应在 [0] 中选择,sel=1应在 [1] 中选择位,sel=2应选择在 [2] 中选择位,等等。本来以为需要生成块,或者for循环,想了半天都不对,看了看网上大家写的发现原来如此简单,所以把这题记录下来。module top_module( input [255:0] in, input [7:0] sel,
2021-11-11 22:45:05
566
原创 HDLbits(1)—Verilog language
hdlbits 习题Popcount255module top_module( input [254:0] in, output reg [7:0] out ); //reg [7:0] out=0; integer i; always@(*) begin out <= 8'd0; for(i=0;i<255;i=i+1) begin
2021-11-10 23:40:20
289
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅