180 likes | 327 Views
Introduction to Experiment 5 VGA Signal Generator ECE 448 Spring 2009. Video Graphic Array (VGA). Resolution: 640x480 Display: 16 colors (4 bits), 256 colors (8 bits) Refresh Rate: 25Hz, 30Hz (frames / second) RGB: Red, Green and Blue colors Monitor technology: Cathode Ray Tube (CRT).
E N D
Introduction to Experiment 5 VGA Signal Generator ECE 448 Spring 2009
Video Graphic Array (VGA) • Resolution: 640x480 • Display: 16 colors (4 bits), 256 colors (8 bits) • Refresh Rate: 25Hz, 30Hz (frames / second) • RGB: Red, Green and Blue colors • Monitor technology: Cathode Ray Tube (CRT)
VGA Monitor 0 639 0 Horizontal Flyback Horizontal Trace Vertical Flyback 479
D/A VGA Monitor Interface Analog RGB output 6-bit digital color code for a single pixel FPGA output 64 colors board output
RC-10 Monitor Interface Use these 2 higher bits
VGA Control Signal Timing Resolution 640x480
VGA Control Signal Timing for fCLK = 48 MHz 1208 clock cycles 1253 clock cycles 1434 clock cycles 1525 clock cycles 480 lines 494 lines 496 lines 528 lines
VHDL Timing for 48MHz • Please verify that you generate correct synchronization signals using • Functional simulation • Timing simulation • Oscilloscope • before you connect your VGA output to a CRT monitor.
Pseudocode • x = 0; y = 0; • repeat forever • { • if x == 1207 then • hblank = 0; • if x == 1252 then { • hsync = 0; • if y == 479 then • vblank = 0; • if y == 493 then • vsync = 0; • if y == 495 then • vsync = 1; • if y == 527 then • vblank = 1; • if y == 527 then • y = 0; • else • y++; • } if x == 1433 then hsync = 1; if x == 1524 then hblank = 1; if x == 1524 then x = 0; else x++; if ( hblank == 0) OR (vblank == 0) then RGB = 0; else RGB = color_generator(x, y, external control); }
Pseudocode Your datapath should reflect the following pseudocode. The pseudocode is composed of sequential statements, but your circuit should perform as many independent operations in parallel as possible. x and y signals should change only at the rising edge of the clock.
Color Generator external control 12 y RGB_color_code Color Generator 10 6 x 2 bits for Red component 2 bits for Green component 2 bits for Blue component • Output can be • generated on the fly, or • read from a precomputed look-up table (stored in BRAM)
Task 1: Displaying 4 Rectangular Blocks with Different Colors Joystick left – cycle through each rectangle and background (1=>2=>3=>4=>5) Joystick right – cycle through 16 different colors of the currently active area Enter – reset to initial state
Task 2 :Expansion and shrinking of variable color rectangles Joystick left – cycle through each rectangle and background (1=>2=>3=>4=>5) Joystick right – cycle through 16 different colors of the currently active area Joystick up – increase the speed of expansion/shrinking of the rectangles Joystick down – decrease the speed of expansion/shrinking of the rectangles Enter – reset to initial state
Task 3 :Ellipse in the Middle of the Screen Ellipse equation: Joystick left – cycle between the ellipse and the background Joystick right – cycle through 16 different colors of the currently active area Enter – reset to initial state
Task 4 : Expanding and Shrinking Ellipse Joystick left – cycle between the ellipse and the background Joystick right – cycle through 16 different colors of the currently active area Joystick up – increase the speed of expansion/shrinking of the ellipse Joystick down – decrease the speed of expansion/shrinking of the ellipse Enter – reset to initial state Ellipse equation:
Task 5 : Bouncing Ellipse Joystick left – cycle between the ellipse and the background Joystick right – cycle through 16 different colors of the currently active area Joystick up – cycle through 4 bouncing speeds Joystick down – cycle through 5 modes of operation (stop, horizontal, vertical, right diagonal, left diagonal) Enter – reset to initial state