38 lines
871 B
Coq
38 lines
871 B
Coq
|
|
`include "./decoder_encoder/decoder_encoder.v"
|
||
|
|
|
||
|
|
module decoder_3bit_tb;
|
||
|
|
reg [2:0] in;
|
||
|
|
wire [7:0] out;
|
||
|
|
wire [2:0] encoded;
|
||
|
|
|
||
|
|
decoder_3bit dec(
|
||
|
|
.in(in),
|
||
|
|
.out(out)
|
||
|
|
);
|
||
|
|
|
||
|
|
encoder_3bit enc(
|
||
|
|
.in(out),
|
||
|
|
.out(encoded)
|
||
|
|
);
|
||
|
|
|
||
|
|
initial begin
|
||
|
|
$dumpfile("./decoder_encoder/decoder_encoder.vcd");
|
||
|
|
$dumpvars(0, decoder_3bit_tb);
|
||
|
|
|
||
|
|
in = 3'b000;
|
||
|
|
#1
|
||
|
|
$display("in=%d, out=%b, enc=%d", in, out, encoded);
|
||
|
|
in = 3'b001;
|
||
|
|
#1
|
||
|
|
$display("in=%d, out=%b, enc=%d", in, out, encoded);
|
||
|
|
in = 3'b010;
|
||
|
|
#1
|
||
|
|
$display("in=%d, out=%b, enc=%d", in, out, encoded);
|
||
|
|
in = 3'b100;
|
||
|
|
#1
|
||
|
|
$display("in=%d, out=%b, enc=%d", in, out, encoded);
|
||
|
|
in = 3'b111;
|
||
|
|
#1
|
||
|
|
$display("in=%d, out=%b, enc=%d", in, out, encoded);
|
||
|
|
end
|
||
|
|
endmodule
|