OpenCores
URL https://opencores.org/ocsvn/socgen/socgen/trunk

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [logic/] [ip/] [vga_char_ctrl/] [rtl/] [verilog/] [char_gen] - Blame information for rev 134

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
 
2
module `VARIANT`CHAR_GEN
3
 
4
(
5
 
6
input wire           clk,
7
input wire           reset,
8
input wire [13:0]    char_write_addr,
9
input wire [7:0]     char_write_data,
10
input wire           char_write_enable,
11
input wire [13:0]    char_read_addr,               // character address "0" is upper left character
12
input wire [2:0]     subchar_line,               // line number within 8 line block
13
 
14
input wire [2:0]     subchar_pixel,               // pixel position within 8 pixel block
15
 
16
input wire [7:0]     ascii_code,
17
 
18 134 jt_eaton
input wire [7:0]            char_gen_rom_data,
19
 
20 131 jt_eaton
output reg           pixel_on
21
 
22
                         );
23
 
24
 
25
 
26
reg                   latch_data;
27
reg                   latch_low_data;
28
reg                   shift_high;
29
reg                   shift_low;
30
reg [3:0]             latched_low_char_data;
31
reg [7:0]             latched_char_data;
32
 
33
 
34
 
35
 
36
 
37
 
38
 
39
 
40
// LATCH THE CHARTACTER DATA FROM THE CHAR GEN ROM AND CREATE A SERIAL CHAR DATA STREAM
41
always @ (posedge clk )begin
42
               if (reset) begin
43
                    latch_data <= 1'b0;
44
                    end
45
               else if (subchar_pixel == 3'b110) begin
46
                    latch_data <= 1'b1;
47
                    end
48
               else if (subchar_pixel == 3'b111) begin
49
                    latch_data <= 1'b0;
50
                    end
51
               end
52
 
53
always @ (posedge clk )begin
54
               if (reset) begin
55
                    latch_low_data <= 1'b0;
56
                    end
57
               else if (subchar_pixel == 3'b010) begin
58
                    latch_low_data <= 1'b1;
59
                    end
60
               else if (subchar_pixel == 3'b011) begin
61
                    latch_low_data <= 1'b0;
62
                    end
63
               end
64
 
65
always @ (posedge clk )begin
66
               if (reset) begin
67
                    shift_high <= 1'b1;
68
                    end
69
               else if (subchar_pixel == 3'b011) begin
70
                    shift_high <= 1'b0;
71
                    end
72
               else if (subchar_pixel == 3'b111) begin
73
                    shift_high <= 1'b1;
74
                    end
75
               end
76
 
77
always @ (posedge clk )begin
78
               if (reset) begin
79
                    shift_low <= 1'b0;
80
                    end
81
               else if (subchar_pixel == 3'b011) begin
82
                    shift_low <= 1'b1;
83
                    end
84
               else if (subchar_pixel == 3'b111) begin
85
                    shift_low <= 1'b0;
86
                    end
87
               end
88
 
89
// serialize the CHARACTER MODE data
90
always @ (posedge clk ) begin
91
     if (reset)
92
           begin
93
               pixel_on              <= 1'b0;
94
               latched_low_char_data <= 4'h0;
95
               latched_char_data     <= 8'h00;
96
          end
97
 
98
     else if (shift_high)
99
          begin
100
               pixel_on              <= latched_char_data [7];
101
               latched_char_data [7] <= latched_char_data [6];
102
               latched_char_data [6] <= latched_char_data [5];
103
               latched_char_data [5] <= latched_char_data [4];
104
               latched_char_data [4] <= latched_char_data [7];
105
                    if(latch_low_data) begin
106
                         latched_low_char_data [3:0] <= latched_char_data [3:0];
107
                         end
108
                    else begin
109
                         latched_low_char_data [3:0] <= latched_low_char_data [3:0];
110
                         end
111
               end
112
 
113
     else if (shift_low)
114
          begin
115
               pixel_on                  <= latched_low_char_data [3];
116
               latched_low_char_data [3] <= latched_low_char_data [2];
117
               latched_low_char_data [2] <= latched_low_char_data [1];
118
               latched_low_char_data [1] <= latched_low_char_data [0];
119
               latched_low_char_data [0] <= latched_low_char_data [3];
120
               if  (latch_data)   latched_char_data [7:0] <= char_gen_rom_data[7:0];
121
               else               latched_char_data [7:0] <= latched_char_data [7:0];
122
          end
123
      else
124
          begin
125
          latched_low_char_data [3:0]  <= latched_low_char_data [3:0];
126
          latched_char_data [7:0]      <= latched_char_data [7:0];
127
          pixel_on                     <= pixel_on;
128
          end
129
     end
130
 
131
endmodule //CHAR_GEN
132
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.