User`s manual
41 // internal registers for numerator and denominator computation
42 // see perspective_params.v for the equations
43 reg signed[78:0] num_x = 0;
44 reg signed[78:0] num_y = 0;
45 reg signed[78:0] denom = 0;
46
47 // internal registers for pixel index
48 reg[9:0] cur_x = 0;
49 reg[9:0] cur_y = 0;
50
51 // divider outputs
52 wire signed[78:0] inv_x;
53 wire signed[78:0] inv_y;
54 wire signed[78:0] dummy_remx;
55 wire signed[78:0] dummy_remy;
56 reg div_start;
57 wire div_done_x;
58 wire div_done_y;
59
60 // instantiate dividers
61 divider #(.WIDTH(79)) divider_x(.clk(clk),
62 .sign(1’b1),
63 .start(div_start),
64 .dividend(num_x),
65 .divider(denom),
66 .quotient(inv_x),
67 .remainder(dummy_remx),
68 .ready(div_done_x));
69
70 divider #(.WIDTH(79)) divider_y(.clk(clk),
71 .sign(1’b1),
72 .start(div_start),
73 .dividend(num_y),
74 .divider(denom),
75 .quotient(inv_y),
76 .remainder(dummy_remy),
77 .ready(div_done_y));
78
79 // instantiate an address mapper (for the vga_in)
80 addr_map addr_map_vga(.hcount(cur_x),
81 .vcount(cur_y),
82 .addr(vga_in_addr));
83
84 // instantiate an address mapper (for the ntsc_out)
85 addr_map addr_map_ntsc(.hcount(inv_x[9:0]),
86 .vcount(inv_y[9:0]),
233