
Verilog刷题
不知道叫啥好一点
这个作者很懒,什么都没留下…
展开
-
双边沿D触发器(Dual edge D flip flop)
在FPGA中不支持 always @(posedge clk or negedge clk) is not accepted as a legal sensitivity list.想要实现双边沿触发其实很简单,只要两个always块就行always @(posedge clk)和always @(negedge clk)原创 2020-07-24 15:43:59 · 3021 阅读 · 3 评论 -
D触发器实现JK触发器
实现电路代码module top_module ( input clk, input j, input k, output reg Q); always @(posedge clk)begin Q <= (j&(~Q))|(~k&Q); endendmodule综合电路原创 2020-07-24 15:07:25 · 12364 阅读 · 0 评论 -
将组合逻辑放到时序逻辑中
需要实现的电路代码代码1module top_module ( input clk, input in, output reg out); reg d; always@(*) d = in^out; always@(posedge clk)begin out <= d; end endmodule生成电路代码2module top_module ( input clk,原创 2020-07-24 14:14:40 · 1643 阅读 · 0 评论 -
Verilog中的Latch
Latch介绍功能描述Latches are level-sensitive (not edge-sensitive) circuits, so in an always block, they use level-sensitive sensitivity lists.However, they are still sequential elements, so should use non-blocking assignments.A D-latch acts like a wire (or原创 2020-07-24 11:14:04 · 5108 阅读 · 0 评论 -
Verilog刷题-18-Vectorr
题目描述文字描述Given an 8-bit input vector [7:0], reverse its bit ordering.图示无代码module top_module( input [7:0] in, output [7:0] out); assign out = {in[0],in[1],in[2],in[3],in[4],in[5],in[6],in[7]};endmodule结果题目网址https://hdlbits.01xz.n原创 2020-07-09 17:18:50 · 1341 阅读 · 0 评论 -
Verilog刷题-17-Vector3
题目描述文字描述Given several input vectors, concatenate them together then split them up into several output vectors. There are six 5-bit input vectors: a, b, c, d, e, and f, for a total of 30 bits of input. There are four 8-bit output vectors: w, x, y, and z,原创 2020-07-09 17:10:40 · 928 阅读 · 0 评论 -
Verilog刷题-16-Gate4
题目描述文字描述Build a combinational circuit with four inputs, in[3:0].There are 3 outputs:out_and: output of a 4-input AND gate.out_or: output of a 4-input OR gate.out_xor: output of a 4-input XOR gate.图示无代码module top_module( input [3:0] i原创 2020-07-09 16:58:43 · 1583 阅读 · 4 评论 -
Verilog刷题-15-Vectorgates
题目描述文字描述Build a circuit that has two 3-bit inputs that computes the bitwise-OR of the two vectors, the logical-OR of the two vectors, and the inverse (NOT) of both vectors. Place the inverse of b in the upper half of out_not (i.e., bits [5:3]), and the原创 2020-07-09 16:32:54 · 2099 阅读 · 1 评论 -
Verilog刷题-14-Vector2
题目描述文字描述A 32-bit vector can be viewed as containing 4 bytes (bits [31:24], [23:16], etc.). Build a circuit that will reverse the byte ordering of the 4-byte word.一句话来说就是将32位输入数据倒腾倒腾:AaaaaaaaBbbbbbbbCcccccccDddddddd => DdddddddCcccccccBbbbbbbbAaaaaa原创 2020-07-09 15:47:22 · 799 阅读 · 0 评论 -
Verilog刷题-13-Vector1
题目描述文字描述Build a combinational circuit that splits an input half-word (16 bits, [15:0] ) into lower [7:0] and upper [15:8] bytes.一句话描述:将16位输入数据拆分成高8位和低8位数据图示无代码module top_module( input wire [15:0] in, output wire [7:0] out_hi, output w原创 2020-07-09 15:38:50 · 776 阅读 · 0 评论 -
Verilog刷题-12-Vector0
题目描述文字描述Build a circuit that has one 3-bit input, then outputs the same vector, and also splits it into three separate 1-bit outputs. Connect output o0 to the input vector’s position 0, o1 to position 1, etc.一句话,就是看下面图示。图示代码module top_module (原创 2020-07-09 15:33:13 · 521 阅读 · 0 评论 -
Verilog刷题-11-7458
题目描述文字描述The 7458 is a chip with four AND gates and two OR gates. This problem is slightly more complex than 7420.Create a module with the same functionality as the 7458 chip. It has 10 inputs and 2 outputs. You may choose to use an assign statement to原创 2020-07-09 15:28:56 · 1016 阅读 · 0 评论 -
Verilog刷题-10-Wire_dec
题目描述文字描述The circuits so far have been simple enough that the outputs are simple functions of the inputs. As circuits become more complex, you will need wires to connect internal components together. When you need to use a wire, you should declare it in原创 2020-07-09 15:01:42 · 486 阅读 · 1 评论 -
Verilog刷题-9-Xnorgate
题目描述文字描述Create a module that implements an XNOR gate.图示代码module top_module( input a, input b, output out ); //assign out = ~(a^b); assign out = ~((a&(~b))|((~a)&b));endmodule结果原创 2020-07-09 14:48:32 · 1892 阅读 · 1 评论 -
Verilog刷题-8-Norgate
题目描述文字描述Create a module that implements a NOR gate. A NOR gate is an OR gate with its output inverted. A NOR function needs two operators when written in Verilog.图示代码module top_module( input a, input b, output out ); assign out = ~原创 2020-07-09 14:41:27 · 1291 阅读 · 0 评论 -
Verilog刷题-7-Andgate
题目描述文字描述Create a module that implements an AND gate.图示代码module top_module( input a, input b, output out ); assign out = a&b;endmodule结果原创 2020-07-09 14:38:08 · 415 阅读 · 0 评论 -
Verilog刷题-6-Notgate
题目描述文字描述Create a module that implements a NOT gate.图示代码module top_module( input in, output out ); assign out = ~in; //按位非 //assign out = !in; //逻辑非endmodule结果原创 2020-07-09 14:31:55 · 365 阅读 · 0 评论 -
Verilog刷题-5-Wire4
题目描述文字描述图示:代码module top_module( input a,b,c, output w,x,y,z ); assign w = a; assign x = b; assign y = b; assign z = c; // assign {w,x,y,z} = {a,b,b,c}; //参考答案endmodule结果原创 2020-07-09 14:27:29 · 261 阅读 · 0 评论 -
Verilog刷题-4-Wire
题目描述输入:in输出:out令输出信号和输入信号一致。代码module top_module( input in, output out ); assign out = in;endmodule结果原创 2020-07-09 14:20:56 · 266 阅读 · 0 评论 -
Verilog刷题-3-Zero
代码module top_module( output zero);// Module body starts after semicolon assign zero = 1'b0;endmodule结果同样,这里的Warning也是题目要求。话说这有点太简单原创 2020-07-09 14:13:05 · 502 阅读 · 0 评论 -
Verilog刷题-2-Build a circuit with no inputs and one output. That output should always drive 1
代码module top_module( output one );// Insert your code here assign one = 1'b1;endmodule结果这里的warning没啥问题,因为就是题目的要求。原创 2020-07-09 14:08:20 · 1502 阅读 · 0 评论 -
Verilog刷题-1-网站介绍
刷题网站先上网站https://hdlbits.01xz.net/wiki/Main_Page是兄弟就geng我一起网站描述HDLBits是练习Verilog的网站,和Leetcode有点类似。HDLBits是一个小电路设计练习的集合,用于实践数字硬件设计使用Verilog硬件描述语言/HDL,前面的问题有教程的风格,而后面的问题将逐渐挑战你的电路设计技能。如何使用选择一个问题写Verilog代码提交,仿真,调试题目难度和组织结构网站一共有6个Topics分别为Gettin原创 2020-07-09 13:47:17 · 3751 阅读 · 1 评论