Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module VGA_Draw(CLOCK_50, line, pegColours, VGA_CLK,                       
  2.     VGA_HS,                        
  3.     VGA_VS,    
  4.     VGA_BLANK_N,                                                    VGA BLANK
  5.     VGA_SYNC_N,                    
  6.     VGA_R,                         
  7.     VGA_G,                         
  8.     VGA_B                      
  9.     );
  10.  
  11.     localparam line1y = 8'd4, line2y = 8'd12, line3y = 8'd20, line4y = 8'd28, line5y = 8'd36, line6y = 8'd44, line7y = 8'd52, line8y = 8'd60;
  12.     localparam line1x = 7'd20, line2x = 7'd28, line3x = 7'd36, line4x = 7'd44;
  13.     input [7:0] pegColours;
  14.     input [3:0] line;
  15.     input CLOCK_50;
  16.     output  VGA_CLK;               
  17.     output  VGA_HS;                
  18.     output  VGA_VS;                
  19.     output  VGA_BLANK_N;               
  20.     output  VGA_SYNC_N;            
  21.     output  [9:0]   VGA_R;                 
  22.     output  [9:0]   VGA_G;                 
  23.     output  [9:0]   VGA_B;  
  24.    
  25.     reg [8:0] currY;
  26.     always @(*)
  27.     begin
  28.         case (line[3:0])
  29.             3'b000: currY <= line1y;
  30.             3'b001: currY <= line2y;
  31.             3'b010: currY <= line3y;
  32.             3'b011: currY <= line4y;
  33.             3'b100: currY <= line5y;
  34.             3'b101: currY <= line6y;
  35.             3'b110: currY <= line7y;
  36.             3'b111: currY <= line8y;
  37.         endcase
  38.     end
  39.    
  40.     //ROW N
  41.     VGA_Control L1C1(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[7:6]),
  42.             .yCoord(currY), .xCoord(line1x), .VGA_ClK(VGA_CLK),
  43.             .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
  44.             .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
  45.             .VGA_B(VGA_B));
  46.  
  47.     VGA_Control L1C2(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[5:4]),
  48.             .yCoord(currY), .xCoord(line2x), .VGA_ClK(VGA_CLK),
  49.             .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
  50.             .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
  51.             .VGA_B(VGA_B));
  52.  
  53.     VGA_Control L1C3(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[3:2]),
  54.             .yCoord(currY), .xCoord(line3x), .VGA_ClK(VGA_CLK),
  55.             .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
  56.             .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
  57.             .VGA_B(VGA_B));
  58.  
  59.     VGA_Control L1C4(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[1:0]),
  60.             .yCoord(currY), .xCoord(line4x), .VGA_ClK(VGA_CLK),
  61.             .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
  62.             .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
  63.             .VGA_B(VGA_B));
  64. endmodule;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement