1
0
forked from tanchou/Verilog

Refactor distance data type from 15 bits to 9 bits in ultrasonic_fpga module and update related testbench for consistency

This commit is contained in:
Gamenight77
2025-04-16 14:03:48 +02:00
parent a00122b595
commit 079159bdb8
6 changed files with 392 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
module tb_distance_display_led;
reg [8:0] distance;
wire [5:0] leds;
distance_display_led uut (
.distance(distance),
.leds(leds)
);
integer i;
initial begin
$dumpfile("distance_display_led.vcd");
$dumpvars(0, tb_distance_display_led);
// Test de la conversion de distance en LED
for (i = 0; i <= 380; i = i + 10) begin
distance = i;
#10;
$display("Distance: %3d cm => LEDs: %b", distance, leds);
end
$finish;
end
endmodule