W
WGNoise@gmail.com
Guest
hi,all
Here is some verilog code modeling bidirectional bus from example
6.22 Advanced Digital Design with the Verilog HDL authored by Michael
D. Ciletti.
module Bi_dir_bus(data_to_from_bus,send_data,rcv_data);
inout [31:0] data_to_from_bus;
input send_data,rcv_data;
wire [31:0] ckt_to_bus;
wire [31:0] data_to_from_bus,data_from_bus;
assign data_from_bus=(rcv_data)?data_to_from_bus:32'bz;
//*********************************confused about following
statement***//
assign data_to_from_bus=(send_data)?ckt_to_bus:data_to_from_bus;
//(*)
//**********************************//
//ckt_to_bus is reg_to bus in the book, which doesn't exsit in
declaration, so I change it to ckt_to_bus.
//some codes
endmodule
why instead of 32'bz data_to_from_bus exist in LHS? and doesn't this
synthesize to a latch?
Here is some verilog code modeling bidirectional bus from example
6.22 Advanced Digital Design with the Verilog HDL authored by Michael
D. Ciletti.
module Bi_dir_bus(data_to_from_bus,send_data,rcv_data);
inout [31:0] data_to_from_bus;
input send_data,rcv_data;
wire [31:0] ckt_to_bus;
wire [31:0] data_to_from_bus,data_from_bus;
assign data_from_bus=(rcv_data)?data_to_from_bus:32'bz;
//*********************************confused about following
statement***//
assign data_to_from_bus=(send_data)?ckt_to_bus:data_to_from_bus;
//(*)
//**********************************//
//ckt_to_bus is reg_to bus in the book, which doesn't exsit in
declaration, so I change it to ckt_to_bus.
//some codes
endmodule
why instead of 32'bz data_to_from_bus exist in LHS? and doesn't this
synthesize to a latch?