/*Write your code here*/
module error_checker_xz(bus,all_known,has_unknown,bus_if_known);
input [7:0]bus;
output all_known;
output has_unknown;
output [7:0]bus_if_known;
wire any_xz = (^(bus^bus))===1'bx;
assign has_unknown = any_xz;
assign all_known =~any_xz;
assign bus_if_known ={8{all_known}} & bus;
endmodule
/*
bus ^ bus) trick: gives 0 on known bits but X on unknown (x/z) bits.
^(...) (reduction XOR) → yields X if any bit is unknown.
Using === 1'bx detects presence of x/z reliably in simulation.
bus_if_known uses {8{all_known}} & bus → passes bus only when fully known, else zeroes.
*/