实验一:教材书81页图3.23
实验代码:
module adder4(carry,X,Y,S,carryout);
input carryin;
input [3:0]X,Y;
output [3:0]S;
output carryout;
wire [3:1]C;
fulladd stage0 (carryin,X[0],Y[0],S[0],C[1]);
fulladd stage1 (C[1],X[1],Y[1],S[1],C[2]);
fulladd stage2 (C[2],X[2],Y[2],S[2],C[3]);
fulladd stage3 (C[3],X[3],Y[3],S[3],carryout);
endmodule
仿真截图:
实验视频:
实验视频一
注:(本次实验已经上传到哔哩哔哩视频网站,需要观看的请点击上方视频链接)
实验二:Verilog HDL(第二版)数字系统设计及仿真十一章实验四
实验代码:
module s4;
reg [3:0] a,b;
reg [2:0] select;
reg [3:0] result_f,result_t;
integer seed1,seed2;
initial
begin
select=0;
seed1=40;
seed2=9;
end
always
begin
a
实验视频二
注:(本次实验已经上传到哔哩哔哩视频网站,需要观看的请点击上方视频链接)
实验三:Verilog HDL 高级数字设计 81页例4.9
实验代码:
timescale 1 ns/1 ps
module Add_full_ASIC
(output c_out,sum,input a,b,c_in);
wire w1,w2,w3;
wire c_out_bar;
Add_half_ASIC M1(w2,w1,a,b);
Add_half_ASIC M2(w3,sum,w1,c_in);
norf201 M3(c_out_bar,w2,w3);
invf101 M4(c_out,c_out_bar);
endmodule
module Add_half_ASIC
(output c_out,sum,input a,b);
wire c_out_bar;
xorf201 M1(sum,a,b);
nanf201 M2(c_out_bar,a,b);
invf101 M3(c_out,c_out_bar);
endmodule
实验截图:
实验视频:
实验视频三
注:(本次实验已经上传到哔哩哔哩视频网站,需要观看的请点击上方视频链接)
个人实验
1.实验名称:ModelSim基本仿真流程
2.实验步骤:
(1)实验代码:
module fulladd(sum,c_out,a,b,c_in);
output sum,c_out;
input a,b,c_in;
wire s1,c1,c2;
xor (s1,a,b);
and (c1,a,b);
xor (sum,s1,c_in);
and (c2,s1,c_in);
or (c_out,c2,c1);
endmodule
(2)实验结果显示