User`s manual

70
71 // compute address to store data in
72 wire [9:0] y_addr = {y[1][8:0], eo[1]};
73 wire [9:0] x_addr = x[1];
74
75 wire [7:0] R, G, B;
76 ycrcb2rgb conv( R, G, B, clk, 1’b0, data[1][29:20],
77 data[1][19:10], data[1][9:0] );
78
79 wire [16:0] myaddr_o = (y_addr[7:0] << 8) + (y_addr[7:0] << 6) + x_addr[8:0];
80 wire [16:0] myaddr;
81 synchronize #(.NSYNC(3), .W(17)) myaddr_sync(clk, myaddr_o, myaddr);
82 // update the output address and data only when four bytes ready
83
84 wire ntsc_we_o = (x_addr < COL_START + 10’d320 && y_addr < ROW_START + 10’d240) && (we_edge);
85
86 synchronize #(.NSYNC(3)) we_sync(clk, ntsc_we_o, ntsc_we);
87 always @(posedge clk)
88 if ( ntsc_we ) begin
89 ntsc_addr <= myaddr; // normal and expanded modes
90 ntsc_data <= ~sw ? {R[7:4], G[7:4], B[7:4]} :
91 {x_addr[9], 3’b0, x_addr[8], 3’b0, x_addr[7], 3’b0};
92 end
93
94 endmodule // ntsc_to_zbt
A.1.8 video decoder.v
1 //
2 // File: video_decoder.v
3 // Date: 31-Oct-05
4 // Author: J. Castro (MIT 6.111, fall 2005)
5 //
6 // This file contains the ntsc_decode and adv7185init modules
7 //
8 // These modules are used to grab input NTSC video data from the RCA
9 // phono jack on the right hand side of the 6.111 labkit (connect
10 // the camera to the LOWER jack).
11 //
12
13 /////////////////////////////////////////////////////////////////////////////
14 //
15 // NTSC decode - 16-bit CCIR656 decoder
16 // By Javier Castro
17 // This module takes a stream of LLC data from the adv7185
18 // NTSC/PAL video decoder and generates the corresponding pixels,
43