wire data_io; //双向信号
wire data_i; //双向信号做输入时的替身
reg data_reg; //双向信号做输出时的寄存器镜像
reg data_en; //三态门开门,输出有效
assign data_i = data_io;
assign data_io = data_en ? data_reg : 1’bz;
wire data_io; //双向信号
wire data_i; //双向信号做输入时的替身
reg data_reg; //双向信号做输出时的寄存器镜像
reg data_en; //三态门开门,输出有效
assign data_i = data_io;
assign data_io = data_en ? data_reg : 1’bz;