Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
buhe committed Jun 7, 2022
1 parent 7845b95 commit 5fdf3a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion 04/Btn.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ module Btn(
input btn,
output wire[15:0] out
);
assign out[0] = btn;
Mux16 MUX161(
.a(16'b0000000000000000),
.b(16'b0000000000000001),
.sel(btn),
.out(out)
);
endmodule
15 changes: 14 additions & 1 deletion 04/Memory_tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ integer file;
reg clk = 1;
reg [15:0] address = 16'h1FFC;
reg load = 1;
wire [15:0] out;
wire signed [15:0] out;
reg btn = 1;
wire led;
reg signed [15:0] in= 16'h0000;
Expand Down Expand Up @@ -41,6 +41,19 @@ initial begin
display();
display();

in=-1;load=1;address=16'h0000;
display();
display();

in=9999;load=0;
display();
display();

address=16'd8192;
display();
address=16'd8193;
display();

$finish;
end

Expand Down

0 comments on commit 5fdf3a4

Please sign in to comment.