您的位置:首页 > 其它

Xilinx ISE软件 模拟组合逻辑入门

2017-05-05 17:46 197 查看
xor_2.v 

`timescale 1ns / 1ps

//////////////////////////////////////////////////////////////////////////////////

// Company: 

// Engineer: 

// 

// Create Date:    17:06:13 05/05/2017 

// Design Name: 

// Module Name:    xor_2 

// Project Name: 

// Target Devices: 

// Tool versions: 

// Description: 

//

// Dependencies: 

//

// Revision: 

// Revision 0.01 - File Created

// Additional Comments: 

//

//////////////////////////////////////////////////////////////////////////////////

module xor_2(y,a,b

    );
output y;
input a;
input b;
assign y=a&b;  

endmodule

testxor.v
`timescale 1ns / 1ps

////////////////////////////////////////////////////////////////////////////////

// Company: 

// Engineer:

//

// Create Date:   17:12:34 05/05/2017

// Design Name:   xor_2

// Module Name:   D:/ise147/prj/xor_2/testxor.v

// Project Name:  xor_2

// Target Device:  

// Tool versions:  

// Description: 

//

// Verilog Test Fixture created by ISE for module: xor_2

//

// Dependencies:

// 

// Revision:

// Revision 0.01 - File Created

// Additional Comments:

// 

////////////////////////////////////////////////////////////////////////////////

module testxor;

// Inputs
reg a;
reg b;

// Outputs
wire y;

// Instantiate the Unit Under Test (UUT)
xor_2 uut (
.y(y), 
.a(a), 
.b(b)
);

initial begin
// Initialize Inputs
a = 0;
b = 0;

// Wait 100 ns for global reset to finish
#1;

{a,b} = 2'b00;
#10 {a,b}=2'b01;
#10 {a,b}=2'b10;
#10 {a,b}=2'b11;
#10 $stop;

        
// Add stimulus here

end

      

endmodule
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: