摘要: 3.2.1 ~3.2.2 略 3.2.3 9-to-1 Multiplexer 创建一个16位宽的9选1数据选择器。当sel=0时,选择a;当sel=1时,选择b,以此类推。对于没有用到的项(sel=9到15),所有输出位都设为“1” module top_module( input [15:0] 阅读全文
posted @ 2022-07-06 16:42 糖甜 阅读(111) 评论(0) 推荐(0)
摘要: 3.1.1~3.1.11 略 3.1.12 Combine circuits A and B module top_module (input x, input y, output z); wire oz1,oz2,oz3,oz4; A IA1 (x,y,oz1); B IB1 (x,y,oz2); 阅读全文
posted @ 2022-07-06 13:56 糖甜 阅读(91) 评论(0) 推荐(0)
摘要: 2.5.1 Conditional temary operator module top_module ( input [7:0] a, b, c, d, output [7:0] min);// wire [7:0]r1,r2; //记得定义位宽 assign r1=(a<b)?a:b; assi 阅读全文
posted @ 2022-07-04 20:43 糖甜 阅读(38) 评论(0) 推荐(0)
摘要: 2.4.1 Always blocks(combinational) // synthesis verilog_input_version verilog_2001 module top_module( input a, input b, output wire out_assign, output 阅读全文
posted @ 2022-07-03 16:10 糖甜 阅读(64) 评论(0) 推荐(0)
摘要: 2.3.1 Modules module top_module ( input a, input b, output out ); mod_a david(.out(out),.in1(a),.in2(b)); endmodule 2.3.2 Connecting ports by position 阅读全文
posted @ 2022-06-28 13:10 糖甜 阅读(121) 评论(0) 推荐(0)
摘要: 2.2.1 Voctors module top_module( input [2:0] vec, output 2:0] outv, output o2, output o1, output o0 ); assign outv=vec; assign o2=vec[2]; assign o1=ve 阅读全文
posted @ 2022-06-27 15:06 糖甜 阅读(56) 评论(0) 推荐(0)