
HDLBits刷题
李十一11
数字芯片学习者
展开
-
【HDLBits刷题】Countslow.
设计一个0~9的计数器,共10个周期。该计数器采用同步复位且复位为0。但是本题是希望该计数器并不是随着clk的变化而递增,而是随着一个slowena使能信号来控制增加。原创 2022-07-19 23:13:18 · 1470 阅读 · 0 评论 -
【HDLBits刷题】Count1to10.
还是1~10的计数器,唯一不同是同步复位为1.原创 2022-07-19 22:14:36 · 933 阅读 · 0 评论 -
【HDLBits刷题】Count10.
代码】【HDLBits刷题】Count10..原创 2022-07-18 23:11:10 · 741 阅读 · 0 评论 -
【HDLBits刷题】Count15.
设计一个4bit的计数器,从0~15,共16个周期。reset是同步复位且复位为0。原创 2022-07-18 22:38:00 · 713 阅读 · 0 评论 -
【HDLBits刷题】Dualedge..
You're familiar with flip-flops that are triggered on the positive edge of the clock, or negative edge of the clock. A dual-edge triggered flip-flop is triggered on both edges of the clock. However, FPGAs don't have dual-edge triggered flip-flops, and alwa原创 2022-07-12 22:54:59 · 984 阅读 · 0 评论 -
【HDLBits刷题】Edgecapture..
For each bit in a 32-bit vector, capture when the input signal changes from 1 in one clock cycle to 0 the next. "Capture" means that the output will remain 1 until the register is reset (synchronous reset).Each output bit behaves like a SR flip-flop: The o原创 2022-07-06 20:35:31 · 1269 阅读 · 1 评论 -
【HDLBits刷题】Edgedetect2.
For each bit in an 8-bit vector, detect when the input signal changes from one clock cycle to the next (detect any edge). The output bit should be set the cycle after a 0 to 1 transition occurs.Here are some examples. For clarity, in[1] and anyedge[1] are原创 2022-07-06 12:14:28 · 1201 阅读 · 0 评论 -
【HDLBits刷题】Edgedetect.
For each bit in an 8-bit vector, detect when the input signal changes from 0 in one clock cycle to 1 the next (similar to positive edge detection). The output bit should be set the cycle after a 0 to 1 transition occurs.Here are some examples. For clarity,原创 2022-07-05 12:18:05 · 1402 阅读 · 0 评论 -
【HDLBits刷题】Exams/ece241 2013 q7.
A JK flip-flop has the below truth table. Implement a JK flip-flop with only a D-type flip-flop and gates. Note: Qold is the output of the D flip-flop before the positive clock edge.module top_module ( input clk, input j, input k, output Q原创 2022-07-04 21:33:34 · 1493 阅读 · 0 评论 -
【HDLBits刷题】Exams/ece241 2014 q4.
Given the finite state machine circuit as shown, assume that the D flip-flops are initially reset to zero before the machine begins.Build this circuit.开始的时候置0,所以一开始所有的Q都得是0;这个地方放写完之后有个疑惑,就是w1、w2、w3是不是定义成reg类型会更好(reg类型是通过的) ,但是定义成wire类型也是通过了的:mod原创 2022-04-27 18:33:59 · 2827 阅读 · 4 评论 -
【HDLBits刷题】Exams/2014 q4a.
Consider the n-bit shift register circuit shown below:Write a Verilog module named top_module for one stage of this circuit, including both the flip-flop and multiplexers.1、第一种方法是通过抽象方法,从电路最后面看,写出Q输出:module top_module ( input clk, input w, R原创 2022-04-27 12:17:39 · 1740 阅读 · 1 评论 -
【HDLBits刷题】Exams/m2014 q4d.
Implement the following circuit:图中有一个 D 触发器与一个异或门,触发器的输出 q 和输入信号 in 一起作为异或门的输入。异或门的输入作为触发器的输入 dmodule top_module ( input clk, input in, output reg out); always @(posedge clk) begin out <= in ^ out; endendmodule.原创 2022-04-25 22:51:14 · 1601 阅读 · 0 评论 -
【HDLBits刷题】Exams/m2014 q4c.
Implement the following circuit:写一个同步复位的D触发器module top_module ( input clk, input d, input r, // synchronous reset output q); always @(posedge clk)begin if(r) q <= 0; else q <= d;.原创 2022-04-25 21:51:38 · 985 阅读 · 0 评论 -
【HDLBits刷题】Exams/m2014 q4b.
Implement the following circuit:AR 代表 asynchronous reset,所以这是一个带有异步复位的 D 触发器,我们在先前的题目中讨论过异步复位的问题。图中的三角形代表时钟,不再用 CLK 标出。module top_module ( input clk, input d, input ar, // asynchronous reset output q); always @(posedge c原创 2022-04-25 12:25:32 · 1833 阅读 · 0 评论 -
【HDLBits刷题】Exams/m2014 q4a.
Implement the following circuit:Note that this is a latch, so a Quartus warning about having inferred a latch is expected.做一个D触发器module top_module ( input d, input ena, output q); always @(*)begin if(ena) q = d原创 2022-04-24 08:00:12 · 2426 阅读 · 0 评论 -
【HDLBits刷题】Dff16e..
Create 16 D flip-flops. It's sometimes useful to only modify parts of a group of flip-flops. The byte-enable inputs control whether each byte of the 16 registers should be written to on that cycle. byteena[1] controls the upper byte d[15:8], while byteena[原创 2022-04-23 23:14:02 · 2574 阅读 · 3 评论 -
【HDLBits刷题】Dff8ar..
Create 8 D flip-flops with active high asynchronous reset. All DFFs should be triggered by the positive edge of clk.要求创建一个异步清零端的D触发器module top_module ( input clk, input areset, // active high asynchronous reset input [7:0] d, output原创 2022-04-22 19:36:17 · 2717 阅读 · 3 评论 -
【HDLBits刷题】Dff8p.
Create 8 D flip-flops with active high synchronous reset. The flip-flops must be reset to 0x34 rather than zero. All DFFs should be triggered by the negative edge of clk.实现具有高电平同步复位的8个D触发器,同时复位值为0x34,下降沿触发。module top_module ( input clk, input原创 2022-04-22 18:45:54 · 1196 阅读 · 0 评论 -
【HDLBits刷题】Dff8r
Create 8 D flip-flops with active high synchronous reset. All DFFs should be triggered by the positive edge of clk.写一个带reset高电平有效复位的D触发器(时钟是上升沿触发)另外最好把在过程语句中的变量设置成reg格式,比如此处的q。(赋值语句左边的)module top_module ( input clk, input reset, /原创 2022-04-21 22:45:19 · 1432 阅读 · 1 评论 -
【HDLBits刷题】Dff8
Create 8 D flip-flops. All DFFs should be triggered by the positive edge ofclk.module top_module ( input clk, input [7:0] d, output [7:0] q); always @(posedge clk) q <= d;endmodule原创 2022-04-21 22:24:09 · 333 阅读 · 0 评论 -
【HDLBits刷题】Dff.
A D flip-flop is a circuit that stores a bit and is updated periodically, at the (usually) positive edge of a clock signal.D flip-flops are created by the logic synthesizer when aclocked always blockis used (Seealwaysblock2). A D flip-flop is the si...原创 2022-04-21 22:22:33 · 552 阅读 · 0 评论 -
【HDLBits刷题】Exams/ece241 2014 q3.
For the following Karnaugh map, give the circuit implementation using one 4-to-1 multiplexer and as many 2-to-1 multiplexers as required, but using as few as possible. You are not allowed to use any other logic gate and you must useaandbas the multiple...原创 2022-04-21 22:19:17 · 1864 阅读 · 0 评论 -
【HDLBits刷题】Exams/ece241 2013 q2.
A single-output digital system with four inputs (a,b,c,d) generates a logic-1 when 2, 7, or 15 appears on the inputs, and a logic-0 when 0, 1, 4, 5, 6, 9, 10, 13, or 14 appears. The input conditions for the numbers 3, 8, 11, and 12 never occur in this syst原创 2022-04-20 22:10:35 · 3323 阅读 · 0 评论 -
【HDLBits刷题】Kmap4.
Implement the circuit described by the Karnaugh map below.Try to simplify the k-map before coding it. Try both product-of-sums and sum-of-products forms. We can't check whether you have the optimal simplification of the k-map. But we can check if you原创 2022-04-20 20:59:05 · 1422 阅读 · 0 评论 -
【HDLBits刷题】Kmap3.
Implement the circuit described by the Karnaugh map below.Try to simplify the k-map before coding it. Try both product-of-sums and sum-of-products forms. We can't check whether you have the optimal simplification of the k-map. But we can check if you原创 2022-04-20 20:39:59 · 1171 阅读 · 0 评论 -
【HDLBits刷题】Kmap2.
Implement the circuit described by the Karnaugh map below.Try to simplify the k-map before coding it. Try both product-of-sums and sum-of-products forms. We can't check whether you have the optimal simplification of the k-map. But we can check if you原创 2022-04-20 12:22:17 · 1382 阅读 · 0 评论 -
【HDLBits刷题】Kmap1.
Implement the circuit described by the Karnaugh map below.Try to simplify the k-map before coding it. Try both product-of-sums and sum-of-products forms. We can't check whether you have the optimal simplification of the k-map. But we can check if you原创 2022-04-19 23:31:23 · 742 阅读 · 0 评论 -
【HDLBits刷题】Bcdadd4.
You are provided with a BCD (binary-coded decimal) one-digit adder namedbcd_faddthat adds two BCD digits and carry-in, and produces a sum and carry-out.module bcd_fadd ( input [3:0] a, input [3:0] b, input cin, output cout, o..原创 2022-04-19 12:35:47 · 1466 阅读 · 0 评论 -
【HDLBits刷题】Adder100.
Create a 100-bit binary adder. The adder adds two 100-bit numbers and a carry-in to produce a 100-bit sum and carry out.Expected solution length: Around 1 line.弄一个两个100-bit相加的全加器1、第一种module top_module( input [99:0] a, b, input cin, ou原创 2022-04-19 07:55:12 · 1445 阅读 · 1 评论 -
【HDLBits刷题】Exams/ece241 2014 q1c.
Assume that you have two 8-bit 2's complement numbers, a[7:0] and b[7:0]. These numbers are added to produce s[7:0]. Also compute whether a (signed) overflow has occurred.本题讨论的是有符号数相加的溢出问题中,需要实现一个 2 进制 8bit 有符号数加法器,加法器将输入的两个 8bit数补码相加,产生相加之和以及进位。modul原创 2022-04-18 22:23:28 · 2446 阅读 · 0 评论 -
【HDLBits刷题】Exams/m2014 q4j
Implement the following circuit:("FA" is a full adder)1、第一种,就是采用实例化模块的方式来进行:module top_module ( input [3:0] x, input [3:0] y, output [4:0] sum); wire cout0,cout1,cout2; fadd U1(x[0],y[0],0,cout0,sum[0]); fadd U2(x[1],y[1],原创 2022-04-18 12:28:45 · 1407 阅读 · 0 评论 -
【HDLBits刷题】Adder3.
Now that you know how to build afull adder, make 3 instances of it to create a 3-bit binary ripple-carry adder. The adder adds two 3-bit numbers and a carry-in to produce a 3-bit sum and carry out. To encourage you to actually instantiate full adders, als.原创 2022-04-17 23:17:54 · 2061 阅读 · 0 评论 -
【HDLBits刷题】Fadd.
Create a full adder. A full adder adds three bits (including carry-in) and produces a sum and carry-out.Expected solution length: Around 2 lines.1、第一种,拼接:module top_module( input a, b, cin, output cout, sum ); assign {cout,sum} = a + b原创 2022-04-17 22:43:51 · 632 阅读 · 0 评论 -
【HDLBits刷题】Hadd.
Create a half adder. A half adder adds two bits (with no carry-in) and produces a sum and carry-out.Expected solution length: Around 2 lines.1、第一种,利用拼接括号module top_module( input a, b, output cout, sum ); assign {cout,sum} = a + b;endm原创 2022-04-17 22:27:37 · 590 阅读 · 0 评论 -
【HDLBits刷题】Mux256to1v.
Create a 4-bit wide, 256-to-1 multiplexer. The 256 4-bit inputs are all packed into a single 1024-bit input vector. sel=0 should select bits in[3:0], sel=1 selects bits in[7:4], sel=2 selects bits in[11:8], etc.Expected solution length: Around 1–5 lines.原创 2022-04-17 19:47:29 · 1177 阅读 · 0 评论 -
【HDLBits刷题】Mux256to1.
Create a 1-bit wide, 256-to-1 multiplexer. The 256 inputs are all packed into a single 256-bit input vector. sel=0 should select in[0], sel=1 selects bits in[1], sel=2 selects bits in[2], etc.Expected solution length: Around 1 line.256选1数据选择器,不用case,不.原创 2022-04-17 19:30:20 · 800 阅读 · 0 评论 -
【HDLBits刷题】Gatesv100.
See also the shorter version:Gates and vectors.You are given a 100-bit input vector in[99:0]. We want to know some relationships between each bit and its neighbour:out_both: Each bit of this output vector should indicate whetherboththe corresponding...原创 2022-04-16 21:03:35 · 963 阅读 · 0 评论 -
【HDLBits刷题】Gatesv.
You are given a four-bit input vector in[3:0]. We want to know some relationships between each bit and its neighbour:out_both: Each bit of this output vector should indicate whetherboththe corresponding input bit and its neighbour to theleft(higher i...原创 2022-04-16 20:59:22 · 916 阅读 · 0 评论 -
【HDLBits刷题】Thermostat.
A heating/cooling thermostat controls both a heater (during winter) and an air conditioner (during summer). Implement a circuit that will turn on and off the heater, air conditioning, and blower fan as appropriate.The thermostat can be in one of two mode原创 2022-04-15 20:48:03 · 1222 阅读 · 0 评论 -
【HDLBits刷题】Ringer.
Suppose you are designing a circuit to control a cellphone's ringer and vibration motor. Whenever the phone needs to ring from an incoming call (inputring), your circuit must either turn on the ringer (outputringer= 1) or the motor (outputmotor= 1), b...原创 2022-04-15 19:14:17 · 975 阅读 · 1 评论