Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module tri_buffer(input E, input [3:0] A, output [3:0] Y);
- assign Y = E ? A : 4'bz;
- endmodule
- module tb();
- reg E;
- reg [3:0] A;
- wire [3:0] Y;
- tri_buffer DUT (E, A, Y);
- initial begin
- A = 0; E = 0;
- $monitor("E: %b A: %b Y: %b", E, A, Y);
- #1
- A = 7; E = 0;
- #1
- A = 7; E = 1;
- #1
- A = 2; E = 1;
- #1
- A = 2; E = 0;
- #1
- A = 14; E = 0;
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement