/*
File Name : test.v
Author: www.flxc.net
Data : 2010-10-14 20:20:52
Description : This module is to shift the 32 bit input data with clock edges.
*/
`timescale 1ns/1ns
`define period 10
module test(
clk,
rst_n,
data_i,
data_o
)
input clk
input rst_n
input [31:0] data_i
output [31:0] data_o
reg [31:0] data_o
always@(posedge clk or negedge rst_n)
beg
if(!rst_n)
data_o <= 32'b0
else
data_o <= data_i >>1
end
endmodule
module test_tb
reg clk
reg rst_n
reg [31:0] data_i
wire [31:0] data_o
initial
begin
clk=1'b1
rst_n=1'b1
data_i=32'b1010_1111_1000_1111_1111_0000_0001_0000
#(`period/3)
rst_n=1'b0
#(`period/3)
rst_n=1'b1
#100000000
$stop
end
always #(`period/2) clk=~clk
endmodule
这就是把ABC三个电台的启动信号变为输入,XY的启动信号为输出,列出真值表就行了吧。真值表为:
a
b
c
x
y
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
0
1
1
0
1
1
0
0
1
0
1
0
1
0
1
1
1
0
0
1
1
1
1
1
1
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)