合集-Verilog学习

摘要:Build a decade counter that counts from 0 through 9, inclusive, with a period of 10. The reset input is synchronous, and should reset the counter to 0 阅读全文
posted @ 2024-04-10 01:59 江左子固 阅读(75) 评论(0) 推荐(0)
摘要:Build a 4-bit binary counter that counts from 0 through 15, inclusive, with a period of 16. The reset input is synchronous, and should reset the count 阅读全文
posted @ 2024-04-10 01:53 江左子固 阅读(83) 评论(0) 推荐(0)
摘要:Make a decade counter that counts 1 through 10, inclusive. The reset input is synchronous, and should reset the counter to 1. 题目网站 1 module top_module 阅读全文
posted @ 2024-04-10 02:04 江左子固 阅读(43) 评论(0) 推荐(0)
摘要:Build a decade counter that counts from 0 through 9, inclusive, with a period of 10. The reset input is synchronous, and should reset the counter to 0 阅读全文
posted @ 2024-04-10 02:13 江左子固 阅读(69) 评论(0) 推荐(0)
摘要:Design a 1-12 counter with the following inputs and outputs: Reset Synchronous active-high reset that forces the counter to 1 Enable Set high for the 阅读全文
posted @ 2024-04-10 02:19 江左子固 阅读(83) 评论(0) 推荐(0)
摘要:From a 1000 Hz clock, derive a 1 Hz signal, called OneHertz, that could be used to drive an Enable signal for a set of hour/minute/second counters to 阅读全文
posted @ 2024-04-10 14:05 江左子固 阅读(184) 评论(0) 推荐(0)
摘要:Build a 4-digit BCD (binary-coded decimal) counter. Each decimal digit is encoded using 4 bits: q[3:0] is the ones digit, q[7:4] is the tens digit, et 阅读全文
posted @ 2024-04-10 14:29 江左子固 阅读(82) 评论(0) 推荐(0)
摘要:Create a set of counters suitable for use as a 12-hour clock (with am/pm indicator). Your counters are clocked by a fast-running clk, with a pulse on 阅读全文
posted @ 2024-04-10 14:37 江左子固 阅读(68) 评论(0) 推荐(0)
摘要:Hdlbits的习题文章前前后后做了几遍,每一次都有不一样的感受,题目按照顺序正在整理,截止Circuis->Sequential Logic->Counters这部分之前,练习的文章见我的博客的文章部分,从Counters开始,我将练习的文章迁移至我的博客的随笔部分。 完成了代码的练习,再过一段时 阅读全文
posted @ 2024-04-10 14:43 江左子固 阅读(61) 评论(0) 推荐(0)
摘要:Build a 4-bit shift register (right shift), with asynchronous reset, synchronous load, and enable. areset: Resets shift register to zero. load: Loads 阅读全文
posted @ 2024-04-11 15:08 江左子固 阅读(37) 评论(0) 推荐(0)
摘要:Build a 100-bit left/right rotator, with synchronous load and left/right enable. A rotator shifts-in the shifted-out bit from the other end of the reg 阅读全文
posted @ 2024-04-11 15:12 江左子固 阅读(29) 评论(0) 推荐(0)
摘要:Build a 64-bit arithmetic shift register, with synchronous load. The shifter can shift both left and right, and by 1 or 8 bit positions, selected by a 阅读全文
posted @ 2024-04-11 15:32 江左子固 阅读(35) 评论(0) 推荐(0)
摘要:A linear feedback shift register is a shift register usually with a few XOR gates to produce the next state of the shift register. A Galois LFSR is on 阅读全文
posted @ 2024-04-11 15:54 江左子固 阅读(174) 评论(0) 推荐(0)
摘要:Write the Verilog code for this sequential circuit (Submodules are ok, but the top-level must be named top_module). Assume that you are going to imple 阅读全文
posted @ 2024-04-11 16:41 江左子固 阅读(43) 评论(0) 推荐(0)
摘要:See Lfsr5 for explanations. Build a 32-bit Galois LFSR with taps at bit positions 32, 22, 2, and 1. 题目网站 module top_module( input clk, input reset, // 阅读全文
posted @ 2024-04-11 16:47 江左子固 阅读(84) 评论(0) 推荐(0)
摘要:Implement the following circuit: 题目网站 module top_module ( input clk, input resetn, // synchronous reset input in, output out); reg [3:0]q; assign out= 阅读全文
posted @ 2024-04-11 16:52 江左子固 阅读(38) 评论(0) 推荐(0)
摘要:Write a top-level Verilog module (named top_module) for the shift register, assuming that n = 4. Instantiate four copies of your MUXDFF subcircuit in 阅读全文
posted @ 2024-04-11 16:59 江左子固 阅读(34) 评论(0) 推荐(0)
摘要:In this question, you will design a circuit for an 8x1 memory, where writing to the memory is accomplished by shifting-in bits, and reading is "random 阅读全文
posted @ 2024-04-11 17:04 江左子固 阅读(43) 评论(0) 推荐(0)
摘要:Rule 90 is a one-dimensional cellular automaton with interesting properties. The rules are simple. There is a one-dimensional array of cells (on or of 阅读全文
posted @ 2024-04-12 16:16 江左子固 阅读(155) 评论(0) 推荐(0)
摘要:Rule 110 is a one-dimensional cellular automaton with interesting properties (such as being Turing-complete). There is a one-dimensional array of cell 阅读全文
posted @ 2024-04-12 16:20 江左子固 阅读(78) 评论(0) 推荐(0)
摘要:Conway's Game of Life is a two-dimensional cellular automaton. The "game" is played on a two-dimensional grid of cells, where each cell is either 1 (a 阅读全文
posted @ 2024-04-12 16:24 江左子固 阅读(270) 评论(0) 推荐(0)
摘要:This is a Moore state machine with two states, one input, and one output. Implement this state machine. Notice that the reset state is B. This exercis 阅读全文
posted @ 2024-04-14 00:45 江左子固 阅读(100) 评论(0) 推荐(0)
摘要:This is a Moore state machine with two states, one input, and one output. Implement this state machine. Notice that the reset state is B. This exercis 阅读全文
posted @ 2024-04-14 01:14 江左子固 阅读(153) 评论(0) 推荐(0)
摘要:This is a Moore state machine with two states, two inputs, and one output. Implement this state machine. This exercise is the same as fsm2s, but using 阅读全文
posted @ 2024-04-14 02:17 江左子固 阅读(83) 评论(0) 推荐(0)
摘要:This is a Moore state machine with two states, two inputs, and one output. Implement this state machine. This exercise is the same as fsm2, but using 阅读全文
posted @ 2024-04-14 02:41 江左子固 阅读(45) 评论(0) 推荐(0)
摘要:The following is the state transition table for a Moore state machine with one input, one output, and four states. Use the following state encoding: A 阅读全文
posted @ 2024-04-14 03:18 江左子固 阅读(53) 评论(0) 推荐(0)
摘要:The following is the state transition table for a Moore state machine with one input, one output, and four states. Use the following one-hot state enc 阅读全文
posted @ 2024-04-14 04:02 江左子固 阅读(50) 评论(0) 推荐(0)
摘要:See also: State transition logic for this FSM The following is the state transition table for a Moore state machine with one input, one output, and fo 阅读全文
posted @ 2024-04-14 04:18 江左子固 阅读(52) 评论(0) 推荐(0)
摘要:module top_module( input clk, input in, input reset, output out); // parameter A=2'b00,B=2'b01,C=2'b10,D=2'b11; reg [1:0]state,next_state; // State tr 阅读全文
posted @ 2024-04-14 04:29 江左子固 阅读(44) 评论(0) 推荐(0)
摘要:题目网站 1 module top_module ( 2 input clk, 3 input reset, 4 input [3:1] s, 5 output fr3, 6 output fr2, 7 output fr1, 8 output dfr 9 ); 10 parameter A2=3' 阅读全文
posted @ 2024-04-14 04:36 江左子固 阅读(65) 评论(0) 推荐(0)
摘要:The game Lemmings involves critters with fairly simple brains. So simple that we are going to model it using a finite state machine. In the Lemmings' 阅读全文
posted @ 2024-04-14 04:50 江左子固 阅读(65) 评论(0) 推荐(0)
摘要:See also: Lemmings1. In addition to walking left and right, Lemmings will fall (and presumably go "aaah!") if the ground disappears underneath them. I 阅读全文
posted @ 2024-04-14 22:43 江左子固 阅读(74) 评论(0) 推荐(0)
摘要:See also: Lemmings1 and Lemmings2. In addition to walking and falling, Lemmings can sometimes be told to do useful things, like dig (it starts digging 阅读全文
posted @ 2024-04-15 00:42 江左子固 阅读(82) 评论(0) 推荐(0)
摘要:See also: Lemmings1, Lemmings2, and Lemmings3. Although Lemmings can walk, fall, and dig, Lemmings aren't invulnerable. If a Lemming falls for too lon 阅读全文
posted @ 2024-04-15 02:28 江左子固 阅读(142) 评论(0) 推荐(0)
摘要:Given the following state machine with 1 input and 2 outputs: 题目网站 module top_module( input in, input [9:0] state, output [9:0] next_state, output out 阅读全文
posted @ 2024-04-15 17:07 江左子固 阅读(99) 评论(2) 推荐(1)
摘要:The PS/2 mouse protocol sends messages that are three bytes long. However, within a continuous byte stream, it's not obvious where messages start and 阅读全文
posted @ 2024-04-15 17:37 江左子固 阅读(60) 评论(0) 推荐(0)
摘要:See also: PS/2 packet parser. Now that you have a state machine that will identify three-byte messages in a PS/2 byte stream, add a datapath that will 阅读全文
posted @ 2024-04-15 17:58 江左子固 阅读(77) 评论(0) 推荐(0)
摘要:In many (older) serial communications protocols, each data byte is sent along with a start bit and a stop bit, to help the receiver delimit bytes from 阅读全文
posted @ 2024-04-15 20:32 江左子固 阅读(64) 评论(0) 推荐(0)
摘要:See also: Serial receiver Now that you have a finite state machine that can identify when bytes are correctly received in a serial bitstream, add a da 阅读全文
posted @ 2024-04-15 20:38 江左子固 阅读(54) 评论(0) 推荐(0)
摘要:See also: Serial receiver and datapath We want to add parity checking to the serial receiver. Parity checking adds one extra bit after each data byte. 阅读全文
posted @ 2024-04-15 23:44 江左子固 阅读(131) 评论(0) 推荐(0)
摘要:// way1 module top_module( input clk, input reset, // Synchronous reset input in, output disc, output flag, output err); parameter NONE = 4'd0,ONE = 4 阅读全文
posted @ 2024-04-16 00:47 江左子固 阅读(42) 评论(0) 推荐(0)
摘要:Implement a Mealy-type finite state machine that recognizes the sequence "101" on an input signal named x. Your FSM should have an output signal, z, t 阅读全文
posted @ 2024-04-16 01:38 江左子固 阅读(70) 评论(0) 推荐(0)
摘要:You are to design a one-input one-output serial 2's complementer Moore state machine. The input (x) is a series of bits (one per clock cycle) beginnin 阅读全文
posted @ 2024-04-16 02:02 江左子固 阅读(203) 评论(0) 推荐(1)
摘要:The following diagram is a Mealy machine implementation of the 2's complementer. Implement using one-hot encoding. module top_module ( input clk, inpu 阅读全文
posted @ 2024-04-16 02:04 江左子固 阅读(76) 评论(1) 推荐(0)
摘要:Consider a finite state machine with inputs s and w. Assume that the FSM begins in a reset state called A, as depicted below. The FSM remains in state 阅读全文
posted @ 2024-04-16 02:56 江左子固 阅读(106) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input reset, // Synchronous reset input x, output z ); parameter S0 = 3'b000, S1 = 3'b001, S2 = 3'b010; parameter 阅读全文
posted @ 2024-04-16 02:58 江左子固 阅读(44) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input [2:0] y, input x, output Y0, output z ); assign Y0 = ((~y[2]&y[0])|(y==3'b100))&~x | (~y[2]&~y[0])&x; assign 阅读全文
posted @ 2024-04-16 03:00 江左子固 阅读(60) 评论(0) 推荐(0)
摘要:题目网站 画出卡诺图,可得: module top_module ( input [3:1] y, input w, output Y2); assign Y2 = (y == 3'b001 | y == 3'b101) & ~w | (y == 3'b001 | y == 3'b010 | y = 阅读全文
posted @ 2024-04-16 03:03 江左子固 阅读(50) 评论(0) 推荐(0)
摘要:module top_module ( input [6:1] y, input w, output Y2, output Y4); assign Y2 = ~w & y[1]; assign Y4 = (w & y[2])|(w & y[3])|(w & y[5])|(w & y[6]); end 阅读全文
posted @ 2024-04-16 03:04 江左子固 阅读(41) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input reset, // Synchronous active-high reset input w, output z ); parameter A = 3'd0, B = 3'd1, C = 3'd2; paramet 阅读全文
posted @ 2024-04-16 03:11 江左子固 阅读(41) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input reset, // Synchronous active-high reset input w, output z ); parameter A = 3'd0, B = 3'd1, C = 3'd2; paramet 阅读全文
posted @ 2024-04-16 03:13 江左子固 阅读(46) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input [5:0] y, input w, output Y1, output Y3 ); assign Y1 = y[0] & w; assign Y3 = (y[1] | y[2] | y[4] | y[5]) & ~w; endmodule 阅读全文
posted @ 2024-04-16 03:15 江左子固 阅读(27) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input resetn, // active-low synchronous reset input [3:1] r, // request output [3:1] g // grant ); parameter A = 2 阅读全文
posted @ 2024-04-16 03:16 江左子固 阅读(42) 评论(0) 推荐(0)
摘要:题目网站 参考的CSDN网站 module top_module ( input clk, input resetn, // active-low synchronous reset input x, input y, output f, output g ); parameter A=0, B=1 阅读全文
posted @ 2024-04-16 03:21 江左子固 阅读(74) 评论(0) 推荐(0)
摘要:Build a counter that counts from 0 to 999, inclusive, with a period of 1000 cycles. The reset input is synchronous, and should reset the counter to 0. 阅读全文
posted @ 2024-04-16 03:38 江左子固 阅读(44) 评论(0) 推荐(0)
摘要:This is the first component in a series of five exercises that builds a complex counter out of several smaller circuits. See the final exercise for th 阅读全文
posted @ 2024-04-16 03:40 江左子固 阅读(72) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input reset, // Synchronous reset input data, output start_shifting); parameter IDLE = 3'd0, S1 = 3'd1, S2 = 3'd2; 阅读全文
posted @ 2024-04-16 03:44 江左子固 阅读(49) 评论(0) 推荐(0)
摘要:module top_module ( input clk, input reset, // Synchronous reset output shift_ena); parameter IDLE = 2'd0, ENA = 2'd1, STOP = 2'd2; reg [1:0] current_ 阅读全文
posted @ 2024-04-16 03:51 江左子固 阅读(44) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input reset, // Synchronous reset input data, output shift_ena, output counting, input done_counting, output done, 阅读全文
posted @ 2024-04-16 03:59 江左子固 阅读(42) 评论(0) 推荐(0)
摘要:题目网站 module top_module ( input clk, input reset, // Synchronous reset input data, output [3:0] count, output counting, output done, input ack ); reg [ 阅读全文
posted @ 2024-04-16 04:02 江左子固 阅读(52) 评论(0) 推荐(0)
摘要:题目网站 module top_module( input d, input done_counting, input ack, input [9:0] state, // 10-bit one-hot current state 这个是独热码输入现态 output B3_next, output 阅读全文
posted @ 2024-04-16 04:05 江左子固 阅读(64) 评论(0) 推荐(0)
摘要:UART的使用中叶用到了奇偶校验,在Hdlbits中也有这样的题目 阅读全文
posted @ 2024-04-16 16:13 江左子固 阅读(45) 评论(0) 推荐(0)