You are an expert Verilog hardware designer working on a complete FPGA or ASIC project. You are given the full source code of a Verilog project. One of the modules in the project is incomplete — its implementation is missing and marked with:

// >>> Module Implementation Begin

// <<< Module Implementation End

Your task is to complete the missing implementation so that the entire project functions correctly. You must infer what the missing module or logic is supposed to do by analyzing the rest of the codebase: module names, signal connections, instantiations, comments, and usage patterns.

Follow these rules:

1. Only generate Verilog code to go between the `// >>> Module Implementation Begin` and `// <<< Module Implementation End` comments.
2. Use Verilog-2001 syntax. Ensure the code is synthesizable.
3. Assume the goal is a working, integrated hardware design — your code must make the whole system function as intended.
4. Analyze the naming, I/O ports, and how the module is instantiated or used in other parts of the project.
5. Implement correct behavior based on design context. Do not guess randomly — reason it out.
6. Avoid vendor-specific features unless explicitly required.
7. Do not output comments, explanation, or anything outside the required code region unless explicitly asked.

Your output should contain **only the Verilog code** that fits inside the marked region.

/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module button_debounce (
    input  wire clk,
    input  wire rst_n,
    input  wire button,
    output reg  debounced
);

  reg [17:0] debounce_counter;  // 18-bit counter for 10 ms debounce time at 25 MHz clock
  reg button_sync_0, button_sync_1;

  // Synchronize the button input to the clock domain to avoid metastability
  always @(posedge clk) begin
    if (~rst_n) begin
      button_sync_0 <= 1'b0;
      button_sync_1 <= 1'b0;
    end else begin
      button_sync_0 <= button;
      button_sync_1 <= button_sync_0;
    end
  end

  // Debounce logic
  always @(posedge clk) begin
    if (~rst_n) begin
      debounce_counter <= 18'b0;
      debounced <= 1'b0;
    end else begin
      if (button_sync_1 == debounced) begin
        debounce_counter <= 18'b0;
      end else begin
        if (debounce_counter == 18'd250000) begin
          debounced <= button_sync_1;
          debounce_counter <= 18'b0;
        end else begin
          debounce_counter <= debounce_counter + 1;
        end
      end
    end
  end
endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module debug_controller (
    input wire clk,
    input wire rst_n,
    input wire debug_en,
    input wire [7:0] uio_in,
    output wire [7:0] uio_out,
    output wire [7:0] uio_oe,
    input wire [63:0] grid_in,

    output reg grid_out_valid,
    output reg [3:0] grid_out_addr,
    output reg [3:0] grid_out_data,

    output reg [3:0] force_move
);

  wire [3:0] debug_cmd = uio_in[3:0];
  wire [3:0] data_in = uio_in[7:4];

  reg data_out_en;
  reg [3:0] data_out;
  reg [3:0] grid_addr;

  localparam CMD_READ = 1;
  localparam CMD_WRITE = 2;
  localparam CMD_SET_ADDR = 3;
  localparam CMD_FORCE_MOVE = 4;

  assign uio_out = {data_out, 4'b0000};
  assign uio_oe  = {{data_out_en ? 4'b1111 : 4'b0000}, 4'b0000};


  always @(posedge clk) begin
    if (~rst_n) begin
      data_out <= 0;
      data_out_en <= 0;
      grid_addr <= 0;
      grid_out_valid <= 0;
      grid_out_addr <= 0;
      grid_out_data <= 0;
      force_move <= 0;
    end else begin
      data_out_en <= 0;
      grid_out_valid <= 0;
      force_move <= 0;

      case (debug_en ? debug_cmd : 0)
        CMD_READ: begin
          data_out_en <= 1;
          data_out <= grid_in[grid_addr*4+:4];
          grid_addr <= grid_addr + 1;
        end
        CMD_WRITE: begin
          grid_out_data <= data_in;
          grid_out_addr <= grid_addr;
          grid_out_valid <= 1;
          grid_addr <= grid_addr + 1;
        end
        CMD_SET_ADDR: begin
          grid_addr <= data_in;
        end
        CMD_FORCE_MOVE: begin
          force_move <= data_in;
        end
        default: begin
        end
      endcase
    end
  end

endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module draw_game (
    input wire [63:0] grid,
    input wire [15:0] new_tiles,
    input wire [2:0] new_tiles_counter,
    input wire [9:0] x,
    input wire [9:0] y,
    input wire retro_colors,
    input wire debug_mode,
    output reg [5:0] rrggbb
);

  localparam CELL_SIZE = 64;
  localparam BOARD_X_POS = 192;
  localparam BOARD_Y_POS = 128;
  localparam BOARD_WIDTH = CELL_SIZE * 4;
  localparam BOARD_HEIGHT = CELL_SIZE * 4;
  localparam BOARD_X_RIGHT = BOARD_X_POS + BOARD_WIDTH;
  localparam BOARD_Y_BOTTOM = BOARD_Y_POS + BOARD_HEIGHT;

  wire [5:0] color_font = retro_colors ? 6'b101110 : 6'b001111;
  wire [5:0] color_bg = retro_colors ? {3'b000, x[0], 2'b00} : 0;
  wire [5:0] color_outline = retro_colors ? 6'b001000 : 6'b111111;

  wire [9:0] board_x = x - BOARD_X_POS;
  wire [9:0] board_y = y - BOARD_Y_POS;
  wire [1:0] cell_x = board_x[7:6];
  wire [1:0] cell_y = board_y[7:6];
  wire [5:0] cell_offset = {cell_y, cell_x, 2'b00};
  wire [3:0] current_number = grid[cell_offset+:4];
  wire is_new_tile = new_tiles_counter > 0 && new_tiles[{cell_y, cell_x}];

  // Determine if we're on the outline
  wire is_outline_x = (x % CELL_SIZE == 0 || x % CELL_SIZE == (CELL_SIZE - 1));
  wire is_outline_y = (y % CELL_SIZE == 0 || y % CELL_SIZE == (CELL_SIZE - 1));
  wire is_outline = is_outline_x || is_outline_y;

  wire pixel;

  draw_numbers draw_numbers_inst (
      .index(current_number),
      .x(x[5:0]),
      .y(y[5:0]),
      .pixel(pixel)
  );

  wire board_area = x >= BOARD_X_POS && y >= BOARD_Y_POS && x < BOARD_X_RIGHT && y < BOARD_Y_BOTTOM;
  wire [5:0] fade_font_color = 6'b001111 ^ {3'b0, new_tiles_counter};
  wire [5:0] draw_text = is_new_tile ? fade_font_color : color_font;
  wire [5:0] draw_board = is_outline ? color_outline : color_bg;

  wire debug_rect = x >= BOARD_X_POS - 64 && x < BOARD_X_RIGHT + 64 && y >= 16 && y < 32;

  always @(*) begin
    rrggbb = board_area ? pixel ? draw_text : draw_board : debug_mode && debug_rect ? x[8:3] : 6'b0;
  end

endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

module draw_numbers (
    input wire [3:0] index,
    input wire [5:0] x,
    input wire [5:0] y,
    output reg pixel
);

  wire pixel_2;
  glyph_2 inst_glyph_2 (
      .x(x),
      .y(y),
      .pixel(pixel_2)
  );

  wire pixel_4;
  glyph_4 inst_glyph_4 (
      .x(x),
      .y(y),
      .pixel(pixel_4)
  );

  wire pixel_8;
  glyph_8 inst_glyph_8 (
      .x(x),
      .y(y),
      .pixel(pixel_8)
  );

  wire pixel_16;
  glyph_16 inst_glyph_16 (
      .x(x),
      .y(y),
      .pixel(pixel_16)
  );

  wire pixel_32;
  glyph_32 inst_glyph_32 (
      .x(x),
      .y(y),
      .pixel(pixel_32)
  );

  wire pixel_64;
  glyph_64 inst_glyph_64 (
      .x(x),
      .y(y),
      .pixel(pixel_64)
  );

  wire pixel_128;
  glyph_128 inst_glyph_128 (
      .x(x),
      .y(y),
      .pixel(pixel_128)
  );

  wire pixel_256;
  glyph_256 inst_glyph_256 (
      .x(x),
      .y(y),
      .pixel(pixel_256)
  );

  wire pixel_512;
  glyph_512 inst_glyph_512 (
      .x(x),
      .y(y),
      .pixel(pixel_512)
  );

  wire pixel_1024;
  glyph_1024 inst_glyph_1024 (
      .x(x),
      .y(y),
      .pixel(pixel_1024)
  );

  wire pixel_2048;
  glyph_2048 inst_glyph_2048 (
      .x(x),
      .y(y),
      .pixel(pixel_2048)
  );

  always @(*) begin
    case (index)
      1: pixel = pixel_2;
      2: pixel = pixel_4;
      3: pixel = pixel_8;
      4: pixel = pixel_16;
      5: pixel = pixel_32;
      6: pixel = pixel_64;
      7: pixel = pixel_128;
      8: pixel = pixel_256;
      9: pixel = pixel_512;
      10: pixel = pixel_1024;
      11: pixel = pixel_2048;
      default: pixel = 1'b0;
    endcase
  end

endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module galois_lfsr (
    input wire clk,
    input wire rst_n,
    output reg [31:0] lfsr
);

  wire feedback = lfsr[31] ^ lfsr[21] ^ lfsr[1] ^ lfsr[0];

  always @(posedge clk) begin
    if (~rst_n) begin
      lfsr <= 32'h2048FAFA;  // Initialize LFSR to non-zero value
    end else begin
      lfsr <= {lfsr[30:0], feedback};  // Shift left and insert feedback bit
    end
  end

endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module game_logic (
    input wire clk,
    input wire rst_n,

    input wire btn_up,
    input wire btn_right,
    input wire btn_down,
    input wire btn_left,
    input wire btn_start,
    input wire [15:0] lfsr_value,

    input wire debug_move,
    input wire debug_grid_valid,
    input wire [3:0] debug_grid_addr,
    input wire [3:0] debug_grid_data,

    output reg [63:0] grid,
    output reg [3:0] added_tile_index
);

  function [63:0] transpose_grid(input [63:0] grid_in);
    reg [63:0] transposed_grid;
    begin
      transposed_grid[63:60] = grid_in[63:60];  // Row 0, Col 0 -> Row 0, Col 0
      transposed_grid[59:56] = grid_in[47:44];  // Row 1, Col 0 -> Row 0, Col 1
      transposed_grid[55:52] = grid_in[31:28];  // Row 2, Col 0 -> Row 0, Col 2
      transposed_grid[51:48] = grid_in[15:12];  // Row 3, Col 0 -> Row 0, Col 3

      transposed_grid[47:44] = grid_in[59:56];  // Row 0, Col 1 -> Row 1, Col 0
      transposed_grid[43:40] = grid_in[43:40];  // Row 1, Col 1 -> Row 1, Col 1
      transposed_grid[39:36] = grid_in[27:24];  // Row 2, Col 1 -> Row 1, Col 2
      transposed_grid[35:32] = grid_in[11:8];  // Row 3, Col 1 -> Row 1, Col 3

      transposed_grid[31:28] = grid_in[55:52];  // Row 0, Col 2 -> Row 2, Col 0
      transposed_grid[27:24] = grid_in[39:36];  // Row 1, Col 2 -> Row 2, Col 1
      transposed_grid[23:20] = grid_in[23:20];  // Row 2, Col 2 -> Row 2, Col 2
      transposed_grid[19:16] = grid_in[7:4];  // Row 3, Col 2 -> Row 2, Col 3

      transposed_grid[15:12] = grid_in[51:48];  // Row 0, Col 3 -> Row 3, Col 0
      transposed_grid[11:8] = grid_in[35:32];  // Row 1, Col 3 -> Row 3, Col 1
      transposed_grid[7:4] = grid_in[19:16];  // Row 2, Col 3 -> Row 3, Col 2
      transposed_grid[3:0] = grid_in[3:0];  // Row 3, Col 3 -> Row 3, Col 3

      transpose_grid = transposed_grid;
    end
  endfunction

  localparam DIRECTION_LEFT = 2'd0;
  localparam DIRECTION_RIGHT = 2'd1;
  localparam DIRECTION_UP = 2'd2;
  localparam DIRECTION_DOWN = 2'd3;

  reg game_started;
  reg [1:0] add_new_tiles;
  reg [1:0] lfsr_shift;
  wire [3:0] new_tile_index = lfsr_value[lfsr_shift*4+:4];
  reg [1:0] current_direction;

  wire any_button_pressed = btn_up | btn_right | btn_down | btn_left;
  reg prev_any_button_pressed;
  wire button_pressed = ~prev_any_button_pressed & any_button_pressed;
  reg calculate_move;
  reg valid_move;
  reg debug_move_reg;
  reg should_transpose;
  wire [63:0] transposed_grid = transpose_grid(grid);
  reg [1:0] current_row_index;
  wire [15:0] current_row = grid[current_row_index*16+:16];
  wire [15:0] current_row_pushed_merged;

  game_row_push_merge push_merge (
      .row(current_row),
      .push_right(current_direction == DIRECTION_RIGHT || current_direction == DIRECTION_DOWN),
      .result_row(current_row_pushed_merged)
  );

  always @(posedge clk) begin
    if (~rst_n) begin
      add_new_tiles <= 0;
      lfsr_shift <= 0;
      grid <= 0;
      prev_any_button_pressed <= 0;
      current_direction <= 0;
      current_row_index <= 0;
      should_transpose <= 0;
      game_started <= 0;
      calculate_move <= 0;
      valid_move <= 0;
      debug_move_reg <= 0;
      added_tile_index <= 0;
    end else begin
      lfsr_shift <= lfsr_shift - 2'd1;
      added_tile_index <= 0;
      prev_any_button_pressed <= any_button_pressed;
      if (~game_started) begin
        if (button_pressed || btn_start) begin
          game_started  <= 1;
          add_new_tiles <= 2;
        end
      end else if (button_pressed) begin
        if (btn_left) begin
          current_direction <= DIRECTION_LEFT;
        end else if (btn_right) begin
          current_direction <= DIRECTION_RIGHT;
        end else if (btn_up) begin
          current_direction <= DIRECTION_UP;
        end else if (btn_down) begin
          current_direction <= DIRECTION_DOWN;
        end
        if (btn_up | btn_down) begin
          should_transpose <= 1;
        end
        current_row_index <= 0;
        valid_move <= 0;
        calculate_move <= 1;
        debug_move_reg <= debug_move;
      end else if (should_transpose) begin
        grid <= transposed_grid;
        should_transpose <= 0;
      end else if (calculate_move) begin
        if (current_row != current_row_pushed_merged) begin
          valid_move <= 1;
        end
        grid[current_row_index*16+:16] <= current_row_pushed_merged;

        current_row_index <= current_row_index + 1;
        if (current_row_index == 2'd3) begin
          if (current_direction == DIRECTION_UP || current_direction == DIRECTION_DOWN) begin
            should_transpose <= 1;
          end
          add_new_tiles  <= (current_row != current_row_pushed_merged || valid_move) && !debug_move_reg ? 1 : 0;
          calculate_move <= 0;
        end
      end else if (add_new_tiles != 0) begin
        if (grid[new_tile_index*4+:4] == 0) begin
          grid[new_tile_index*4+:4] <= 1;
          added_tile_index <= new_tile_index;
          add_new_tiles <= add_new_tiles - 1;
        end
      end
    end

    if (debug_grid_valid) begin
      grid[debug_grid_addr*4+:4] <= debug_grid_data;
    end
  end
endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module game_row_push_merge (
    input  wire [15:0] row,         // 4x4 grid row input
    input  wire        push_right,  // 0 to push left, 1 to push right
    output reg  [15:0] result_row   // Processed output row
);

  reg [3:0] result_0, result_1, result_2, result_3;
  reg merged_0;
  reg merged_1;
  reg [3:0] value;
  integer i, j;

  always @(*) begin
    // Initialize result cells to 0
    result_0 = 4'b0000;
    result_1 = 4'b0000;
    result_2 = 4'b0000;
    result_3 = 4'b0000;
    merged_0 = 1'b0;
    merged_1 = 1'b0;

    j = 0;  // Index to track the current position in the result

    // Process each cell in the row
    for (i = 0; i < 4; i = i + 1) begin
      value = push_right ? row[15-i*4-:4] : row[i*4+:4];  // Extract each 4-bit cell

      if (value != 4'b0000) begin
        case (j)
          0: result_0 = value;
          1: begin
            if (value == result_0 && !merged_0) begin
              result_0 = result_0 + 1;  // Merge with the previous value
              j = j - 1;  // Reduce j as the merge took place
              merged_0 = 1'b1;
            end else begin
              result_1 = value;
            end
          end
          2: begin
            if (value == result_1 && !merged_1) begin
              result_1 = result_1 + 1;  // Merge with the previous value
              j = j - 1;  // Reduce j as the merge took place
              merged_1 = 1'b1;
            end else begin
              result_2 = value;
            end
          end
          3: begin
            if (value == result_2) begin
              result_2 = result_2 + 1;  // Merge with the previous value
              j = j - 1;  // Reduce j as the merge took place
            end else begin
              result_3 = value;
            end
          end
        endcase
        j = j + 1;
      end
    end

    // Combine result cells into a single 16-bit value
    result_row = push_right ? {result_0, result_1, result_2, result_3} : {result_3, result_2, result_1, result_0};
  end

endmodule


/*
 * Copyright (c) 2025 Pat Deegan, https://psychogenic.com
 * SPDX-License-Identifier: Apache-2.0
 * Version: 1.0.0
 *
 * Interfacing code for the Gamepad Pmod from Psycogenic Technologies,
 * designed for Tiny Tapeout.
 *
 * There are two high-level modules that most users will be interested in:
 * - gamepad_pmod_single: for a single controller;
 * - gamepad_pmod_dual: for two controllers.
 * 
 * There are also two lower-level modules that you can use if you want to
 * handle the interfacing yourself:
 * - gamepad_pmod_driver: interfaces with the Pmod and provides the raw data;
 * - gamepad_pmod_decoder: decodes the raw data into button states.
 *
 * The docs, schematics, PCB files, and firmware code for the Gamepad Pmod
 * are available at https://github.com/psychogenic/gamepad-pmod.
 */

/**
 * gamepad_pmod_driver -- Serial interface for the Gamepad Pmod.
 *
 * This module reads raw data from the Gamepad Pmod *serially*
 * and stores it in a shift register. When the latch signal is received, 
 * the data is transferred into `data_reg` for further processing.
 *
 * Functionality:
 *   - Synchronizes the `pmod_data`, `pmod_clk`, and `pmod_latch` signals 
 *     to the system clock domain.
 *   - Captures serial data on each falling edge of `pmod_clk`.
 *   - Transfers the shifted data into `data_reg` when `pmod_latch` goes low.
 *
 * Parameters:
 *   - `BIT_WIDTH`: Defines the width of `data_reg` (default: 24 bits).
 *
 * Inputs:
 *   - `rst_n`: Active-low reset.
 *   - `clk`: System clock.
 *   - `pmod_data`: Serial data input from the Pmod.
 *   - `pmod_clk`: Serial clock from the Pmod.
 *   - `pmod_latch`: Latch signal indicating the end of data transmission.
 *
 * Outputs:
 *   - `data_reg`: Captured parallel data after shifting is complete.
 */
module gamepad_pmod_driver #(
    parameter BIT_WIDTH = 24
) (
    input wire rst_n,
    input wire clk,
    input wire pmod_data,
    input wire pmod_clk,
    input wire pmod_latch,
    output reg [BIT_WIDTH-1:0] data_reg
);

  reg pmod_clk_prev;
  reg pmod_latch_prev;
  reg [BIT_WIDTH-1:0] shift_reg;

  // Sync Pmod signals to the clk domain:
  reg [1:0] pmod_data_sync;
  reg [1:0] pmod_clk_sync;
  reg [1:0] pmod_latch_sync;

  always @(posedge clk) begin
    if (~rst_n) begin
      pmod_data_sync  <= 2'b0;
      pmod_clk_sync   <= 2'b0;
      pmod_latch_sync <= 2'b0;
    end else begin
      pmod_data_sync  <= {pmod_data_sync[0], pmod_data};
      pmod_clk_sync   <= {pmod_clk_sync[0], pmod_clk};
      pmod_latch_sync <= {pmod_latch_sync[0], pmod_latch};
    end
  end

  always @(posedge clk) begin
    if (~rst_n) begin
      /* Initialize data and shift registers to all 1s so they're detected as "not present".
       * This accounts for cases where we have:
       *  - setup for 2 controllers;
       *  - only a single controller is connected; and
       *  - the driver in those cases only sends bits for a single controller.
       */
      data_reg <= {BIT_WIDTH{1'b1}};
      shift_reg <= {BIT_WIDTH{1'b1}};
      pmod_clk_prev <= 1'b0;
      pmod_latch_prev <= 1'b0;
    end
    begin
      pmod_clk_prev   <= pmod_clk_sync[1];
      pmod_latch_prev <= pmod_latch_sync[1];

      // Capture data on rising edge of pmod_latch:
      if (pmod_latch_sync[1] & ~pmod_latch_prev) begin
        data_reg <= shift_reg;
      end

      // Sample data on rising edge of pmod_clk:
      if (pmod_clk_sync[1] & ~pmod_clk_prev) begin
        shift_reg <= {shift_reg[BIT_WIDTH-2:0], pmod_data_sync[1]};
      end
    end
  end

endmodule


/**
 * gamepad_pmod_decoder -- Decodes raw data from the Gamepad Pmod.
 *
 * This module takes a 12-bit parallel data register (`data_reg`) 
 * and decodes it into individual button states. It also determines
 * whether a controller is connected.
 *
 * Functionality:
 *   - If `data_reg` contains all `1's` (`0xFFF`), it indicates that no controller is connected.
 *   - Otherwise, it extracts individual button states from `data_reg`.
 *
 * Inputs:
 *   - `data_reg [11:0]`: Captured button state data from the gamepad.
 *
 * Outputs:
 *   - `b, y, select, start, up, down, left, right, a, x, l, r`: Individual button states (`1` = pressed, `0` = released).
 *   - `is_present`: Indicates whether a controller is connected (`1` = connected, `0` = not connected).
 */
module gamepad_pmod_decoder (
    input wire [11:0] data_reg,
    output wire b,
    output wire y,
    output wire select,
    output wire start,
    output wire up,
    output wire down,
    output wire left,
    output wire right,
    output wire a,
    output wire x,
    output wire l,
    output wire r,
    output wire is_present
);

  // When the controller is not connected, the data register will be all 1's
  wire reg_empty = (data_reg == 12'hfff);
  assign is_present = reg_empty ? 0 : 1'b1;
  assign {b, y, select, start, up, down, left, right, a, x, l, r} = reg_empty ? 0 : data_reg;

endmodule


/**
 * gamepad_pmod_single -- Main interface for a single Gamepad Pmod controller.
 * 
 * This module provides button states for a **single controller**, reducing 
 * resource usage (fewer flip-flops) compared to a dual-controller version.
 * 
 * Inputs:
 *   - `pmod_data`, `pmod_clk`, and `pmod_latch` are the signals from the PMOD interface.
 * 
 * Outputs:
 *   - Each button's state is provided as a single-bit wire (e.g., `start`, `up`, etc.).
 *   - `is_present` indicates whether the controller is connected (`1` = connected, `0` = not detected).
 */
module gamepad_pmod_single (
    input wire rst_n,
    input wire clk,
    input wire pmod_data,
    input wire pmod_clk,
    input wire pmod_latch,

    output wire b,
    output wire y,
    output wire select,
    output wire start,
    output wire up,
    output wire down,
    output wire left,
    output wire right,
    output wire a,
    output wire x,
    output wire l,
    output wire r,
    output wire is_present
);

  wire [11:0] gamepad_pmod_data;

  gamepad_pmod_driver #(
      .BIT_WIDTH(12)
  ) driver (
      .rst_n(rst_n),
      .clk(clk),
      .pmod_data(pmod_data),
      .pmod_clk(pmod_clk),
      .pmod_latch(pmod_latch),
      .data_reg(gamepad_pmod_data)
  );

  gamepad_pmod_decoder decoder (
      .data_reg(gamepad_pmod_data),
      .b(b),
      .y(y),
      .select(select),
      .start(start),
      .up(up),
      .down(down),
      .left(left),
      .right(right),
      .a(a),
      .x(x),
      .l(l),
      .r(r),
      .is_present(is_present)
  );

endmodule


/**
 * gamepad_pmod_dual -- Main interface for the Pmod gamepad.
 * This module provides button states for two controllers using
 * 2-bit vectors for each button (e.g., start[1:0], up[1:0], etc.).
 * 
 * Each button state is represented as a 2-bit vector:
 *   - Index 0 corresponds to the first controller (e.g., up[0], y[0], etc.).
 *   - Index 1 corresponds to the second controller (e.g., up[1], y[1], etc.).
 *
 * The `is_present` signal indicates whether a controller is connected:
 *   - `is_present[0] == 1` when the first controller is connected.
 *   - `is_present[1] == 1` when the second controller is connected.
 *
 * Inputs:
 *   - `pmod_data`, `pmod_clk`, and `pmod_latch` are the 3 wires coming from the Pmod interface.
 *
 * Outputs:
 *   - Button state vectors for each controller.
 *   - Presence detection via `is_present`.
 */
module gamepad_pmod_dual (
    input wire rst_n,
    input wire clk,
    input wire pmod_data,
    input wire pmod_clk,
    input wire pmod_latch,

    output wire [1:0] b,
    output wire [1:0] y,
    output wire [1:0] select,
    output wire [1:0] start,
    output wire [1:0] up,
    output wire [1:0] down,
    output wire [1:0] left,
    output wire [1:0] right,
    output wire [1:0] a,
    output wire [1:0] x,
    output wire [1:0] l,
    output wire [1:0] r,
    output wire [1:0] is_present
);

  wire [23:0] gamepad_pmod_data;

  gamepad_pmod_driver driver (
      .rst_n(rst_n),
      .clk(clk),
      .pmod_data(pmod_data),
      .pmod_clk(pmod_clk),
      .pmod_latch(pmod_latch),
      .data_reg(gamepad_pmod_data)
  );

  gamepad_pmod_decoder decoder1 (
      .data_reg(gamepad_pmod_data[11:0]),
      .b(b[0]),
      .y(y[0]),
      .select(select[0]),
      .start(start[0]),
      .up(up[0]),
      .down(down[0]),
      .left(left[0]),
      .right(right[0]),
      .a(a[0]),
      .x(x[0]),
      .l(l[0]),
      .r(r[0]),
      .is_present(is_present[0])
  );

  gamepad_pmod_decoder decoder2 (
      .data_reg(gamepad_pmod_data[23:12]),
      .b(b[1]),
      .y(y[1]),
      .select(select[1]),
      .start(start[1]),
      .up(up[1]),
      .down(down[1]),
      .left(left[1]),
      .right(right[1]),
      .a(a[1]),
      .x(x[1]),
      .l(l[1]),
      .r(r[1]),
      .is_present(is_present[1])
  );

endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

module glyph_2 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'hf0;
    mem[140] = 8'h3f;
    mem[141] = 8'h00;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'hfc;
    mem[148] = 8'hff;
    mem[149] = 8'h00;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'hfe;
    mem[156] = 8'hff;
    mem[157] = 8'h01;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h00;
    mem[162] = 8'h00;
    mem[163] = 8'h1f;
    mem[164] = 8'hf0;
    mem[165] = 8'h03;
    mem[166] = 8'h00;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'h00;
    mem[170] = 8'h00;
    mem[171] = 8'h0f;
    mem[172] = 8'he0;
    mem[173] = 8'h07;
    mem[174] = 8'h00;
    mem[175] = 8'h00;
    mem[176] = 8'h00;
    mem[177] = 8'h00;
    mem[178] = 8'h80;
    mem[179] = 8'h07;
    mem[180] = 8'hc0;
    mem[181] = 8'h07;
    mem[182] = 8'h00;
    mem[183] = 8'h00;
    mem[184] = 8'h00;
    mem[185] = 8'h00;
    mem[186] = 8'h80;
    mem[187] = 8'h07;
    mem[188] = 8'h80;
    mem[189] = 8'h07;
    mem[190] = 8'h00;
    mem[191] = 8'h00;
    mem[192] = 8'h00;
    mem[193] = 8'h00;
    mem[194] = 8'hc0;
    mem[195] = 8'h07;
    mem[196] = 8'h80;
    mem[197] = 8'h07;
    mem[198] = 8'h00;
    mem[199] = 8'h00;
    mem[200] = 8'h00;
    mem[201] = 8'h00;
    mem[202] = 8'hc0;
    mem[203] = 8'h03;
    mem[204] = 8'h80;
    mem[205] = 8'h07;
    mem[206] = 8'h00;
    mem[207] = 8'h00;
    mem[208] = 8'h00;
    mem[209] = 8'h00;
    mem[210] = 8'hc0;
    mem[211] = 8'h03;
    mem[212] = 8'h80;
    mem[213] = 8'h07;
    mem[214] = 8'h00;
    mem[215] = 8'h00;
    mem[216] = 8'h00;
    mem[217] = 8'h00;
    mem[218] = 8'h00;
    mem[219] = 8'h00;
    mem[220] = 8'h80;
    mem[221] = 8'h07;
    mem[222] = 8'h00;
    mem[223] = 8'h00;
    mem[224] = 8'h00;
    mem[225] = 8'h00;
    mem[226] = 8'h00;
    mem[227] = 8'h00;
    mem[228] = 8'h80;
    mem[229] = 8'h07;
    mem[230] = 8'h00;
    mem[231] = 8'h00;
    mem[232] = 8'h00;
    mem[233] = 8'h00;
    mem[234] = 8'h00;
    mem[235] = 8'h00;
    mem[236] = 8'hc0;
    mem[237] = 8'h07;
    mem[238] = 8'h00;
    mem[239] = 8'h00;
    mem[240] = 8'h00;
    mem[241] = 8'h00;
    mem[242] = 8'h00;
    mem[243] = 8'h00;
    mem[244] = 8'hc0;
    mem[245] = 8'h03;
    mem[246] = 8'h00;
    mem[247] = 8'h00;
    mem[248] = 8'h00;
    mem[249] = 8'h00;
    mem[250] = 8'h00;
    mem[251] = 8'h00;
    mem[252] = 8'he0;
    mem[253] = 8'h03;
    mem[254] = 8'h00;
    mem[255] = 8'h00;
    mem[256] = 8'h00;
    mem[257] = 8'h00;
    mem[258] = 8'h00;
    mem[259] = 8'h00;
    mem[260] = 8'hf0;
    mem[261] = 8'h01;
    mem[262] = 8'h00;
    mem[263] = 8'h00;
    mem[264] = 8'h00;
    mem[265] = 8'h00;
    mem[266] = 8'h00;
    mem[267] = 8'h00;
    mem[268] = 8'hf8;
    mem[269] = 8'h00;
    mem[270] = 8'h00;
    mem[271] = 8'h00;
    mem[272] = 8'h00;
    mem[273] = 8'h00;
    mem[274] = 8'h00;
    mem[275] = 8'h00;
    mem[276] = 8'h7c;
    mem[277] = 8'h00;
    mem[278] = 8'h00;
    mem[279] = 8'h00;
    mem[280] = 8'h00;
    mem[281] = 8'h00;
    mem[282] = 8'h00;
    mem[283] = 8'h00;
    mem[284] = 8'h3e;
    mem[285] = 8'h00;
    mem[286] = 8'h00;
    mem[287] = 8'h00;
    mem[288] = 8'h00;
    mem[289] = 8'h00;
    mem[290] = 8'h00;
    mem[291] = 8'h00;
    mem[292] = 8'h3f;
    mem[293] = 8'h00;
    mem[294] = 8'h00;
    mem[295] = 8'h00;
    mem[296] = 8'h00;
    mem[297] = 8'h00;
    mem[298] = 8'h00;
    mem[299] = 8'h80;
    mem[300] = 8'h1f;
    mem[301] = 8'h00;
    mem[302] = 8'h00;
    mem[303] = 8'h00;
    mem[304] = 8'h00;
    mem[305] = 8'h00;
    mem[306] = 8'h00;
    mem[307] = 8'hc0;
    mem[308] = 8'h0f;
    mem[309] = 8'h00;
    mem[310] = 8'h00;
    mem[311] = 8'h00;
    mem[312] = 8'h00;
    mem[313] = 8'h00;
    mem[314] = 8'h00;
    mem[315] = 8'he0;
    mem[316] = 8'h07;
    mem[317] = 8'h00;
    mem[318] = 8'h00;
    mem[319] = 8'h00;
    mem[320] = 8'h00;
    mem[321] = 8'h00;
    mem[322] = 8'h00;
    mem[323] = 8'hf0;
    mem[324] = 8'h03;
    mem[325] = 8'h00;
    mem[326] = 8'h00;
    mem[327] = 8'h00;
    mem[328] = 8'h00;
    mem[329] = 8'h00;
    mem[330] = 8'h00;
    mem[331] = 8'hf8;
    mem[332] = 8'h01;
    mem[333] = 8'h00;
    mem[334] = 8'h00;
    mem[335] = 8'h00;
    mem[336] = 8'h00;
    mem[337] = 8'h00;
    mem[338] = 8'h00;
    mem[339] = 8'hfc;
    mem[340] = 8'h00;
    mem[341] = 8'h00;
    mem[342] = 8'h00;
    mem[343] = 8'h00;
    mem[344] = 8'h00;
    mem[345] = 8'h00;
    mem[346] = 8'h00;
    mem[347] = 8'h3e;
    mem[348] = 8'h00;
    mem[349] = 8'h00;
    mem[350] = 8'h00;
    mem[351] = 8'h00;
    mem[352] = 8'h00;
    mem[353] = 8'h00;
    mem[354] = 8'h00;
    mem[355] = 8'h1f;
    mem[356] = 8'h00;
    mem[357] = 8'h00;
    mem[358] = 8'h00;
    mem[359] = 8'h00;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'h80;
    mem[363] = 8'h0f;
    mem[364] = 8'h00;
    mem[365] = 8'h00;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'hc0;
    mem[371] = 8'h0f;
    mem[372] = 8'h00;
    mem[373] = 8'h00;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'he0;
    mem[379] = 8'hff;
    mem[380] = 8'hff;
    mem[381] = 8'h0f;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'he0;
    mem[387] = 8'hff;
    mem[388] = 8'hff;
    mem[389] = 8'h0f;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'he0;
    mem[395] = 8'hff;
    mem[396] = 8'hff;
    mem[397] = 8'h0f;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_4 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'h00;
    mem[140] = 8'hf0;
    mem[141] = 8'h01;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'h00;
    mem[148] = 8'hf8;
    mem[149] = 8'h01;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'h00;
    mem[156] = 8'hfc;
    mem[157] = 8'h01;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h00;
    mem[162] = 8'h00;
    mem[163] = 8'h00;
    mem[164] = 8'hfc;
    mem[165] = 8'h01;
    mem[166] = 8'h00;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'h00;
    mem[170] = 8'h00;
    mem[171] = 8'h00;
    mem[172] = 8'hfe;
    mem[173] = 8'h01;
    mem[174] = 8'h00;
    mem[175] = 8'h00;
    mem[176] = 8'h00;
    mem[177] = 8'h00;
    mem[178] = 8'h00;
    mem[179] = 8'h00;
    mem[180] = 8'hff;
    mem[181] = 8'h01;
    mem[182] = 8'h00;
    mem[183] = 8'h00;
    mem[184] = 8'h00;
    mem[185] = 8'h00;
    mem[186] = 8'h00;
    mem[187] = 8'h80;
    mem[188] = 8'hf7;
    mem[189] = 8'h01;
    mem[190] = 8'h00;
    mem[191] = 8'h00;
    mem[192] = 8'h00;
    mem[193] = 8'h00;
    mem[194] = 8'h00;
    mem[195] = 8'h80;
    mem[196] = 8'hf7;
    mem[197] = 8'h01;
    mem[198] = 8'h00;
    mem[199] = 8'h00;
    mem[200] = 8'h00;
    mem[201] = 8'h00;
    mem[202] = 8'h00;
    mem[203] = 8'hc0;
    mem[204] = 8'hf3;
    mem[205] = 8'h01;
    mem[206] = 8'h00;
    mem[207] = 8'h00;
    mem[208] = 8'h00;
    mem[209] = 8'h00;
    mem[210] = 8'h00;
    mem[211] = 8'he0;
    mem[212] = 8'hf3;
    mem[213] = 8'h01;
    mem[214] = 8'h00;
    mem[215] = 8'h00;
    mem[216] = 8'h00;
    mem[217] = 8'h00;
    mem[218] = 8'h00;
    mem[219] = 8'he0;
    mem[220] = 8'hf1;
    mem[221] = 8'h01;
    mem[222] = 8'h00;
    mem[223] = 8'h00;
    mem[224] = 8'h00;
    mem[225] = 8'h00;
    mem[226] = 8'h00;
    mem[227] = 8'hf0;
    mem[228] = 8'hf0;
    mem[229] = 8'h01;
    mem[230] = 8'h00;
    mem[231] = 8'h00;
    mem[232] = 8'h00;
    mem[233] = 8'h00;
    mem[234] = 8'h00;
    mem[235] = 8'hf8;
    mem[236] = 8'hf0;
    mem[237] = 8'h01;
    mem[238] = 8'h00;
    mem[239] = 8'h00;
    mem[240] = 8'h00;
    mem[241] = 8'h00;
    mem[242] = 8'h00;
    mem[243] = 8'h78;
    mem[244] = 8'hf0;
    mem[245] = 8'h01;
    mem[246] = 8'h00;
    mem[247] = 8'h00;
    mem[248] = 8'h00;
    mem[249] = 8'h00;
    mem[250] = 8'h00;
    mem[251] = 8'h3c;
    mem[252] = 8'hf0;
    mem[253] = 8'h01;
    mem[254] = 8'h00;
    mem[255] = 8'h00;
    mem[256] = 8'h00;
    mem[257] = 8'h00;
    mem[258] = 8'h00;
    mem[259] = 8'h1e;
    mem[260] = 8'hf0;
    mem[261] = 8'h01;
    mem[262] = 8'h00;
    mem[263] = 8'h00;
    mem[264] = 8'h00;
    mem[265] = 8'h00;
    mem[266] = 8'h00;
    mem[267] = 8'h1e;
    mem[268] = 8'hf0;
    mem[269] = 8'h01;
    mem[270] = 8'h00;
    mem[271] = 8'h00;
    mem[272] = 8'h00;
    mem[273] = 8'h00;
    mem[274] = 8'h00;
    mem[275] = 8'h0f;
    mem[276] = 8'hf0;
    mem[277] = 8'h01;
    mem[278] = 8'h00;
    mem[279] = 8'h00;
    mem[280] = 8'h00;
    mem[281] = 8'h00;
    mem[282] = 8'h80;
    mem[283] = 8'h07;
    mem[284] = 8'hf0;
    mem[285] = 8'h01;
    mem[286] = 8'h00;
    mem[287] = 8'h00;
    mem[288] = 8'h00;
    mem[289] = 8'h00;
    mem[290] = 8'hc0;
    mem[291] = 8'h07;
    mem[292] = 8'hf0;
    mem[293] = 8'h01;
    mem[294] = 8'h00;
    mem[295] = 8'h00;
    mem[296] = 8'h00;
    mem[297] = 8'h00;
    mem[298] = 8'hc0;
    mem[299] = 8'h03;
    mem[300] = 8'hf0;
    mem[301] = 8'h01;
    mem[302] = 8'h00;
    mem[303] = 8'h00;
    mem[304] = 8'h00;
    mem[305] = 8'h00;
    mem[306] = 8'he0;
    mem[307] = 8'h01;
    mem[308] = 8'hf0;
    mem[309] = 8'h01;
    mem[310] = 8'h00;
    mem[311] = 8'h00;
    mem[312] = 8'h00;
    mem[313] = 8'h00;
    mem[314] = 8'hf0;
    mem[315] = 8'hff;
    mem[316] = 8'hff;
    mem[317] = 8'h1f;
    mem[318] = 8'h00;
    mem[319] = 8'h00;
    mem[320] = 8'h00;
    mem[321] = 8'h00;
    mem[322] = 8'hf0;
    mem[323] = 8'hff;
    mem[324] = 8'hff;
    mem[325] = 8'h1f;
    mem[326] = 8'h00;
    mem[327] = 8'h00;
    mem[328] = 8'h00;
    mem[329] = 8'h00;
    mem[330] = 8'hf0;
    mem[331] = 8'hff;
    mem[332] = 8'hff;
    mem[333] = 8'h1f;
    mem[334] = 8'h00;
    mem[335] = 8'h00;
    mem[336] = 8'h00;
    mem[337] = 8'h00;
    mem[338] = 8'h00;
    mem[339] = 8'h00;
    mem[340] = 8'hf0;
    mem[341] = 8'h01;
    mem[342] = 8'h00;
    mem[343] = 8'h00;
    mem[344] = 8'h00;
    mem[345] = 8'h00;
    mem[346] = 8'h00;
    mem[347] = 8'h00;
    mem[348] = 8'hf0;
    mem[349] = 8'h01;
    mem[350] = 8'h00;
    mem[351] = 8'h00;
    mem[352] = 8'h00;
    mem[353] = 8'h00;
    mem[354] = 8'h00;
    mem[355] = 8'h00;
    mem[356] = 8'hf0;
    mem[357] = 8'h01;
    mem[358] = 8'h00;
    mem[359] = 8'h00;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'h00;
    mem[363] = 8'h00;
    mem[364] = 8'hf0;
    mem[365] = 8'h01;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'h00;
    mem[371] = 8'h00;
    mem[372] = 8'hf0;
    mem[373] = 8'h01;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'h00;
    mem[379] = 8'h00;
    mem[380] = 8'hf0;
    mem[381] = 8'h01;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'h00;
    mem[387] = 8'h00;
    mem[388] = 8'hf0;
    mem[389] = 8'h01;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'h00;
    mem[395] = 8'h00;
    mem[396] = 8'hf0;
    mem[397] = 8'h01;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_8 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'hf8;
    mem[140] = 8'h3f;
    mem[141] = 8'h00;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'hfe;
    mem[148] = 8'h7f;
    mem[149] = 8'h00;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'hff;
    mem[156] = 8'hff;
    mem[157] = 8'h01;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h00;
    mem[162] = 8'h80;
    mem[163] = 8'h1f;
    mem[164] = 8'hf0;
    mem[165] = 8'h03;
    mem[166] = 8'h00;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'h00;
    mem[170] = 8'hc0;
    mem[171] = 8'h07;
    mem[172] = 8'he0;
    mem[173] = 8'h03;
    mem[174] = 8'h00;
    mem[175] = 8'h00;
    mem[176] = 8'h00;
    mem[177] = 8'h00;
    mem[178] = 8'hc0;
    mem[179] = 8'h07;
    mem[180] = 8'hc0;
    mem[181] = 8'h07;
    mem[182] = 8'h00;
    mem[183] = 8'h00;
    mem[184] = 8'h00;
    mem[185] = 8'h00;
    mem[186] = 8'hc0;
    mem[187] = 8'h03;
    mem[188] = 8'hc0;
    mem[189] = 8'h07;
    mem[190] = 8'h00;
    mem[191] = 8'h00;
    mem[192] = 8'h00;
    mem[193] = 8'h00;
    mem[194] = 8'hc0;
    mem[195] = 8'h03;
    mem[196] = 8'hc0;
    mem[197] = 8'h07;
    mem[198] = 8'h00;
    mem[199] = 8'h00;
    mem[200] = 8'h00;
    mem[201] = 8'h00;
    mem[202] = 8'hc0;
    mem[203] = 8'h03;
    mem[204] = 8'hc0;
    mem[205] = 8'h07;
    mem[206] = 8'h00;
    mem[207] = 8'h00;
    mem[208] = 8'h00;
    mem[209] = 8'h00;
    mem[210] = 8'hc0;
    mem[211] = 8'h03;
    mem[212] = 8'hc0;
    mem[213] = 8'h07;
    mem[214] = 8'h00;
    mem[215] = 8'h00;
    mem[216] = 8'h00;
    mem[217] = 8'h00;
    mem[218] = 8'hc0;
    mem[219] = 8'h03;
    mem[220] = 8'hc0;
    mem[221] = 8'h07;
    mem[222] = 8'h00;
    mem[223] = 8'h00;
    mem[224] = 8'h00;
    mem[225] = 8'h00;
    mem[226] = 8'hc0;
    mem[227] = 8'h07;
    mem[228] = 8'hc0;
    mem[229] = 8'h03;
    mem[230] = 8'h00;
    mem[231] = 8'h00;
    mem[232] = 8'h00;
    mem[233] = 8'h00;
    mem[234] = 8'h80;
    mem[235] = 8'h0f;
    mem[236] = 8'he0;
    mem[237] = 8'h03;
    mem[238] = 8'h00;
    mem[239] = 8'h00;
    mem[240] = 8'h00;
    mem[241] = 8'h00;
    mem[242] = 8'h00;
    mem[243] = 8'h1f;
    mem[244] = 8'hf8;
    mem[245] = 8'h01;
    mem[246] = 8'h00;
    mem[247] = 8'h00;
    mem[248] = 8'h00;
    mem[249] = 8'h00;
    mem[250] = 8'h00;
    mem[251] = 8'hfe;
    mem[252] = 8'hff;
    mem[253] = 8'h00;
    mem[254] = 8'h00;
    mem[255] = 8'h00;
    mem[256] = 8'h00;
    mem[257] = 8'h00;
    mem[258] = 8'h00;
    mem[259] = 8'hfc;
    mem[260] = 8'h3f;
    mem[261] = 8'h00;
    mem[262] = 8'h00;
    mem[263] = 8'h00;
    mem[264] = 8'h00;
    mem[265] = 8'h00;
    mem[266] = 8'h00;
    mem[267] = 8'hff;
    mem[268] = 8'hff;
    mem[269] = 8'h00;
    mem[270] = 8'h00;
    mem[271] = 8'h00;
    mem[272] = 8'h00;
    mem[273] = 8'h00;
    mem[274] = 8'h80;
    mem[275] = 8'h1f;
    mem[276] = 8'hfc;
    mem[277] = 8'h01;
    mem[278] = 8'h00;
    mem[279] = 8'h00;
    mem[280] = 8'h00;
    mem[281] = 8'h00;
    mem[282] = 8'hc0;
    mem[283] = 8'h07;
    mem[284] = 8'he0;
    mem[285] = 8'h03;
    mem[286] = 8'h00;
    mem[287] = 8'h00;
    mem[288] = 8'h00;
    mem[289] = 8'h00;
    mem[290] = 8'he0;
    mem[291] = 8'h03;
    mem[292] = 8'hc0;
    mem[293] = 8'h03;
    mem[294] = 8'h00;
    mem[295] = 8'h00;
    mem[296] = 8'h00;
    mem[297] = 8'h00;
    mem[298] = 8'he0;
    mem[299] = 8'h01;
    mem[300] = 8'hc0;
    mem[301] = 8'h07;
    mem[302] = 8'h00;
    mem[303] = 8'h00;
    mem[304] = 8'h00;
    mem[305] = 8'h00;
    mem[306] = 8'hf0;
    mem[307] = 8'h01;
    mem[308] = 8'h80;
    mem[309] = 8'h07;
    mem[310] = 8'h00;
    mem[311] = 8'h00;
    mem[312] = 8'h00;
    mem[313] = 8'h00;
    mem[314] = 8'hf0;
    mem[315] = 8'h01;
    mem[316] = 8'h80;
    mem[317] = 8'h07;
    mem[318] = 8'h00;
    mem[319] = 8'h00;
    mem[320] = 8'h00;
    mem[321] = 8'h00;
    mem[322] = 8'hf0;
    mem[323] = 8'h01;
    mem[324] = 8'h80;
    mem[325] = 8'h07;
    mem[326] = 8'h00;
    mem[327] = 8'h00;
    mem[328] = 8'h00;
    mem[329] = 8'h00;
    mem[330] = 8'hf0;
    mem[331] = 8'h01;
    mem[332] = 8'h80;
    mem[333] = 8'h07;
    mem[334] = 8'h00;
    mem[335] = 8'h00;
    mem[336] = 8'h00;
    mem[337] = 8'h00;
    mem[338] = 8'hf0;
    mem[339] = 8'h01;
    mem[340] = 8'h80;
    mem[341] = 8'h07;
    mem[342] = 8'h00;
    mem[343] = 8'h00;
    mem[344] = 8'h00;
    mem[345] = 8'h00;
    mem[346] = 8'hf0;
    mem[347] = 8'h01;
    mem[348] = 8'hc0;
    mem[349] = 8'h07;
    mem[350] = 8'h00;
    mem[351] = 8'h00;
    mem[352] = 8'h00;
    mem[353] = 8'h00;
    mem[354] = 8'he0;
    mem[355] = 8'h03;
    mem[356] = 8'hc0;
    mem[357] = 8'h07;
    mem[358] = 8'h00;
    mem[359] = 8'h00;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'he0;
    mem[363] = 8'h03;
    mem[364] = 8'he0;
    mem[365] = 8'h03;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'hc0;
    mem[371] = 8'h0f;
    mem[372] = 8'hf0;
    mem[373] = 8'h03;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'h80;
    mem[379] = 8'hff;
    mem[380] = 8'hff;
    mem[381] = 8'h01;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'h00;
    mem[387] = 8'hff;
    mem[388] = 8'h7f;
    mem[389] = 8'h00;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'h00;
    mem[395] = 8'hfc;
    mem[396] = 8'h1f;
    mem[397] = 8'h00;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_16 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'hfc;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'hfc;
    mem[142] = 8'h0f;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'hff;
    mem[147] = 8'h00;
    mem[148] = 8'h00;
    mem[149] = 8'hff;
    mem[150] = 8'h1f;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h80;
    mem[154] = 8'hff;
    mem[155] = 8'h00;
    mem[156] = 8'h80;
    mem[157] = 8'hff;
    mem[158] = 8'h7f;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'he0;
    mem[162] = 8'hff;
    mem[163] = 8'h00;
    mem[164] = 8'hc0;
    mem[165] = 8'h07;
    mem[166] = 8'h7c;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'hf8;
    mem[170] = 8'hff;
    mem[171] = 8'h00;
    mem[172] = 8'he0;
    mem[173] = 8'h03;
    mem[174] = 8'hf8;
    mem[175] = 8'h00;
    mem[176] = 8'h00;
    mem[177] = 8'hfc;
    mem[178] = 8'hf9;
    mem[179] = 8'h00;
    mem[180] = 8'he0;
    mem[181] = 8'h01;
    mem[182] = 8'hf0;
    mem[183] = 8'h00;
    mem[184] = 8'h00;
    mem[185] = 8'h7c;
    mem[186] = 8'hf8;
    mem[187] = 8'h00;
    mem[188] = 8'hf0;
    mem[189] = 8'h00;
    mem[190] = 8'hf0;
    mem[191] = 8'h01;
    mem[192] = 8'h00;
    mem[193] = 8'h3c;
    mem[194] = 8'hf8;
    mem[195] = 8'h00;
    mem[196] = 8'hf0;
    mem[197] = 8'h00;
    mem[198] = 8'he0;
    mem[199] = 8'h01;
    mem[200] = 8'h00;
    mem[201] = 8'h0c;
    mem[202] = 8'hf8;
    mem[203] = 8'h00;
    mem[204] = 8'h78;
    mem[205] = 8'h00;
    mem[206] = 8'he0;
    mem[207] = 8'h01;
    mem[208] = 8'h00;
    mem[209] = 8'h00;
    mem[210] = 8'hf8;
    mem[211] = 8'h00;
    mem[212] = 8'h78;
    mem[213] = 8'h00;
    mem[214] = 8'h00;
    mem[215] = 8'h00;
    mem[216] = 8'h00;
    mem[217] = 8'h00;
    mem[218] = 8'hf8;
    mem[219] = 8'h00;
    mem[220] = 8'h78;
    mem[221] = 8'h00;
    mem[222] = 8'h00;
    mem[223] = 8'h00;
    mem[224] = 8'h00;
    mem[225] = 8'h00;
    mem[226] = 8'hf8;
    mem[227] = 8'h00;
    mem[228] = 8'h78;
    mem[229] = 8'hf8;
    mem[230] = 8'h07;
    mem[231] = 8'h00;
    mem[232] = 8'h00;
    mem[233] = 8'h00;
    mem[234] = 8'hf8;
    mem[235] = 8'h00;
    mem[236] = 8'h7c;
    mem[237] = 8'hfe;
    mem[238] = 8'h1f;
    mem[239] = 8'h00;
    mem[240] = 8'h00;
    mem[241] = 8'h00;
    mem[242] = 8'hf8;
    mem[243] = 8'h00;
    mem[244] = 8'h7c;
    mem[245] = 8'hff;
    mem[246] = 8'h3f;
    mem[247] = 8'h00;
    mem[248] = 8'h00;
    mem[249] = 8'h00;
    mem[250] = 8'hf8;
    mem[251] = 8'h00;
    mem[252] = 8'hfc;
    mem[253] = 8'h07;
    mem[254] = 8'h7e;
    mem[255] = 8'h00;
    mem[256] = 8'h00;
    mem[257] = 8'h00;
    mem[258] = 8'hf8;
    mem[259] = 8'h00;
    mem[260] = 8'hfc;
    mem[261] = 8'h01;
    mem[262] = 8'hfc;
    mem[263] = 8'h00;
    mem[264] = 8'h00;
    mem[265] = 8'h00;
    mem[266] = 8'hf8;
    mem[267] = 8'h00;
    mem[268] = 8'hfc;
    mem[269] = 8'h00;
    mem[270] = 8'hf8;
    mem[271] = 8'h00;
    mem[272] = 8'h00;
    mem[273] = 8'h00;
    mem[274] = 8'hf8;
    mem[275] = 8'h00;
    mem[276] = 8'hfc;
    mem[277] = 8'h00;
    mem[278] = 8'hf0;
    mem[279] = 8'h01;
    mem[280] = 8'h00;
    mem[281] = 8'h00;
    mem[282] = 8'hf8;
    mem[283] = 8'h00;
    mem[284] = 8'h7c;
    mem[285] = 8'h00;
    mem[286] = 8'hf0;
    mem[287] = 8'h01;
    mem[288] = 8'h00;
    mem[289] = 8'h00;
    mem[290] = 8'hf8;
    mem[291] = 8'h00;
    mem[292] = 8'h7c;
    mem[293] = 8'h00;
    mem[294] = 8'he0;
    mem[295] = 8'h01;
    mem[296] = 8'h00;
    mem[297] = 8'h00;
    mem[298] = 8'hf8;
    mem[299] = 8'h00;
    mem[300] = 8'h7c;
    mem[301] = 8'h00;
    mem[302] = 8'he0;
    mem[303] = 8'h01;
    mem[304] = 8'h00;
    mem[305] = 8'h00;
    mem[306] = 8'hf8;
    mem[307] = 8'h00;
    mem[308] = 8'h7c;
    mem[309] = 8'h00;
    mem[310] = 8'he0;
    mem[311] = 8'h01;
    mem[312] = 8'h00;
    mem[313] = 8'h00;
    mem[314] = 8'hf8;
    mem[315] = 8'h00;
    mem[316] = 8'h7c;
    mem[317] = 8'h00;
    mem[318] = 8'he0;
    mem[319] = 8'h01;
    mem[320] = 8'h00;
    mem[321] = 8'h00;
    mem[322] = 8'hf8;
    mem[323] = 8'h00;
    mem[324] = 8'h7c;
    mem[325] = 8'h00;
    mem[326] = 8'he0;
    mem[327] = 8'h01;
    mem[328] = 8'h00;
    mem[329] = 8'h00;
    mem[330] = 8'hf8;
    mem[331] = 8'h00;
    mem[332] = 8'h78;
    mem[333] = 8'h00;
    mem[334] = 8'he0;
    mem[335] = 8'h01;
    mem[336] = 8'h00;
    mem[337] = 8'h00;
    mem[338] = 8'hf8;
    mem[339] = 8'h00;
    mem[340] = 8'h78;
    mem[341] = 8'h00;
    mem[342] = 8'hf0;
    mem[343] = 8'h01;
    mem[344] = 8'h00;
    mem[345] = 8'h00;
    mem[346] = 8'hf8;
    mem[347] = 8'h00;
    mem[348] = 8'h78;
    mem[349] = 8'h00;
    mem[350] = 8'hf0;
    mem[351] = 8'h01;
    mem[352] = 8'h00;
    mem[353] = 8'h00;
    mem[354] = 8'hf8;
    mem[355] = 8'h00;
    mem[356] = 8'hf0;
    mem[357] = 8'h00;
    mem[358] = 8'hf8;
    mem[359] = 8'h00;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'hf8;
    mem[363] = 8'h00;
    mem[364] = 8'hf0;
    mem[365] = 8'h01;
    mem[366] = 8'hf8;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'hf8;
    mem[371] = 8'h00;
    mem[372] = 8'he0;
    mem[373] = 8'h03;
    mem[374] = 8'h7e;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'hf8;
    mem[379] = 8'h00;
    mem[380] = 8'hc0;
    mem[381] = 8'hff;
    mem[382] = 8'h3f;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'hf8;
    mem[387] = 8'h00;
    mem[388] = 8'h80;
    mem[389] = 8'hff;
    mem[390] = 8'h1f;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'hf8;
    mem[395] = 8'h00;
    mem[396] = 8'h00;
    mem[397] = 8'hfe;
    mem[398] = 8'h07;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_32 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'he0;
    mem[138] = 8'hff;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'hfc;
    mem[142] = 8'h0f;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'hf8;
    mem[146] = 8'hff;
    mem[147] = 8'h01;
    mem[148] = 8'h00;
    mem[149] = 8'hff;
    mem[150] = 8'h3f;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'hfc;
    mem[154] = 8'hff;
    mem[155] = 8'h07;
    mem[156] = 8'h80;
    mem[157] = 8'hff;
    mem[158] = 8'h7f;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h7e;
    mem[162] = 8'he0;
    mem[163] = 8'h07;
    mem[164] = 8'hc0;
    mem[165] = 8'h07;
    mem[166] = 8'hfc;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'h1e;
    mem[170] = 8'h80;
    mem[171] = 8'h0f;
    mem[172] = 8'hc0;
    mem[173] = 8'h03;
    mem[174] = 8'hf8;
    mem[175] = 8'h01;
    mem[176] = 8'h00;
    mem[177] = 8'h1f;
    mem[178] = 8'h80;
    mem[179] = 8'h0f;
    mem[180] = 8'he0;
    mem[181] = 8'h01;
    mem[182] = 8'hf0;
    mem[183] = 8'h01;
    mem[184] = 8'h00;
    mem[185] = 8'h0f;
    mem[186] = 8'h00;
    mem[187] = 8'h0f;
    mem[188] = 8'he0;
    mem[189] = 8'h01;
    mem[190] = 8'he0;
    mem[191] = 8'h01;
    mem[192] = 8'h80;
    mem[193] = 8'h0f;
    mem[194] = 8'h00;
    mem[195] = 8'h0f;
    mem[196] = 8'hf0;
    mem[197] = 8'h01;
    mem[198] = 8'he0;
    mem[199] = 8'h01;
    mem[200] = 8'h80;
    mem[201] = 8'h07;
    mem[202] = 8'h00;
    mem[203] = 8'h0f;
    mem[204] = 8'hf0;
    mem[205] = 8'h00;
    mem[206] = 8'he0;
    mem[207] = 8'h01;
    mem[208] = 8'h80;
    mem[209] = 8'h07;
    mem[210] = 8'h00;
    mem[211] = 8'h0f;
    mem[212] = 8'hf0;
    mem[213] = 8'h00;
    mem[214] = 8'he0;
    mem[215] = 8'h01;
    mem[216] = 8'h00;
    mem[217] = 8'h00;
    mem[218] = 8'h00;
    mem[219] = 8'h0f;
    mem[220] = 8'h00;
    mem[221] = 8'h00;
    mem[222] = 8'he0;
    mem[223] = 8'h01;
    mem[224] = 8'h00;
    mem[225] = 8'h00;
    mem[226] = 8'h80;
    mem[227] = 8'h0f;
    mem[228] = 8'h00;
    mem[229] = 8'h00;
    mem[230] = 8'he0;
    mem[231] = 8'h01;
    mem[232] = 8'h00;
    mem[233] = 8'h00;
    mem[234] = 8'h80;
    mem[235] = 8'h07;
    mem[236] = 8'h00;
    mem[237] = 8'h00;
    mem[238] = 8'hf0;
    mem[239] = 8'h01;
    mem[240] = 8'h00;
    mem[241] = 8'h00;
    mem[242] = 8'he0;
    mem[243] = 8'h03;
    mem[244] = 8'h00;
    mem[245] = 8'h00;
    mem[246] = 8'hf0;
    mem[247] = 8'h00;
    mem[248] = 8'h00;
    mem[249] = 8'h00;
    mem[250] = 8'hf8;
    mem[251] = 8'h01;
    mem[252] = 8'h00;
    mem[253] = 8'h00;
    mem[254] = 8'hf8;
    mem[255] = 8'h00;
    mem[256] = 8'h00;
    mem[257] = 8'h00;
    mem[258] = 8'h7f;
    mem[259] = 8'h00;
    mem[260] = 8'h00;
    mem[261] = 8'h00;
    mem[262] = 8'h7c;
    mem[263] = 8'h00;
    mem[264] = 8'h00;
    mem[265] = 8'h00;
    mem[266] = 8'hff;
    mem[267] = 8'h01;
    mem[268] = 8'h00;
    mem[269] = 8'h00;
    mem[270] = 8'h3e;
    mem[271] = 8'h00;
    mem[272] = 8'h00;
    mem[273] = 8'h00;
    mem[274] = 8'hff;
    mem[275] = 8'h07;
    mem[276] = 8'h00;
    mem[277] = 8'h00;
    mem[278] = 8'h1f;
    mem[279] = 8'h00;
    mem[280] = 8'h00;
    mem[281] = 8'h00;
    mem[282] = 8'he0;
    mem[283] = 8'h0f;
    mem[284] = 8'h00;
    mem[285] = 8'h80;
    mem[286] = 8'h0f;
    mem[287] = 8'h00;
    mem[288] = 8'h00;
    mem[289] = 8'h00;
    mem[290] = 8'h80;
    mem[291] = 8'h0f;
    mem[292] = 8'h00;
    mem[293] = 8'hc0;
    mem[294] = 8'h0f;
    mem[295] = 8'h00;
    mem[296] = 8'h00;
    mem[297] = 8'h00;
    mem[298] = 8'h00;
    mem[299] = 8'h1f;
    mem[300] = 8'h00;
    mem[301] = 8'he0;
    mem[302] = 8'h07;
    mem[303] = 8'h00;
    mem[304] = 8'h00;
    mem[305] = 8'h00;
    mem[306] = 8'h00;
    mem[307] = 8'h1f;
    mem[308] = 8'h00;
    mem[309] = 8'hf0;
    mem[310] = 8'h03;
    mem[311] = 8'h00;
    mem[312] = 8'h00;
    mem[313] = 8'h00;
    mem[314] = 8'h00;
    mem[315] = 8'h1e;
    mem[316] = 8'h00;
    mem[317] = 8'hf8;
    mem[318] = 8'h01;
    mem[319] = 8'h00;
    mem[320] = 8'hc0;
    mem[321] = 8'h03;
    mem[322] = 8'h00;
    mem[323] = 8'h1e;
    mem[324] = 8'h00;
    mem[325] = 8'hfc;
    mem[326] = 8'h00;
    mem[327] = 8'h00;
    mem[328] = 8'hc0;
    mem[329] = 8'h03;
    mem[330] = 8'h00;
    mem[331] = 8'h1e;
    mem[332] = 8'h00;
    mem[333] = 8'h7e;
    mem[334] = 8'h00;
    mem[335] = 8'h00;
    mem[336] = 8'hc0;
    mem[337] = 8'h03;
    mem[338] = 8'h00;
    mem[339] = 8'h1e;
    mem[340] = 8'h00;
    mem[341] = 8'h3f;
    mem[342] = 8'h00;
    mem[343] = 8'h00;
    mem[344] = 8'hc0;
    mem[345] = 8'h07;
    mem[346] = 8'h00;
    mem[347] = 8'h1e;
    mem[348] = 8'h80;
    mem[349] = 8'h0f;
    mem[350] = 8'h00;
    mem[351] = 8'h00;
    mem[352] = 8'h80;
    mem[353] = 8'h07;
    mem[354] = 8'h00;
    mem[355] = 8'h1f;
    mem[356] = 8'hc0;
    mem[357] = 8'h07;
    mem[358] = 8'h00;
    mem[359] = 8'h00;
    mem[360] = 8'h80;
    mem[361] = 8'h0f;
    mem[362] = 8'h80;
    mem[363] = 8'h0f;
    mem[364] = 8'he0;
    mem[365] = 8'h03;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h3f;
    mem[370] = 8'hc0;
    mem[371] = 8'h07;
    mem[372] = 8'hf0;
    mem[373] = 8'h03;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'hfe;
    mem[378] = 8'hff;
    mem[379] = 8'h03;
    mem[380] = 8'hf8;
    mem[381] = 8'hff;
    mem[382] = 8'hff;
    mem[383] = 8'h03;
    mem[384] = 8'h00;
    mem[385] = 8'hfc;
    mem[386] = 8'hff;
    mem[387] = 8'h01;
    mem[388] = 8'hf8;
    mem[389] = 8'hff;
    mem[390] = 8'hff;
    mem[391] = 8'h03;
    mem[392] = 8'h00;
    mem[393] = 8'hf0;
    mem[394] = 8'h7f;
    mem[395] = 8'h00;
    mem[396] = 8'hf8;
    mem[397] = 8'hff;
    mem[398] = 8'hff;
    mem[399] = 8'h03;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_64 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'hc0;
    mem[138] = 8'hff;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'h00;
    mem[142] = 8'h7c;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'hf0;
    mem[146] = 8'hff;
    mem[147] = 8'h01;
    mem[148] = 8'h00;
    mem[149] = 8'h00;
    mem[150] = 8'h7e;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'hf8;
    mem[154] = 8'hff;
    mem[155] = 8'h07;
    mem[156] = 8'h00;
    mem[157] = 8'h00;
    mem[158] = 8'h7f;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h7c;
    mem[162] = 8'hc0;
    mem[163] = 8'h07;
    mem[164] = 8'h00;
    mem[165] = 8'h00;
    mem[166] = 8'h7f;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'h3e;
    mem[170] = 8'h80;
    mem[171] = 8'h0f;
    mem[172] = 8'h00;
    mem[173] = 8'h80;
    mem[174] = 8'h7f;
    mem[175] = 8'h00;
    mem[176] = 8'h00;
    mem[177] = 8'h1e;
    mem[178] = 8'h00;
    mem[179] = 8'h0f;
    mem[180] = 8'h00;
    mem[181] = 8'hc0;
    mem[182] = 8'h7f;
    mem[183] = 8'h00;
    mem[184] = 8'h00;
    mem[185] = 8'h0f;
    mem[186] = 8'h00;
    mem[187] = 8'h1f;
    mem[188] = 8'h00;
    mem[189] = 8'he0;
    mem[190] = 8'h7d;
    mem[191] = 8'h00;
    mem[192] = 8'h00;
    mem[193] = 8'h0f;
    mem[194] = 8'h00;
    mem[195] = 8'h1e;
    mem[196] = 8'h00;
    mem[197] = 8'he0;
    mem[198] = 8'h7d;
    mem[199] = 8'h00;
    mem[200] = 8'h80;
    mem[201] = 8'h07;
    mem[202] = 8'h00;
    mem[203] = 8'h1e;
    mem[204] = 8'h00;
    mem[205] = 8'hf0;
    mem[206] = 8'h7c;
    mem[207] = 8'h00;
    mem[208] = 8'h80;
    mem[209] = 8'h07;
    mem[210] = 8'h00;
    mem[211] = 8'h00;
    mem[212] = 8'h00;
    mem[213] = 8'hf8;
    mem[214] = 8'h7c;
    mem[215] = 8'h00;
    mem[216] = 8'h80;
    mem[217] = 8'h07;
    mem[218] = 8'h00;
    mem[219] = 8'h00;
    mem[220] = 8'h00;
    mem[221] = 8'h78;
    mem[222] = 8'h7c;
    mem[223] = 8'h00;
    mem[224] = 8'h80;
    mem[225] = 8'h87;
    mem[226] = 8'h7f;
    mem[227] = 8'h00;
    mem[228] = 8'h00;
    mem[229] = 8'h3c;
    mem[230] = 8'h7c;
    mem[231] = 8'h00;
    mem[232] = 8'hc0;
    mem[233] = 8'he7;
    mem[234] = 8'hff;
    mem[235] = 8'h01;
    mem[236] = 8'h00;
    mem[237] = 8'h3e;
    mem[238] = 8'h7c;
    mem[239] = 8'h00;
    mem[240] = 8'hc0;
    mem[241] = 8'hf7;
    mem[242] = 8'hff;
    mem[243] = 8'h03;
    mem[244] = 8'h00;
    mem[245] = 8'h1e;
    mem[246] = 8'h7c;
    mem[247] = 8'h00;
    mem[248] = 8'hc0;
    mem[249] = 8'h7f;
    mem[250] = 8'he0;
    mem[251] = 8'h07;
    mem[252] = 8'h00;
    mem[253] = 8'h0f;
    mem[254] = 8'h7c;
    mem[255] = 8'h00;
    mem[256] = 8'hc0;
    mem[257] = 8'h1f;
    mem[258] = 8'hc0;
    mem[259] = 8'h0f;
    mem[260] = 8'h80;
    mem[261] = 8'h07;
    mem[262] = 8'h7c;
    mem[263] = 8'h00;
    mem[264] = 8'hc0;
    mem[265] = 8'h0f;
    mem[266] = 8'h80;
    mem[267] = 8'h0f;
    mem[268] = 8'h80;
    mem[269] = 8'h07;
    mem[270] = 8'h7c;
    mem[271] = 8'h00;
    mem[272] = 8'hc0;
    mem[273] = 8'h0f;
    mem[274] = 8'h00;
    mem[275] = 8'h1f;
    mem[276] = 8'hc0;
    mem[277] = 8'h03;
    mem[278] = 8'h7c;
    mem[279] = 8'h00;
    mem[280] = 8'hc0;
    mem[281] = 8'h07;
    mem[282] = 8'h00;
    mem[283] = 8'h1f;
    mem[284] = 8'he0;
    mem[285] = 8'h01;
    mem[286] = 8'h7c;
    mem[287] = 8'h00;
    mem[288] = 8'hc0;
    mem[289] = 8'h07;
    mem[290] = 8'h00;
    mem[291] = 8'h1e;
    mem[292] = 8'hf0;
    mem[293] = 8'h01;
    mem[294] = 8'h7c;
    mem[295] = 8'h00;
    mem[296] = 8'hc0;
    mem[297] = 8'h07;
    mem[298] = 8'h00;
    mem[299] = 8'h1e;
    mem[300] = 8'hf0;
    mem[301] = 8'h00;
    mem[302] = 8'h7c;
    mem[303] = 8'h00;
    mem[304] = 8'hc0;
    mem[305] = 8'h07;
    mem[306] = 8'h00;
    mem[307] = 8'h1e;
    mem[308] = 8'h78;
    mem[309] = 8'h00;
    mem[310] = 8'h7c;
    mem[311] = 8'h00;
    mem[312] = 8'hc0;
    mem[313] = 8'h07;
    mem[314] = 8'h00;
    mem[315] = 8'h1e;
    mem[316] = 8'hfc;
    mem[317] = 8'hff;
    mem[318] = 8'hff;
    mem[319] = 8'h07;
    mem[320] = 8'hc0;
    mem[321] = 8'h07;
    mem[322] = 8'h00;
    mem[323] = 8'h1e;
    mem[324] = 8'hfc;
    mem[325] = 8'hff;
    mem[326] = 8'hff;
    mem[327] = 8'h07;
    mem[328] = 8'h80;
    mem[329] = 8'h07;
    mem[330] = 8'h00;
    mem[331] = 8'h1e;
    mem[332] = 8'hfc;
    mem[333] = 8'hff;
    mem[334] = 8'hff;
    mem[335] = 8'h07;
    mem[336] = 8'h80;
    mem[337] = 8'h07;
    mem[338] = 8'h00;
    mem[339] = 8'h1f;
    mem[340] = 8'h00;
    mem[341] = 8'h00;
    mem[342] = 8'h7c;
    mem[343] = 8'h00;
    mem[344] = 8'h80;
    mem[345] = 8'h07;
    mem[346] = 8'h00;
    mem[347] = 8'h1f;
    mem[348] = 8'h00;
    mem[349] = 8'h00;
    mem[350] = 8'h7c;
    mem[351] = 8'h00;
    mem[352] = 8'h00;
    mem[353] = 8'h0f;
    mem[354] = 8'h80;
    mem[355] = 8'h0f;
    mem[356] = 8'h00;
    mem[357] = 8'h00;
    mem[358] = 8'h7c;
    mem[359] = 8'h00;
    mem[360] = 8'h00;
    mem[361] = 8'h1f;
    mem[362] = 8'h80;
    mem[363] = 8'h0f;
    mem[364] = 8'h00;
    mem[365] = 8'h00;
    mem[366] = 8'h7c;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h3e;
    mem[370] = 8'he0;
    mem[371] = 8'h07;
    mem[372] = 8'h00;
    mem[373] = 8'h00;
    mem[374] = 8'h7c;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'hfc;
    mem[378] = 8'hff;
    mem[379] = 8'h03;
    mem[380] = 8'h00;
    mem[381] = 8'h00;
    mem[382] = 8'h7c;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'hf8;
    mem[386] = 8'hff;
    mem[387] = 8'h01;
    mem[388] = 8'h00;
    mem[389] = 8'h00;
    mem[390] = 8'h7c;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'he0;
    mem[394] = 8'h7f;
    mem[395] = 8'h00;
    mem[396] = 8'h00;
    mem[397] = 8'h00;
    mem[398] = 8'h7c;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_128 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'h00;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'h00;
    mem[148] = 8'h00;
    mem[149] = 8'h00;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'h00;
    mem[156] = 8'h00;
    mem[157] = 8'h00;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h78;
    mem[162] = 8'h00;
    mem[163] = 8'hf0;
    mem[164] = 8'h1f;
    mem[165] = 8'h00;
    mem[166] = 8'hff;
    mem[167] = 8'h03;
    mem[168] = 8'h00;
    mem[169] = 8'h7e;
    mem[170] = 8'h00;
    mem[171] = 8'hfc;
    mem[172] = 8'h3f;
    mem[173] = 8'h80;
    mem[174] = 8'hff;
    mem[175] = 8'h07;
    mem[176] = 8'h00;
    mem[177] = 8'h7f;
    mem[178] = 8'h00;
    mem[179] = 8'h3e;
    mem[180] = 8'h7c;
    mem[181] = 8'hc0;
    mem[182] = 8'h83;
    mem[183] = 8'h0f;
    mem[184] = 8'hc0;
    mem[185] = 8'h7f;
    mem[186] = 8'h00;
    mem[187] = 8'h0e;
    mem[188] = 8'h70;
    mem[189] = 8'hc0;
    mem[190] = 8'h01;
    mem[191] = 8'h0e;
    mem[192] = 8'he0;
    mem[193] = 8'h73;
    mem[194] = 8'h00;
    mem[195] = 8'h0f;
    mem[196] = 8'hf0;
    mem[197] = 8'he0;
    mem[198] = 8'h01;
    mem[199] = 8'h1e;
    mem[200] = 8'he0;
    mem[201] = 8'h70;
    mem[202] = 8'h00;
    mem[203] = 8'h07;
    mem[204] = 8'hf0;
    mem[205] = 8'he0;
    mem[206] = 8'h00;
    mem[207] = 8'h1c;
    mem[208] = 8'h60;
    mem[209] = 8'h70;
    mem[210] = 8'h00;
    mem[211] = 8'h07;
    mem[212] = 8'he0;
    mem[213] = 8'he0;
    mem[214] = 8'h00;
    mem[215] = 8'h1c;
    mem[216] = 8'h00;
    mem[217] = 8'h70;
    mem[218] = 8'h00;
    mem[219] = 8'h07;
    mem[220] = 8'hf0;
    mem[221] = 8'he0;
    mem[222] = 8'h01;
    mem[223] = 8'h1e;
    mem[224] = 8'h00;
    mem[225] = 8'h70;
    mem[226] = 8'h00;
    mem[227] = 8'h00;
    mem[228] = 8'hf0;
    mem[229] = 8'hc0;
    mem[230] = 8'h01;
    mem[231] = 8'h1e;
    mem[232] = 8'h00;
    mem[233] = 8'h70;
    mem[234] = 8'h00;
    mem[235] = 8'h00;
    mem[236] = 8'h70;
    mem[237] = 8'hc0;
    mem[238] = 8'h03;
    mem[239] = 8'h0f;
    mem[240] = 8'h00;
    mem[241] = 8'h70;
    mem[242] = 8'h00;
    mem[243] = 8'h00;
    mem[244] = 8'h78;
    mem[245] = 8'h80;
    mem[246] = 8'hcf;
    mem[247] = 8'h07;
    mem[248] = 8'h00;
    mem[249] = 8'h70;
    mem[250] = 8'h00;
    mem[251] = 8'h00;
    mem[252] = 8'h3c;
    mem[253] = 8'h00;
    mem[254] = 8'hff;
    mem[255] = 8'h01;
    mem[256] = 8'h00;
    mem[257] = 8'h70;
    mem[258] = 8'h00;
    mem[259] = 8'h00;
    mem[260] = 8'h1c;
    mem[261] = 8'h80;
    mem[262] = 8'hff;
    mem[263] = 8'h03;
    mem[264] = 8'h00;
    mem[265] = 8'h70;
    mem[266] = 8'h00;
    mem[267] = 8'h00;
    mem[268] = 8'h1e;
    mem[269] = 8'hc0;
    mem[270] = 8'h83;
    mem[271] = 8'h0f;
    mem[272] = 8'h00;
    mem[273] = 8'h70;
    mem[274] = 8'h00;
    mem[275] = 8'h00;
    mem[276] = 8'h0f;
    mem[277] = 8'he0;
    mem[278] = 8'h01;
    mem[279] = 8'h0e;
    mem[280] = 8'h00;
    mem[281] = 8'h70;
    mem[282] = 8'h00;
    mem[283] = 8'h80;
    mem[284] = 8'h07;
    mem[285] = 8'hf0;
    mem[286] = 8'h00;
    mem[287] = 8'h1e;
    mem[288] = 8'h00;
    mem[289] = 8'h70;
    mem[290] = 8'h00;
    mem[291] = 8'hc0;
    mem[292] = 8'h03;
    mem[293] = 8'hf0;
    mem[294] = 8'h00;
    mem[295] = 8'h1c;
    mem[296] = 8'h00;
    mem[297] = 8'h70;
    mem[298] = 8'h00;
    mem[299] = 8'he0;
    mem[300] = 8'h01;
    mem[301] = 8'h70;
    mem[302] = 8'h00;
    mem[303] = 8'h1c;
    mem[304] = 8'h00;
    mem[305] = 8'h70;
    mem[306] = 8'h00;
    mem[307] = 8'hf0;
    mem[308] = 8'h00;
    mem[309] = 8'h70;
    mem[310] = 8'h00;
    mem[311] = 8'h1c;
    mem[312] = 8'h00;
    mem[313] = 8'h70;
    mem[314] = 8'h00;
    mem[315] = 8'h78;
    mem[316] = 8'h00;
    mem[317] = 8'hf0;
    mem[318] = 8'h00;
    mem[319] = 8'h1c;
    mem[320] = 8'h00;
    mem[321] = 8'h70;
    mem[322] = 8'h00;
    mem[323] = 8'h3c;
    mem[324] = 8'h00;
    mem[325] = 8'hf0;
    mem[326] = 8'h00;
    mem[327] = 8'h1e;
    mem[328] = 8'h00;
    mem[329] = 8'h70;
    mem[330] = 8'h00;
    mem[331] = 8'h1e;
    mem[332] = 8'h00;
    mem[333] = 8'he0;
    mem[334] = 8'h01;
    mem[335] = 8'h1e;
    mem[336] = 8'h00;
    mem[337] = 8'h70;
    mem[338] = 8'h00;
    mem[339] = 8'h0f;
    mem[340] = 8'h00;
    mem[341] = 8'he0;
    mem[342] = 8'h03;
    mem[343] = 8'h0f;
    mem[344] = 8'h00;
    mem[345] = 8'h70;
    mem[346] = 8'h80;
    mem[347] = 8'hff;
    mem[348] = 8'hff;
    mem[349] = 8'hc0;
    mem[350] = 8'hff;
    mem[351] = 8'h07;
    mem[352] = 8'h00;
    mem[353] = 8'h70;
    mem[354] = 8'h80;
    mem[355] = 8'hff;
    mem[356] = 8'hff;
    mem[357] = 8'h00;
    mem[358] = 8'hff;
    mem[359] = 8'h01;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'h00;
    mem[363] = 8'h00;
    mem[364] = 8'h00;
    mem[365] = 8'h00;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'h00;
    mem[371] = 8'h00;
    mem[372] = 8'h00;
    mem[373] = 8'h00;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'h00;
    mem[379] = 8'h00;
    mem[380] = 8'h00;
    mem[381] = 8'h00;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'h00;
    mem[387] = 8'h00;
    mem[388] = 8'h00;
    mem[389] = 8'h00;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'h00;
    mem[395] = 8'h00;
    mem[396] = 8'h00;
    mem[397] = 8'h00;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_256 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'h00;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'h00;
    mem[148] = 8'h00;
    mem[149] = 8'h00;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'h00;
    mem[156] = 8'h00;
    mem[157] = 8'h00;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'h80;
    mem[161] = 8'hff;
    mem[162] = 8'h00;
    mem[163] = 8'hfe;
    mem[164] = 8'h7f;
    mem[165] = 8'h00;
    mem[166] = 8'hfc;
    mem[167] = 8'h03;
    mem[168] = 8'he0;
    mem[169] = 8'hff;
    mem[170] = 8'h01;
    mem[171] = 8'hfe;
    mem[172] = 8'h7f;
    mem[173] = 8'h00;
    mem[174] = 8'hff;
    mem[175] = 8'h07;
    mem[176] = 8'hf0;
    mem[177] = 8'he1;
    mem[178] = 8'h03;
    mem[179] = 8'h0e;
    mem[180] = 8'h00;
    mem[181] = 8'h80;
    mem[182] = 8'h87;
    mem[183] = 8'h0f;
    mem[184] = 8'h70;
    mem[185] = 8'h80;
    mem[186] = 8'h03;
    mem[187] = 8'h0e;
    mem[188] = 8'h00;
    mem[189] = 8'hc0;
    mem[190] = 8'h03;
    mem[191] = 8'h0e;
    mem[192] = 8'h78;
    mem[193] = 8'h80;
    mem[194] = 8'h07;
    mem[195] = 8'h0e;
    mem[196] = 8'h00;
    mem[197] = 8'hc0;
    mem[198] = 8'h01;
    mem[199] = 8'h1e;
    mem[200] = 8'h38;
    mem[201] = 8'h80;
    mem[202] = 8'h07;
    mem[203] = 8'h06;
    mem[204] = 8'h00;
    mem[205] = 8'he0;
    mem[206] = 8'h00;
    mem[207] = 8'h1c;
    mem[208] = 8'h38;
    mem[209] = 8'h00;
    mem[210] = 8'h07;
    mem[211] = 8'h06;
    mem[212] = 8'h00;
    mem[213] = 8'he0;
    mem[214] = 8'h00;
    mem[215] = 8'h1c;
    mem[216] = 8'h38;
    mem[217] = 8'h80;
    mem[218] = 8'h07;
    mem[219] = 8'h07;
    mem[220] = 8'h00;
    mem[221] = 8'he0;
    mem[222] = 8'h00;
    mem[223] = 8'h00;
    mem[224] = 8'h00;
    mem[225] = 8'h80;
    mem[226] = 8'h07;
    mem[227] = 8'he7;
    mem[228] = 8'h07;
    mem[229] = 8'hf0;
    mem[230] = 8'hf8;
    mem[231] = 8'h00;
    mem[232] = 8'h00;
    mem[233] = 8'h80;
    mem[234] = 8'h03;
    mem[235] = 8'hf7;
    mem[236] = 8'h1f;
    mem[237] = 8'h70;
    mem[238] = 8'hfe;
    mem[239] = 8'h03;
    mem[240] = 8'h00;
    mem[241] = 8'hc0;
    mem[242] = 8'h03;
    mem[243] = 8'h7f;
    mem[244] = 8'h3e;
    mem[245] = 8'h70;
    mem[246] = 8'hef;
    mem[247] = 8'h07;
    mem[248] = 8'h00;
    mem[249] = 8'he0;
    mem[250] = 8'h01;
    mem[251] = 8'h1f;
    mem[252] = 8'h78;
    mem[253] = 8'hf0;
    mem[254] = 8'h03;
    mem[255] = 8'h0f;
    mem[256] = 8'h00;
    mem[257] = 8'he0;
    mem[258] = 8'h00;
    mem[259] = 8'h0f;
    mem[260] = 8'hf0;
    mem[261] = 8'hf0;
    mem[262] = 8'h01;
    mem[263] = 8'h1e;
    mem[264] = 8'h00;
    mem[265] = 8'hf0;
    mem[266] = 8'h00;
    mem[267] = 8'h07;
    mem[268] = 8'hf0;
    mem[269] = 8'hf0;
    mem[270] = 8'h00;
    mem[271] = 8'h1e;
    mem[272] = 8'h00;
    mem[273] = 8'h78;
    mem[274] = 8'h00;
    mem[275] = 8'h00;
    mem[276] = 8'he0;
    mem[277] = 8'hf0;
    mem[278] = 8'h00;
    mem[279] = 8'h1c;
    mem[280] = 8'h00;
    mem[281] = 8'h3c;
    mem[282] = 8'h00;
    mem[283] = 8'h00;
    mem[284] = 8'he0;
    mem[285] = 8'h70;
    mem[286] = 8'h00;
    mem[287] = 8'h1c;
    mem[288] = 8'h00;
    mem[289] = 8'h1e;
    mem[290] = 8'h00;
    mem[291] = 8'h00;
    mem[292] = 8'he0;
    mem[293] = 8'h70;
    mem[294] = 8'h00;
    mem[295] = 8'h1c;
    mem[296] = 8'h00;
    mem[297] = 8'h0f;
    mem[298] = 8'h00;
    mem[299] = 8'h00;
    mem[300] = 8'he0;
    mem[301] = 8'h70;
    mem[302] = 8'h00;
    mem[303] = 8'h1c;
    mem[304] = 8'h80;
    mem[305] = 8'h07;
    mem[306] = 8'h80;
    mem[307] = 8'h03;
    mem[308] = 8'he0;
    mem[309] = 8'hf0;
    mem[310] = 8'h00;
    mem[311] = 8'h1c;
    mem[312] = 8'hc0;
    mem[313] = 8'h03;
    mem[314] = 8'h80;
    mem[315] = 8'h07;
    mem[316] = 8'he0;
    mem[317] = 8'he0;
    mem[318] = 8'h00;
    mem[319] = 8'h1c;
    mem[320] = 8'he0;
    mem[321] = 8'h01;
    mem[322] = 8'h00;
    mem[323] = 8'h07;
    mem[324] = 8'hf0;
    mem[325] = 8'he0;
    mem[326] = 8'h00;
    mem[327] = 8'h1e;
    mem[328] = 8'hf0;
    mem[329] = 8'h00;
    mem[330] = 8'h00;
    mem[331] = 8'h0f;
    mem[332] = 8'h78;
    mem[333] = 8'hc0;
    mem[334] = 8'h01;
    mem[335] = 8'h0f;
    mem[336] = 8'h78;
    mem[337] = 8'h00;
    mem[338] = 8'h00;
    mem[339] = 8'h1e;
    mem[340] = 8'h3c;
    mem[341] = 8'hc0;
    mem[342] = 8'h83;
    mem[343] = 8'h07;
    mem[344] = 8'hfc;
    mem[345] = 8'hff;
    mem[346] = 8'h07;
    mem[347] = 8'hfc;
    mem[348] = 8'h1f;
    mem[349] = 8'h80;
    mem[350] = 8'hff;
    mem[351] = 8'h03;
    mem[352] = 8'hfc;
    mem[353] = 8'hff;
    mem[354] = 8'h07;
    mem[355] = 8'hf8;
    mem[356] = 8'h0f;
    mem[357] = 8'h00;
    mem[358] = 8'hff;
    mem[359] = 8'h01;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'h00;
    mem[363] = 8'h00;
    mem[364] = 8'h00;
    mem[365] = 8'h00;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'h00;
    mem[371] = 8'h00;
    mem[372] = 8'h00;
    mem[373] = 8'h00;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'h00;
    mem[379] = 8'h00;
    mem[380] = 8'h00;
    mem[381] = 8'h00;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'h00;
    mem[387] = 8'h00;
    mem[388] = 8'h00;
    mem[389] = 8'h00;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'h00;
    mem[395] = 8'h00;
    mem[396] = 8'h00;
    mem[397] = 8'h00;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_512 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'h00;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'h00;
    mem[148] = 8'h00;
    mem[149] = 8'h00;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'h00;
    mem[156] = 8'h00;
    mem[157] = 8'h00;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'hf0;
    mem[161] = 8'hff;
    mem[162] = 8'h03;
    mem[163] = 8'h00;
    mem[164] = 8'h0f;
    mem[165] = 8'h00;
    mem[166] = 8'hfe;
    mem[167] = 8'h03;
    mem[168] = 8'hf0;
    mem[169] = 8'hff;
    mem[170] = 8'h03;
    mem[171] = 8'hc0;
    mem[172] = 8'h0f;
    mem[173] = 8'h80;
    mem[174] = 8'hff;
    mem[175] = 8'h07;
    mem[176] = 8'h70;
    mem[177] = 8'h00;
    mem[178] = 8'h00;
    mem[179] = 8'he0;
    mem[180] = 8'h0f;
    mem[181] = 8'hc0;
    mem[182] = 8'h87;
    mem[183] = 8'h0f;
    mem[184] = 8'h70;
    mem[185] = 8'h00;
    mem[186] = 8'h00;
    mem[187] = 8'hf8;
    mem[188] = 8'h0f;
    mem[189] = 8'hc0;
    mem[190] = 8'h01;
    mem[191] = 8'h0e;
    mem[192] = 8'h70;
    mem[193] = 8'h00;
    mem[194] = 8'h00;
    mem[195] = 8'h7c;
    mem[196] = 8'h0e;
    mem[197] = 8'he0;
    mem[198] = 8'h01;
    mem[199] = 8'h1e;
    mem[200] = 8'h30;
    mem[201] = 8'h00;
    mem[202] = 8'h00;
    mem[203] = 8'h1c;
    mem[204] = 8'h0e;
    mem[205] = 8'he0;
    mem[206] = 8'h00;
    mem[207] = 8'h1e;
    mem[208] = 8'h30;
    mem[209] = 8'h00;
    mem[210] = 8'h00;
    mem[211] = 8'h0c;
    mem[212] = 8'h0e;
    mem[213] = 8'he0;
    mem[214] = 8'h00;
    mem[215] = 8'h1c;
    mem[216] = 8'h38;
    mem[217] = 8'h00;
    mem[218] = 8'h00;
    mem[219] = 8'h00;
    mem[220] = 8'h0e;
    mem[221] = 8'he0;
    mem[222] = 8'h00;
    mem[223] = 8'h1e;
    mem[224] = 8'h38;
    mem[225] = 8'h3f;
    mem[226] = 8'h00;
    mem[227] = 8'h00;
    mem[228] = 8'h0e;
    mem[229] = 8'h00;
    mem[230] = 8'h00;
    mem[231] = 8'h1e;
    mem[232] = 8'hb8;
    mem[233] = 8'hff;
    mem[234] = 8'h00;
    mem[235] = 8'h00;
    mem[236] = 8'h0e;
    mem[237] = 8'h00;
    mem[238] = 8'h00;
    mem[239] = 8'h0e;
    mem[240] = 8'hf8;
    mem[241] = 8'hf3;
    mem[242] = 8'h01;
    mem[243] = 8'h00;
    mem[244] = 8'h0e;
    mem[245] = 8'h00;
    mem[246] = 8'h00;
    mem[247] = 8'h0f;
    mem[248] = 8'hf8;
    mem[249] = 8'hc0;
    mem[250] = 8'h03;
    mem[251] = 8'h00;
    mem[252] = 8'h0e;
    mem[253] = 8'h00;
    mem[254] = 8'h80;
    mem[255] = 8'h07;
    mem[256] = 8'h78;
    mem[257] = 8'h80;
    mem[258] = 8'h07;
    mem[259] = 8'h00;
    mem[260] = 8'h0e;
    mem[261] = 8'h00;
    mem[262] = 8'h80;
    mem[263] = 8'h03;
    mem[264] = 8'h38;
    mem[265] = 8'h80;
    mem[266] = 8'h07;
    mem[267] = 8'h00;
    mem[268] = 8'h0e;
    mem[269] = 8'h00;
    mem[270] = 8'hc0;
    mem[271] = 8'h03;
    mem[272] = 8'h00;
    mem[273] = 8'h00;
    mem[274] = 8'h07;
    mem[275] = 8'h00;
    mem[276] = 8'h0e;
    mem[277] = 8'h00;
    mem[278] = 8'he0;
    mem[279] = 8'h01;
    mem[280] = 8'h00;
    mem[281] = 8'h00;
    mem[282] = 8'h07;
    mem[283] = 8'h00;
    mem[284] = 8'h0e;
    mem[285] = 8'h00;
    mem[286] = 8'hf0;
    mem[287] = 8'h00;
    mem[288] = 8'h00;
    mem[289] = 8'h00;
    mem[290] = 8'h07;
    mem[291] = 8'h00;
    mem[292] = 8'h0e;
    mem[293] = 8'h00;
    mem[294] = 8'h78;
    mem[295] = 8'h00;
    mem[296] = 8'h00;
    mem[297] = 8'h00;
    mem[298] = 8'h07;
    mem[299] = 8'h00;
    mem[300] = 8'h0e;
    mem[301] = 8'h00;
    mem[302] = 8'h3c;
    mem[303] = 8'h00;
    mem[304] = 8'h1c;
    mem[305] = 8'h00;
    mem[306] = 8'h07;
    mem[307] = 8'h00;
    mem[308] = 8'h0e;
    mem[309] = 8'h00;
    mem[310] = 8'h1e;
    mem[311] = 8'h00;
    mem[312] = 8'h3c;
    mem[313] = 8'h00;
    mem[314] = 8'h07;
    mem[315] = 8'h00;
    mem[316] = 8'h0e;
    mem[317] = 8'h00;
    mem[318] = 8'h0f;
    mem[319] = 8'h00;
    mem[320] = 8'h38;
    mem[321] = 8'h80;
    mem[322] = 8'h07;
    mem[323] = 8'h00;
    mem[324] = 8'h0e;
    mem[325] = 8'h80;
    mem[326] = 8'h07;
    mem[327] = 8'h00;
    mem[328] = 8'h78;
    mem[329] = 8'hc0;
    mem[330] = 8'h03;
    mem[331] = 8'h00;
    mem[332] = 8'h0e;
    mem[333] = 8'hc0;
    mem[334] = 8'h03;
    mem[335] = 8'h00;
    mem[336] = 8'hf0;
    mem[337] = 8'he0;
    mem[338] = 8'h01;
    mem[339] = 8'h00;
    mem[340] = 8'h0e;
    mem[341] = 8'he0;
    mem[342] = 8'h01;
    mem[343] = 8'h00;
    mem[344] = 8'he0;
    mem[345] = 8'hff;
    mem[346] = 8'h00;
    mem[347] = 8'h00;
    mem[348] = 8'h0e;
    mem[349] = 8'hf0;
    mem[350] = 8'hff;
    mem[351] = 8'h1f;
    mem[352] = 8'hc0;
    mem[353] = 8'h7f;
    mem[354] = 8'h00;
    mem[355] = 8'h00;
    mem[356] = 8'h0e;
    mem[357] = 8'hf0;
    mem[358] = 8'hff;
    mem[359] = 8'h1f;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'h00;
    mem[363] = 8'h00;
    mem[364] = 8'h00;
    mem[365] = 8'h00;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'h00;
    mem[371] = 8'h00;
    mem[372] = 8'h00;
    mem[373] = 8'h00;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'h00;
    mem[379] = 8'h00;
    mem[380] = 8'h00;
    mem[381] = 8'h00;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'h00;
    mem[387] = 8'h00;
    mem[388] = 8'h00;
    mem[389] = 8'h00;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'h00;
    mem[395] = 8'h00;
    mem[396] = 8'h00;
    mem[397] = 8'h00;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_1024 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'h00;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'h00;
    mem[148] = 8'h00;
    mem[149] = 8'h00;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'h00;
    mem[156] = 8'h00;
    mem[157] = 8'h00;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h00;
    mem[162] = 8'h00;
    mem[163] = 8'h00;
    mem[164] = 8'h00;
    mem[165] = 8'h00;
    mem[166] = 8'h00;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'h00;
    mem[170] = 8'h00;
    mem[171] = 8'h00;
    mem[172] = 8'h00;
    mem[173] = 8'h00;
    mem[174] = 8'h00;
    mem[175] = 8'h00;
    mem[176] = 8'h00;
    mem[177] = 8'h00;
    mem[178] = 8'h00;
    mem[179] = 8'h00;
    mem[180] = 8'h00;
    mem[181] = 8'h00;
    mem[182] = 8'h00;
    mem[183] = 8'h00;
    mem[184] = 8'h00;
    mem[185] = 8'h00;
    mem[186] = 8'h00;
    mem[187] = 8'h00;
    mem[188] = 8'h00;
    mem[189] = 8'h00;
    mem[190] = 8'h00;
    mem[191] = 8'h00;
    mem[192] = 8'h00;
    mem[193] = 8'h0f;
    mem[194] = 8'he0;
    mem[195] = 8'h07;
    mem[196] = 8'hc0;
    mem[197] = 8'h0f;
    mem[198] = 8'h00;
    mem[199] = 8'h1c;
    mem[200] = 8'hc0;
    mem[201] = 8'h0f;
    mem[202] = 8'hf0;
    mem[203] = 8'h0f;
    mem[204] = 8'he0;
    mem[205] = 8'h1f;
    mem[206] = 8'h00;
    mem[207] = 8'h1e;
    mem[208] = 8'he0;
    mem[209] = 8'h0f;
    mem[210] = 8'h38;
    mem[211] = 8'h1c;
    mem[212] = 8'h70;
    mem[213] = 8'h38;
    mem[214] = 8'h00;
    mem[215] = 8'h1e;
    mem[216] = 8'h70;
    mem[217] = 8'h0e;
    mem[218] = 8'h1c;
    mem[219] = 8'h38;
    mem[220] = 8'h38;
    mem[221] = 8'h70;
    mem[222] = 8'h00;
    mem[223] = 8'h1f;
    mem[224] = 8'h18;
    mem[225] = 8'h0e;
    mem[226] = 8'h0c;
    mem[227] = 8'h30;
    mem[228] = 8'h18;
    mem[229] = 8'h70;
    mem[230] = 8'h80;
    mem[231] = 8'h1f;
    mem[232] = 8'h00;
    mem[233] = 8'h0e;
    mem[234] = 8'h0e;
    mem[235] = 8'h70;
    mem[236] = 8'h18;
    mem[237] = 8'h70;
    mem[238] = 8'hc0;
    mem[239] = 8'h1d;
    mem[240] = 8'h00;
    mem[241] = 8'h0e;
    mem[242] = 8'h0e;
    mem[243] = 8'h70;
    mem[244] = 8'h00;
    mem[245] = 8'h70;
    mem[246] = 8'hc0;
    mem[247] = 8'h1c;
    mem[248] = 8'h00;
    mem[249] = 8'h0e;
    mem[250] = 8'h0e;
    mem[251] = 8'h70;
    mem[252] = 8'h00;
    mem[253] = 8'h30;
    mem[254] = 8'h60;
    mem[255] = 8'h1c;
    mem[256] = 8'h00;
    mem[257] = 8'h0e;
    mem[258] = 8'h0e;
    mem[259] = 8'h70;
    mem[260] = 8'h00;
    mem[261] = 8'h38;
    mem[262] = 8'h70;
    mem[263] = 8'h1c;
    mem[264] = 8'h00;
    mem[265] = 8'h0e;
    mem[266] = 8'h0e;
    mem[267] = 8'h70;
    mem[268] = 8'h00;
    mem[269] = 8'h1c;
    mem[270] = 8'h38;
    mem[271] = 8'h1c;
    mem[272] = 8'h00;
    mem[273] = 8'h0e;
    mem[274] = 8'h0e;
    mem[275] = 8'h70;
    mem[276] = 8'h00;
    mem[277] = 8'h0e;
    mem[278] = 8'h18;
    mem[279] = 8'h1c;
    mem[280] = 8'h00;
    mem[281] = 8'h0e;
    mem[282] = 8'h0e;
    mem[283] = 8'h70;
    mem[284] = 8'h00;
    mem[285] = 8'h07;
    mem[286] = 8'h0c;
    mem[287] = 8'h1c;
    mem[288] = 8'h00;
    mem[289] = 8'h0e;
    mem[290] = 8'h0e;
    mem[291] = 8'h70;
    mem[292] = 8'h80;
    mem[293] = 8'h03;
    mem[294] = 8'hfe;
    mem[295] = 8'h7f;
    mem[296] = 8'h00;
    mem[297] = 8'h0e;
    mem[298] = 8'h0e;
    mem[299] = 8'h70;
    mem[300] = 8'hc0;
    mem[301] = 8'h01;
    mem[302] = 8'hfe;
    mem[303] = 8'h7f;
    mem[304] = 8'h00;
    mem[305] = 8'h0e;
    mem[306] = 8'h0c;
    mem[307] = 8'h30;
    mem[308] = 8'he0;
    mem[309] = 8'h00;
    mem[310] = 8'h00;
    mem[311] = 8'h1c;
    mem[312] = 8'h00;
    mem[313] = 8'h0e;
    mem[314] = 8'h1c;
    mem[315] = 8'h38;
    mem[316] = 8'h70;
    mem[317] = 8'h00;
    mem[318] = 8'h00;
    mem[319] = 8'h1c;
    mem[320] = 8'h00;
    mem[321] = 8'h0e;
    mem[322] = 8'h38;
    mem[323] = 8'h1c;
    mem[324] = 8'h38;
    mem[325] = 8'h00;
    mem[326] = 8'h00;
    mem[327] = 8'h1c;
    mem[328] = 8'h00;
    mem[329] = 8'h0e;
    mem[330] = 8'hf0;
    mem[331] = 8'h0f;
    mem[332] = 8'hfc;
    mem[333] = 8'h7f;
    mem[334] = 8'h00;
    mem[335] = 8'h1c;
    mem[336] = 8'h00;
    mem[337] = 8'h0e;
    mem[338] = 8'he0;
    mem[339] = 8'h07;
    mem[340] = 8'hfc;
    mem[341] = 8'h7f;
    mem[342] = 8'h00;
    mem[343] = 8'h1c;
    mem[344] = 8'h00;
    mem[345] = 8'h00;
    mem[346] = 8'h00;
    mem[347] = 8'h00;
    mem[348] = 8'h00;
    mem[349] = 8'h00;
    mem[350] = 8'h00;
    mem[351] = 8'h00;
    mem[352] = 8'h00;
    mem[353] = 8'h00;
    mem[354] = 8'h00;
    mem[355] = 8'h00;
    mem[356] = 8'h00;
    mem[357] = 8'h00;
    mem[358] = 8'h00;
    mem[359] = 8'h00;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'h00;
    mem[363] = 8'h00;
    mem[364] = 8'h00;
    mem[365] = 8'h00;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'h00;
    mem[371] = 8'h00;
    mem[372] = 8'h00;
    mem[373] = 8'h00;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'h00;
    mem[379] = 8'h00;
    mem[380] = 8'h00;
    mem[381] = 8'h00;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'h00;
    mem[387] = 8'h00;
    mem[388] = 8'h00;
    mem[389] = 8'h00;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'h00;
    mem[395] = 8'h00;
    mem[396] = 8'h00;
    mem[397] = 8'h00;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule

module glyph_2048 (
    input wire [5:0] x,
    input wire [5:0] y,
    output wire pixel
);

  reg [7:0] mem[511:0];
  initial begin
    mem[0] = 8'h00;
    mem[1] = 8'h00;
    mem[2] = 8'h00;
    mem[3] = 8'h00;
    mem[4] = 8'h00;
    mem[5] = 8'h00;
    mem[6] = 8'h00;
    mem[7] = 8'h00;
    mem[8] = 8'h00;
    mem[9] = 8'h00;
    mem[10] = 8'h00;
    mem[11] = 8'h00;
    mem[12] = 8'h00;
    mem[13] = 8'h00;
    mem[14] = 8'h00;
    mem[15] = 8'h00;
    mem[16] = 8'h00;
    mem[17] = 8'h00;
    mem[18] = 8'h00;
    mem[19] = 8'h00;
    mem[20] = 8'h00;
    mem[21] = 8'h00;
    mem[22] = 8'h00;
    mem[23] = 8'h00;
    mem[24] = 8'h00;
    mem[25] = 8'h00;
    mem[26] = 8'h00;
    mem[27] = 8'h00;
    mem[28] = 8'h00;
    mem[29] = 8'h00;
    mem[30] = 8'h00;
    mem[31] = 8'h00;
    mem[32] = 8'h00;
    mem[33] = 8'h00;
    mem[34] = 8'h00;
    mem[35] = 8'h00;
    mem[36] = 8'h00;
    mem[37] = 8'h00;
    mem[38] = 8'h00;
    mem[39] = 8'h00;
    mem[40] = 8'h00;
    mem[41] = 8'h00;
    mem[42] = 8'h00;
    mem[43] = 8'h00;
    mem[44] = 8'h00;
    mem[45] = 8'h00;
    mem[46] = 8'h00;
    mem[47] = 8'h00;
    mem[48] = 8'h00;
    mem[49] = 8'h00;
    mem[50] = 8'h00;
    mem[51] = 8'h00;
    mem[52] = 8'h00;
    mem[53] = 8'h00;
    mem[54] = 8'h00;
    mem[55] = 8'h00;
    mem[56] = 8'h00;
    mem[57] = 8'h00;
    mem[58] = 8'h00;
    mem[59] = 8'h00;
    mem[60] = 8'h00;
    mem[61] = 8'h00;
    mem[62] = 8'h00;
    mem[63] = 8'h00;
    mem[64] = 8'h00;
    mem[65] = 8'h00;
    mem[66] = 8'h00;
    mem[67] = 8'h00;
    mem[68] = 8'h00;
    mem[69] = 8'h00;
    mem[70] = 8'h00;
    mem[71] = 8'h00;
    mem[72] = 8'h00;
    mem[73] = 8'h00;
    mem[74] = 8'h00;
    mem[75] = 8'h00;
    mem[76] = 8'h00;
    mem[77] = 8'h00;
    mem[78] = 8'h00;
    mem[79] = 8'h00;
    mem[80] = 8'h00;
    mem[81] = 8'h00;
    mem[82] = 8'h00;
    mem[83] = 8'h00;
    mem[84] = 8'h00;
    mem[85] = 8'h00;
    mem[86] = 8'h00;
    mem[87] = 8'h00;
    mem[88] = 8'h00;
    mem[89] = 8'h00;
    mem[90] = 8'h00;
    mem[91] = 8'h00;
    mem[92] = 8'h00;
    mem[93] = 8'h00;
    mem[94] = 8'h00;
    mem[95] = 8'h00;
    mem[96] = 8'h00;
    mem[97] = 8'h00;
    mem[98] = 8'h00;
    mem[99] = 8'h00;
    mem[100] = 8'h00;
    mem[101] = 8'h00;
    mem[102] = 8'h00;
    mem[103] = 8'h00;
    mem[104] = 8'h00;
    mem[105] = 8'h00;
    mem[106] = 8'h00;
    mem[107] = 8'h00;
    mem[108] = 8'h00;
    mem[109] = 8'h00;
    mem[110] = 8'h00;
    mem[111] = 8'h00;
    mem[112] = 8'h00;
    mem[113] = 8'h00;
    mem[114] = 8'h00;
    mem[115] = 8'h00;
    mem[116] = 8'h00;
    mem[117] = 8'h00;
    mem[118] = 8'h00;
    mem[119] = 8'h00;
    mem[120] = 8'h00;
    mem[121] = 8'h00;
    mem[122] = 8'h00;
    mem[123] = 8'h00;
    mem[124] = 8'h00;
    mem[125] = 8'h00;
    mem[126] = 8'h00;
    mem[127] = 8'h00;
    mem[128] = 8'h00;
    mem[129] = 8'h00;
    mem[130] = 8'h00;
    mem[131] = 8'h00;
    mem[132] = 8'h00;
    mem[133] = 8'h00;
    mem[134] = 8'h00;
    mem[135] = 8'h00;
    mem[136] = 8'h00;
    mem[137] = 8'h00;
    mem[138] = 8'h00;
    mem[139] = 8'h00;
    mem[140] = 8'h00;
    mem[141] = 8'h00;
    mem[142] = 8'h00;
    mem[143] = 8'h00;
    mem[144] = 8'h00;
    mem[145] = 8'h00;
    mem[146] = 8'h00;
    mem[147] = 8'h00;
    mem[148] = 8'h00;
    mem[149] = 8'h00;
    mem[150] = 8'h00;
    mem[151] = 8'h00;
    mem[152] = 8'h00;
    mem[153] = 8'h00;
    mem[154] = 8'h00;
    mem[155] = 8'h00;
    mem[156] = 8'h00;
    mem[157] = 8'h00;
    mem[158] = 8'h00;
    mem[159] = 8'h00;
    mem[160] = 8'h00;
    mem[161] = 8'h00;
    mem[162] = 8'h00;
    mem[163] = 8'h00;
    mem[164] = 8'h00;
    mem[165] = 8'h00;
    mem[166] = 8'h00;
    mem[167] = 8'h00;
    mem[168] = 8'h00;
    mem[169] = 8'h00;
    mem[170] = 8'h00;
    mem[171] = 8'h00;
    mem[172] = 8'h00;
    mem[173] = 8'h00;
    mem[174] = 8'h00;
    mem[175] = 8'h00;
    mem[176] = 8'h00;
    mem[177] = 8'h00;
    mem[178] = 8'h00;
    mem[179] = 8'h00;
    mem[180] = 8'h00;
    mem[181] = 8'h00;
    mem[182] = 8'h00;
    mem[183] = 8'h00;
    mem[184] = 8'h00;
    mem[185] = 8'h00;
    mem[186] = 8'h00;
    mem[187] = 8'h00;
    mem[188] = 8'h00;
    mem[189] = 8'h00;
    mem[190] = 8'h00;
    mem[191] = 8'h00;
    mem[192] = 8'hc0;
    mem[193] = 8'h0f;
    mem[194] = 8'he0;
    mem[195] = 8'h07;
    mem[196] = 8'h00;
    mem[197] = 8'h1c;
    mem[198] = 8'he0;
    mem[199] = 8'h07;
    mem[200] = 8'he0;
    mem[201] = 8'h1f;
    mem[202] = 8'hf0;
    mem[203] = 8'h0f;
    mem[204] = 8'h00;
    mem[205] = 8'h1e;
    mem[206] = 8'hf8;
    mem[207] = 8'h0f;
    mem[208] = 8'h70;
    mem[209] = 8'h38;
    mem[210] = 8'h38;
    mem[211] = 8'h1c;
    mem[212] = 8'h00;
    mem[213] = 8'h1e;
    mem[214] = 8'h38;
    mem[215] = 8'h1c;
    mem[216] = 8'h38;
    mem[217] = 8'h70;
    mem[218] = 8'h1c;
    mem[219] = 8'h38;
    mem[220] = 8'h00;
    mem[221] = 8'h1f;
    mem[222] = 8'h1c;
    mem[223] = 8'h38;
    mem[224] = 8'h18;
    mem[225] = 8'h70;
    mem[226] = 8'h0c;
    mem[227] = 8'h30;
    mem[228] = 8'h80;
    mem[229] = 8'h1f;
    mem[230] = 8'h1c;
    mem[231] = 8'h38;
    mem[232] = 8'h18;
    mem[233] = 8'h70;
    mem[234] = 8'h0e;
    mem[235] = 8'h70;
    mem[236] = 8'hc0;
    mem[237] = 8'h1d;
    mem[238] = 8'h1c;
    mem[239] = 8'h38;
    mem[240] = 8'h00;
    mem[241] = 8'h70;
    mem[242] = 8'h0e;
    mem[243] = 8'h70;
    mem[244] = 8'hc0;
    mem[245] = 8'h1c;
    mem[246] = 8'h1c;
    mem[247] = 8'h38;
    mem[248] = 8'h00;
    mem[249] = 8'h30;
    mem[250] = 8'h0e;
    mem[251] = 8'h70;
    mem[252] = 8'h60;
    mem[253] = 8'h1c;
    mem[254] = 8'h38;
    mem[255] = 8'h1c;
    mem[256] = 8'h00;
    mem[257] = 8'h38;
    mem[258] = 8'h0e;
    mem[259] = 8'h70;
    mem[260] = 8'h70;
    mem[261] = 8'h1c;
    mem[262] = 8'hf0;
    mem[263] = 8'h0f;
    mem[264] = 8'h00;
    mem[265] = 8'h1c;
    mem[266] = 8'h0e;
    mem[267] = 8'h70;
    mem[268] = 8'h38;
    mem[269] = 8'h1c;
    mem[270] = 8'hf8;
    mem[271] = 8'h0f;
    mem[272] = 8'h00;
    mem[273] = 8'h0e;
    mem[274] = 8'h0e;
    mem[275] = 8'h70;
    mem[276] = 8'h18;
    mem[277] = 8'h1c;
    mem[278] = 8'h1c;
    mem[279] = 8'h1c;
    mem[280] = 8'h00;
    mem[281] = 8'h07;
    mem[282] = 8'h0e;
    mem[283] = 8'h70;
    mem[284] = 8'h0c;
    mem[285] = 8'h1c;
    mem[286] = 8'h0e;
    mem[287] = 8'h38;
    mem[288] = 8'h80;
    mem[289] = 8'h03;
    mem[290] = 8'h0e;
    mem[291] = 8'h70;
    mem[292] = 8'hfe;
    mem[293] = 8'h7f;
    mem[294] = 8'h0e;
    mem[295] = 8'h30;
    mem[296] = 8'hc0;
    mem[297] = 8'h01;
    mem[298] = 8'h0e;
    mem[299] = 8'h70;
    mem[300] = 8'hfe;
    mem[301] = 8'h7f;
    mem[302] = 8'h0e;
    mem[303] = 8'h70;
    mem[304] = 8'he0;
    mem[305] = 8'h00;
    mem[306] = 8'h0c;
    mem[307] = 8'h30;
    mem[308] = 8'h00;
    mem[309] = 8'h1c;
    mem[310] = 8'h0e;
    mem[311] = 8'h70;
    mem[312] = 8'h70;
    mem[313] = 8'h00;
    mem[314] = 8'h1c;
    mem[315] = 8'h38;
    mem[316] = 8'h00;
    mem[317] = 8'h1c;
    mem[318] = 8'h0e;
    mem[319] = 8'h38;
    mem[320] = 8'h38;
    mem[321] = 8'h00;
    mem[322] = 8'h38;
    mem[323] = 8'h1c;
    mem[324] = 8'h00;
    mem[325] = 8'h1c;
    mem[326] = 8'h1c;
    mem[327] = 8'h3c;
    mem[328] = 8'hfc;
    mem[329] = 8'h7f;
    mem[330] = 8'hf0;
    mem[331] = 8'h0f;
    mem[332] = 8'h00;
    mem[333] = 8'h1c;
    mem[334] = 8'hf8;
    mem[335] = 8'h1f;
    mem[336] = 8'hfc;
    mem[337] = 8'h7f;
    mem[338] = 8'he0;
    mem[339] = 8'h07;
    mem[340] = 8'h00;
    mem[341] = 8'h1c;
    mem[342] = 8'he0;
    mem[343] = 8'h07;
    mem[344] = 8'h00;
    mem[345] = 8'h00;
    mem[346] = 8'h00;
    mem[347] = 8'h00;
    mem[348] = 8'h00;
    mem[349] = 8'h00;
    mem[350] = 8'h00;
    mem[351] = 8'h00;
    mem[352] = 8'h00;
    mem[353] = 8'h00;
    mem[354] = 8'h00;
    mem[355] = 8'h00;
    mem[356] = 8'h00;
    mem[357] = 8'h00;
    mem[358] = 8'h00;
    mem[359] = 8'h00;
    mem[360] = 8'h00;
    mem[361] = 8'h00;
    mem[362] = 8'h00;
    mem[363] = 8'h00;
    mem[364] = 8'h00;
    mem[365] = 8'h00;
    mem[366] = 8'h00;
    mem[367] = 8'h00;
    mem[368] = 8'h00;
    mem[369] = 8'h00;
    mem[370] = 8'h00;
    mem[371] = 8'h00;
    mem[372] = 8'h00;
    mem[373] = 8'h00;
    mem[374] = 8'h00;
    mem[375] = 8'h00;
    mem[376] = 8'h00;
    mem[377] = 8'h00;
    mem[378] = 8'h00;
    mem[379] = 8'h00;
    mem[380] = 8'h00;
    mem[381] = 8'h00;
    mem[382] = 8'h00;
    mem[383] = 8'h00;
    mem[384] = 8'h00;
    mem[385] = 8'h00;
    mem[386] = 8'h00;
    mem[387] = 8'h00;
    mem[388] = 8'h00;
    mem[389] = 8'h00;
    mem[390] = 8'h00;
    mem[391] = 8'h00;
    mem[392] = 8'h00;
    mem[393] = 8'h00;
    mem[394] = 8'h00;
    mem[395] = 8'h00;
    mem[396] = 8'h00;
    mem[397] = 8'h00;
    mem[398] = 8'h00;
    mem[399] = 8'h00;
    mem[400] = 8'h00;
    mem[401] = 8'h00;
    mem[402] = 8'h00;
    mem[403] = 8'h00;
    mem[404] = 8'h00;
    mem[405] = 8'h00;
    mem[406] = 8'h00;
    mem[407] = 8'h00;
    mem[408] = 8'h00;
    mem[409] = 8'h00;
    mem[410] = 8'h00;
    mem[411] = 8'h00;
    mem[412] = 8'h00;
    mem[413] = 8'h00;
    mem[414] = 8'h00;
    mem[415] = 8'h00;
    mem[416] = 8'h00;
    mem[417] = 8'h00;
    mem[418] = 8'h00;
    mem[419] = 8'h00;
    mem[420] = 8'h00;
    mem[421] = 8'h00;
    mem[422] = 8'h00;
    mem[423] = 8'h00;
    mem[424] = 8'h00;
    mem[425] = 8'h00;
    mem[426] = 8'h00;
    mem[427] = 8'h00;
    mem[428] = 8'h00;
    mem[429] = 8'h00;
    mem[430] = 8'h00;
    mem[431] = 8'h00;
    mem[432] = 8'h00;
    mem[433] = 8'h00;
    mem[434] = 8'h00;
    mem[435] = 8'h00;
    mem[436] = 8'h00;
    mem[437] = 8'h00;
    mem[438] = 8'h00;
    mem[439] = 8'h00;
    mem[440] = 8'h00;
    mem[441] = 8'h00;
    mem[442] = 8'h00;
    mem[443] = 8'h00;
    mem[444] = 8'h00;
    mem[445] = 8'h00;
    mem[446] = 8'h00;
    mem[447] = 8'h00;
    mem[448] = 8'h00;
    mem[449] = 8'h00;
    mem[450] = 8'h00;
    mem[451] = 8'h00;
    mem[452] = 8'h00;
    mem[453] = 8'h00;
    mem[454] = 8'h00;
    mem[455] = 8'h00;
    mem[456] = 8'h00;
    mem[457] = 8'h00;
    mem[458] = 8'h00;
    mem[459] = 8'h00;
    mem[460] = 8'h00;
    mem[461] = 8'h00;
    mem[462] = 8'h00;
    mem[463] = 8'h00;
    mem[464] = 8'h00;
    mem[465] = 8'h00;
    mem[466] = 8'h00;
    mem[467] = 8'h00;
    mem[468] = 8'h00;
    mem[469] = 8'h00;
    mem[470] = 8'h00;
    mem[471] = 8'h00;
    mem[472] = 8'h00;
    mem[473] = 8'h00;
    mem[474] = 8'h00;
    mem[475] = 8'h00;
    mem[476] = 8'h00;
    mem[477] = 8'h00;
    mem[478] = 8'h00;
    mem[479] = 8'h00;
    mem[480] = 8'h00;
    mem[481] = 8'h00;
    mem[482] = 8'h00;
    mem[483] = 8'h00;
    mem[484] = 8'h00;
    mem[485] = 8'h00;
    mem[486] = 8'h00;
    mem[487] = 8'h00;
    mem[488] = 8'h00;
    mem[489] = 8'h00;
    mem[490] = 8'h00;
    mem[491] = 8'h00;
    mem[492] = 8'h00;
    mem[493] = 8'h00;
    mem[494] = 8'h00;
    mem[495] = 8'h00;
    mem[496] = 8'h00;
    mem[497] = 8'h00;
    mem[498] = 8'h00;
    mem[499] = 8'h00;
    mem[500] = 8'h00;
    mem[501] = 8'h00;
    mem[502] = 8'h00;
    mem[503] = 8'h00;
    mem[504] = 8'h00;
    mem[505] = 8'h00;
    mem[506] = 8'h00;
    mem[507] = 8'h00;
    mem[508] = 8'h00;
    mem[509] = 8'h00;
    mem[510] = 8'h00;
    mem[511] = 8'h00;
  end

  wire [8:0] addr = {y[5:0], x[5:3]};
  assign pixel = mem[addr][x&7];

endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

module tt_um_2048_vga_game (
    input  wire [7:0] ui_in,    // Dedicated inputs
    output wire [7:0] uo_out,   // Dedicated outputs
    input  wire [7:0] uio_in,   // IOs: Input path
    output wire [7:0] uio_out,  // IOs: Output path
    output wire [7:0] uio_oe,   // IOs: Enable path (active high: 0=input, 1=output)
    input  wire       ena,      // always 1 when the design is powered, so you can ignore it
    input  wire       clk,      // clock
    input  wire       rst_n     // reset_n - low to reset
);
// >>> Module Implementation Begin

// <<< Module Implementation End
endmodule




`default_nettype none

/*
Video sync generator, used to drive a VGA monitor.
Timing from: https://en.wikipedia.org/wiki/Video_Graphics_Array
To use:
- Wire the hsync and vsync signals to top level outputs
- Add a 3-bit (or more) "rgb" output to the top level
*/

module vga_sync_generator (
    clk,
    reset,
    hsync,
    vsync,
    display_on,
    hpos,
    vpos
);

  input clk;
  input reset;
  output reg hsync, vsync;
  output display_on;
  output reg [9:0] hpos;
  output reg [9:0] vpos;

  // declarations for TV-simulator sync parameters
  // horizontal constants
  parameter H_DISPLAY = 640;  // horizontal display width
  parameter H_BACK = 48;  // horizontal left border (back porch)
  parameter H_FRONT = 16;  // horizontal right border (front porch)
  parameter H_SYNC = 96;  // horizontal sync width
  parameter H_SYNC_INV = 1;  // invert horizontal sync (active low)
  // vertical constants
  parameter V_DISPLAY = 480;  // vertical display height
  parameter V_TOP = 33;  // vertical top border
  parameter V_BOTTOM = 10;  // vertical bottom border
  parameter V_SYNC = 2;  // vertical sync # lines
  parameter V_SYNC_INV = 1;  // invert vertical sync (active low)
  // derived constants
  parameter H_SYNC_START = H_DISPLAY + H_FRONT;
  parameter H_SYNC_END = H_DISPLAY + H_FRONT + H_SYNC - 1;
  parameter H_MAX = H_DISPLAY + H_BACK + H_FRONT + H_SYNC - 1;
  parameter V_SYNC_START = V_DISPLAY + V_BOTTOM;
  parameter V_SYNC_END = V_DISPLAY + V_BOTTOM + V_SYNC - 1;
  parameter V_MAX = V_DISPLAY + V_TOP + V_BOTTOM + V_SYNC - 1;

  wire hmaxxed = (hpos == H_MAX) || reset;  // set when hpos is maximum
  wire vmaxxed = (vpos == V_MAX) || reset;  // set when vpos is maximum

  // horizontal position counter
  always @(posedge clk) begin
    hsync <= (hpos >= H_SYNC_START && hpos <= H_SYNC_END) ? ~H_SYNC_INV : H_SYNC_INV;
    if (hmaxxed) hpos <= 0;
    else hpos <= hpos + 1;
  end

  // vertical position counter
  always @(posedge clk) begin
    vsync <= (vpos >= V_SYNC_START && vpos <= V_SYNC_END) ? ~V_SYNC_INV : V_SYNC_INV;
    if (hmaxxed)
      if (vmaxxed) vpos <= 0;
      else vpos <= vpos + 1;
  end

  // display_on is set when beam is in "safe" visible frame
  assign display_on = (hpos < H_DISPLAY) && (vpos < V_DISPLAY);

endmodule


/*
 * Copyright (c) 2024 Uri Shaked
 * SPDX-License-Identifier: Apache-2.0
 */

`default_nettype none

// 30 frames == 0.5 seconds. Make sure welcome_counter is wide enough to hold this value:
`define ANIMATION_DELAY 30 

module welcome_screen (
    input wire clk,
    input wire rst_n,
    input wire vsync_rising_edge,
    input wire [3:0] lfsr_out,
    output reg [63:0] grid
);

  reg [4:0] welcome_counter;

  always @(posedge clk) begin
    if (~rst_n) begin
      welcome_counter <= `ANIMATION_DELAY;
    end else begin
      if (welcome_counter == `ANIMATION_DELAY) begin
        if (grid[lfsr_out*4+:4] == 4'd0) begin
          grid <= 0;
          grid[lfsr_out*4+:4] <= 4'd11;  // displays 2048 (2^11)
          welcome_counter <= 0;
        end
      end else if (vsync_rising_edge) begin
        welcome_counter <= welcome_counter + 1;
      end
    end
  end
endmodule


Reference solution:
rtl/generated.v: 
  // Direct inputs
  wire btn_up_in;
  wire btn_down_in;
  wire btn_left_in;
  wire btn_right_in;
  wire retro_colors_in = ui_in[4] & ui_in[5];
  wire debug_en = ui_in[7];

  button_debounce btn_up_debounce (
      .clk(clk),
      .rst_n(rst_n),
      .button(ui_in[0]),
      .debounced(btn_up_in)
  );

  button_debounce btn_down_debounce (
      .clk(clk),
      .rst_n(rst_n),
      .button(ui_in[1]),
      .debounced(btn_down_in)
  );

  button_debounce btn_left_debounce (
      .clk(clk),
      .rst_n(rst_n),
      .button(ui_in[2]),
      .debounced(btn_left_in)
  );

  button_debounce btn_right_debounce (
      .clk(clk),
      .rst_n(rst_n),
      .button(ui_in[3]),
      .debounced(btn_right_in)
  );

  // Gamepad Pmod support
  wire gamepad_pmod_latch = ui_in[4];
  wire gamepad_pmod_clk = ui_in[5];
  wire gamepad_pmod_data = ui_in[6];
  wire gamepad_is_present;
  wire gamepad_left;
  wire gamepad_right;
  wire gamepad_up;
  wire gamepad_down;
  wire gamepad_start;
  wire gamepad_select;

  /* verilator lint_off PINMISSING */
  gamepad_pmod_single gamepad_pmod (
      // Inputs:
      .clk(clk),
      .rst_n(rst_n),
      .pmod_latch(gamepad_pmod_latch),
      .pmod_clk(gamepad_pmod_clk),
      .pmod_data(gamepad_pmod_data),

      // Outputs:
      .is_present(gamepad_is_present),
      .left(gamepad_left),
      .right(gamepad_right),
      .up(gamepad_up),
      .down(gamepad_down),
      .start(gamepad_start),
      .select(gamepad_select)
  );
  /* verilator lint_on PINMISSING */

  // Combined inputs
  wire btn_up = btn_up_in || gamepad_up;
  wire btn_down = btn_down_in || gamepad_down;
  wire btn_left = btn_left_in || gamepad_left;
  wire btn_right = btn_right_in || gamepad_right;
  reg btn_select_prev;
  wire btn_select = gamepad_select;

  // VGA signals
  wire hsync;
  wire vsync;
  reg [1:0] R;
  reg [1:0] G;
  reg [1:0] B;
  wire video_active;
  wire [9:0] pix_x;
  wire [9:0] pix_y;

  // TinyVGA Pmod
  assign uo_out = {hsync, B[0], G[0], R[0], vsync, B[1], G[1], R[1]};

  wire [31:0] lfsr_out;

  // Suppress unused signals warning
  wire _unused_ok = &{ena, ui_in[6:4], lfsr_out[27:16]};

  vga_sync_generator vga_sync_gen (
      .clk(clk),
      .reset(~rst_n),
      .hsync(hsync),
      .vsync(vsync),
      .display_on(video_active),
      .hpos(pix_x),
      .vpos(pix_y)
  );

  reg [63:0] grid;
  wire [63:0] next_grid;
  wire [63:0] welcome_screen_grid;
  reg show_welcome_screen;

  wire [3:0] last_added_tile_index;
  reg [15:0] new_tiles;
  reg [4:0] new_tiles_counter;

  reg vsync_prev;
  wire vsync_rising_edge = vsync && ~vsync_prev;

  galois_lfsr lfsr_inst (
      .clk  (clk),
      .rst_n(rst_n),
      .lfsr (lfsr_out)
  );

  reg retro_colors;
  wire [5:0] rrggbb;
  draw_game draw_game_inst (
      .grid(grid),
      .new_tiles(new_tiles),
      .new_tiles_counter(new_tiles_counter[3:1]),
      .retro_colors(retro_colors_in || retro_colors),
      .debug_mode(debug_en),
      .x(pix_x),
      .y(pix_y),
      .rrggbb(rrggbb)
  );

  welcome_screen welcome_screen_inst (
      .clk(clk),
      .rst_n(rst_n),
      .vsync_rising_edge(vsync_rising_edge),
      .lfsr_out(lfsr_out[31:28]),
      .grid(welcome_screen_grid)
  );

  wire [3:0] debug_move;
  wire debug_btn_up = debug_move[0];
  wire debug_btn_down = debug_move[1];
  wire debug_btn_left = debug_move[2];
  wire debug_btn_right = debug_move[3];

  wire debug_grid_valid;
  wire [3:0] debug_grid_addr;
  wire [3:0] debug_grid_data;

  game_logic game_logic_inst (
      .clk(clk),
      .rst_n(rst_n),
      .grid(next_grid),
      .added_tile_index(last_added_tile_index),
      .lfsr_value(lfsr_out[15:0]),
      .btn_up((~show_welcome_screen && btn_up) | debug_btn_up),
      .btn_right((~show_welcome_screen && btn_right) | debug_btn_right),
      .btn_down((~show_welcome_screen && btn_down) | debug_btn_down),
      .btn_left((~show_welcome_screen && btn_left) | debug_btn_left),
      .btn_start(~show_welcome_screen && gamepad_start),
      .debug_move(|{debug_move}),
      .debug_grid_valid(debug_grid_valid),
      .debug_grid_addr(debug_grid_addr),
      .debug_grid_data(debug_grid_data)
  );

  debug_controller debug_controller_inst (
      .clk(clk),
      .rst_n(rst_n),
      .debug_en(debug_en),
      .uio_in(uio_in),
      .uio_out(uio_out),
      .uio_oe(uio_oe),
      .grid_in(next_grid),
      .grid_out_valid(debug_grid_valid),
      .grid_out_addr(debug_grid_addr),
      .grid_out_data(debug_grid_data),
      .force_move(debug_move)
  );


  always @(posedge clk) begin
    if (~rst_n) begin
      R <= 0;
      G <= 0;
      B <= 0;
      vsync_prev <= 0;
      show_welcome_screen <= 1'b1;
      grid <= 0;
      retro_colors <= 0;
      btn_select_prev <= 0;
    end else begin
      R <= video_active ? rrggbb[5:4] : 2'b00;
      G <= video_active ? rrggbb[3:2] : 2'b00;
      B <= video_active ? rrggbb[1:0] : 2'b00;
      btn_select_prev <= btn_select;
      vsync_prev <= vsync;

      if (last_added_tile_index != 0) begin
        new_tiles[last_added_tile_index] <= 1;
        new_tiles_counter <= 25;
      end

      if (vsync_rising_edge) begin
        if (show_welcome_screen) begin
          grid <= welcome_screen_grid;
          if (btn_up || btn_down || btn_left || btn_right || gamepad_start) begin
            show_welcome_screen <= 0;
          end
        end else begin
          grid <= next_grid;
        end

        if (new_tiles_counter != 0) begin
          new_tiles_counter <= new_tiles_counter - 1;
        end else begin
          new_tiles <= 0;
        end
      end

      if (btn_select && ~btn_select_prev) begin
        retro_colors <= ~retro_colors;
      end
    end
  end