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

Subversion Repositories z80control

[/] [z80control/] [trunk/] [CII_Starter_USB_API_v1/] [HW/] [VGA_Controller/] [VGA_Pattern.v] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 tylerapohl
//Legal Notice: (C)2006 Altera Corporation. All rights reserved. Your
2
//use of Altera Corporation's design tools, logic functions and other
3
//software and tools, and its AMPP partner logic functions, and any
4
//output files any of the foregoing (including device programming or
5
//simulation files), and any associated documentation or information are
6
//expressly subject to the terms and conditions of the Altera Program
7
//License Subscription Agreement or other applicable license agreement,
8
//including, without limitation, that your use is for the sole purpose
9
//of programming logic devices manufactured by Altera and sold by Altera
10
//or its authorized distributors.  Please refer to the applicable
11
//agreement for further details.
12
 
13
module  VGA_Pattern     (       //      Read Out Side
14
                                                oRed,
15
                                                oGreen,
16
                                                oBlue,
17
                                                iVGA_X,
18
                                                iVGA_Y,
19
                                                iVGA_CLK,
20
                                                //      Control Signals
21
                                                iRST_N  );
22
//      Read Out Side
23
output  reg     [9:0]    oRed;
24
output  reg     [9:0]    oGreen;
25
output  reg     [9:0]    oBlue;
26
input   [9:0]            iVGA_X;
27
input   [9:0]            iVGA_Y;
28
input                           iVGA_CLK;
29
//      Control Signals
30
input                           iRST_N;
31
 
32
always@(posedge iVGA_CLK or negedge iRST_N)
33
begin
34
        if(!iRST_N)
35
        begin
36
                oRed    <=      0;
37
                oGreen  <=      0;
38
                oBlue   <=      0;
39
        end
40
        else
41
        begin
42
                oRed    <=      (iVGA_Y<120)                                    ?                       256     :
43
                                        (iVGA_Y>=120 && iVGA_Y<240)             ?                       512     :
44
                                        (iVGA_Y>=240 && iVGA_Y<360)             ?                       768     :
45
                                                                                                                                1023;
46
                oGreen  <=      (iVGA_X<80)                                             ?                       128     :
47
                                        (iVGA_X>=80 && iVGA_X<160)              ?                       256     :
48
                                        (iVGA_X>=160 && iVGA_X<240)             ?                       384     :
49
                                        (iVGA_X>=240 && iVGA_X<320)             ?                       512     :
50
                                        (iVGA_X>=320 && iVGA_X<400)             ?                       640     :
51
                                        (iVGA_X>=400 && iVGA_X<480)             ?                       768     :
52
                                        (iVGA_X>=480 && iVGA_X<560)             ?                       896     :
53
                                                                                                                                1023;
54
                oBlue   <=      (iVGA_Y<60)                                             ?                       1023:
55
                                        (iVGA_Y>=60 && iVGA_Y<120)              ?                       896     :
56
                                        (iVGA_Y>=120 && iVGA_Y<180)             ?                       768     :
57
                                        (iVGA_Y>=180 && iVGA_Y<240)             ?                       640     :
58
                                        (iVGA_Y>=240 && iVGA_Y<300)             ?                       512     :
59
                                        (iVGA_Y>=300 && iVGA_Y<360)             ?                       384     :
60
                                        (iVGA_Y>=360 && iVGA_Y<420)             ?                       256     :
61
                                                                                                                                128     ;
62
        end
63
end
64
 
65
endmodule

powered by: WebSVN 2.1.0

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