第一范文网 - 专业文章范例文档资料分享平台

基于Libero的数字逻辑设计仿真及验证实验报告

来源:用户分享 时间:2025/5/15 20:28:25 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

#10 sel = sel +1; end

endmodule

//74HC85代码

// 74HC85.v

module HC85(DateA, DateB, Cas, Q); input [3:0] DateA, DateB; input [2:0]Cas; output reg [2:0]Q; interger I;

always @(DateA or DateB or Cas) begin if(DateA==DateB) begin if(Cas[1]) Q = 3'b010; else if(Cas==3'b000) Q = 3'b101; else if(Cas==3'b101) Q = 3'b000; else Q = Cas; end else begin for(I=0;I<4;I=I+1) if(DateA[I]>DateB[I]) Q = 3'b100; else if(DateA[I]

endmodule

//74HC85测试平台代码 // test_85.v

`timescale 1ns/1ns module test_85; reg [3:0] a,b; reg [2:0] cas; wire [2:0] res;

HC85 u(a, b, cas, res);

task cascade_input; begin

#0 cas = 0; #10 cas = 1; #10 cas = 3'b100; 12

#10 cas = 3'b101;

#10 cas = 3'b010; #10 cas = 3'b011; #10 cas = 3'b110; #10 cas = 3'b111; #10; end endtask

initial begin a = 4'd9;

b = a; cascade_input(); b = 4'd7; cascade_input(); end

endmodule

//74HC283代码

// 74HC283.v

module HC283(DateA, DateB, Cin, Sum, Cout); input [3:0] DateA, DateB; input Cin;

output [3:0] Sum; output Cout; reg [4:0]Buf;

assign {Cout,Sum} = Buf;

always @(DateA or DateB or Cin) Buf = DateA + DateB + Cin + 5'd0; endmodule

//74HC283测试平台代码 // test_283.v

`timescale 1ns/1ns module test_283; reg [3:0] a, b; reg in;

wire [3:0]sum; wire out; interger I;

HC283 u(a, b, in, sum, out);

task accumulate; begin

a = 4'b0100; for(I=0;I<16;I=I+1)

13

begin b = I; #10; end endtask

initial begin

in = 0; accumulate(); in = 1; accumulate(); end

endmodule

//74HC4511代码

// 74HC4511.v

module HC4511(DateOut, DateIn, LE, BL_N, LT_N); output [7:0]DateOut; input [3:0]DateIn; input LE, BL_N, LT_N; reg [7:0]Buf;

assign DateOut = Buf;

always @(DateIn or LE or BL_N or LT_N) begin if(!LT_N) Buf = 8'b11111111; else if(!BL_N) Buf = 8'b0000000; else if(LE) Buf = Buf; else case(DateIn) 4'd0:Buf = 8'b00111111; 4'd1:Buf = 8'b00000110; 4'd2:Buf = 8'b01011011; 4'd3:Buf = 8'b01001111; 4'd4:Buf = 8'b01100110; 4'd5:Buf = 8'b01101101; 4'd6:Buf = 8'b01111101; 4'd7:Buf = 8'b00000111; 4'd8:Buf = 8'b01111111; 4'd9:Buf = 8'b01101111; 4'ha:Buf = 8'b01110111; 4'hb:Buf = 8'b01111100; 4'hc:Buf = 8'b00111001;

14

end

4'hd:Buf = 8'b01011110; 4'he:Buf = 8'b01111001; 4'hf:Buf = 8'b01110001; default:; endcase

2、第一次仿真结果(任选一个模块,请注明)

74HC148

3、综合结果

15

基于Libero的数字逻辑设计仿真及验证实验报告.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c83spa4f7r502tjb2irbr_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top