`timescale 1ns / 1ps `default_nettype none `ifdef SYNTHESIS `define FPATH(X) `"X`" `else /* ! SYNTHESIS */ `define FPATH(X) `"../data/X`" `endif /* ! SYNTHESIS */ module image_sprite #( parameter WIDTH=256, HEIGHT=256) ( input wire pixel_clk, input wire rst, input wire [10:0] x, h_count, input wire [9:0] y, v_count, output logic [7:0] pixel_red, output logic [7:0] pixel_green, output logic [7:0] pixel_blue ); // calculate ROM address logic [$clog2(WIDTH*HEIGHT)-1:0] image_addr; assign image_addr = (h_count - x) + ((v_count - y) * WIDTH); logic in_sprite; assign in_sprite = ((h_count >= x && h_count < (x + WIDTH)) && (v_count >= y && v_count < (y + HEIGHT))); // Modify the module below to use your BRAMs! // this will not do anything without you doing that! assign pixel_red = in_sprite ? 8'hF0 : 0; assign pixel_green = in_sprite ? 8'hF0 : 0; assign pixel_blue = in_sprite ? 8'hF0 : 0; endmodule `default_nettype none