10 2022 档案
摘要:Shift4 异步复位同步置数和使能。 module top_module( input clk, input areset, // async active-high reset to zero input load, input ena, input [3:0] data, output reg
阅读全文
摘要:Count15 module top_module ( input clk, input reset, // Synchronous active-high reset output [3:0] q); always@(posedge clk) begin if(reset) q <= 4'd0;
阅读全文
摘要:Dff 这一节终于开始时序电路了。首先是一个用的最多的D触发器。 module top_module ( input clk, // Clocks are used in sequential circuits input d, output reg q );// // Use a clocked
阅读全文
摘要:Kmap1 化简卡诺图即可。 module top_module( input a, input b, input c, output out ); assign out=b|c|a; endmodule Kmap2 我是这样化简的。 module top_module( input a, inpu
阅读全文
摘要:Mux2to1 module top_module( input a, b, sel, output out ); assign out=sel?b:a; endmodule Mux2to1v 100位和1位的是一样的。 module top_module( input [99:0] a, b, i
阅读全文
摘要:Exams/m2014 q4h module top_module ( input in, output out); assign out=in; endmodule Exams/m2014 q4i module top_module ( output out); assign out=1'b0;
阅读全文
摘要:Conditional 使用三目运算符可以实现一个数据选择器,可以替代if语句,不过:?可读性较差,复杂逻辑还是推荐用if。 注意这道题中间变量的定义,不定义中间变量表达式会变得十分复杂且可读性差。 module top_module ( input [7:0] a, b, c, d, output
阅读全文
摘要:Alwaysblock1 组合逻辑always块的使用,注意这里的wire和reg综合出来的结果是一样的,这里只是verilog语法导致二者声明不一样。 // synthesis verilog_input_version verilog_2001 module top_module( input
阅读全文
摘要:Module 模块例化的两种方式:按端口位置例化、按端口名例化。 module top_module ( input a, input b, output out ); mod_a instance1 ( .in1(a), .in2(b), .out(out) ); endmodule Module
阅读全文
摘要:Vector0 向量赋值。 module top_module ( input wire [2:0] vec, output wire [2:0] outv, output wire o2, output wire o1, output wire o0 ); // Module body start
阅读全文
摘要:挺早以前就刷了里面一些题,结果不知道为啥登录账号刷题记录又没了,强迫症又让我不想从中间开始刷。既然如此,那就从头开始刷吧。QWQ Step one 第一题,没啥好说的。 module top_module( output one ); // Insert your code here assign
阅读全文
浙公网安备 33010602011771号