Scanning Electron Beam Deflection Yoke Electron Gun

Grid

Phosphor Screen

Blue

Electron Guns
Red Green

Metal Mask

R B R G

B R B

G B G

R G R

B R B

G B G

R G R B

Phosphor Dots on Glass Face Plate

Glass Face Plate

Figure 10.1 Color CRT and Phosphor Dots on Face of Display.

640 Pixels in a row 0,0 639,0

480 Horizontal Scan Lines and Retrace
. . .

480 Pixels in a column

0,479

639,479

Figure 10.2 VGA Image - 640 by 480 Pixel Layout.

3 Vertical Sync Signal Timing. . Green.35 ms Figure 10.480 Horizontal Refresh Cycles Red.24 ms 0. Blue P i x e l D a ta Vertical Sync 64 µs 16.6 ms 1.02 ms 15.

R ed.17 µs 0. Green.4 Horizontal Sync Signal Timing.94 µs 31.77 µs Figure 10. .89 µs 25.77µs 1. B lu e P i xe l D a ta Horizontal Sync 3.

5 CLPD based generation of VGA Video Signals. .25 M hz C lo c k S y n c G e n e r a tio n C o u n te rs R ow C ol H o r iz o n t a l S ync V e r t ic a l S ync D a ta fr o m D e s ig n V G A S ig n a ls P ix e l R A M o r C h a ra c te r G e n e ra to r R O M R G B Figure 10.

VGA_SYNC clock_48Mhz red green blue red_out green_out blue_out horiz_sync_out vert_sync_out video_on pixel_clock pixel_row[9...0] inst UP3core VGA_SYNC .0] pixel_column[9.

vert_sync SIGNAL video_on. STD_LOGIC. vert_sync_out pixel_row.ALL. ENTITY VGA_SYNC IS PORT( clock_25Mhz. pixel_column END VGA_SYNC. PROCESS BEGIN WAIT UNTIL( clock_25Mhz'EVENT ) AND ( clock_25Mhz = '1' ). video_on_v.STD_LOGIC_1164.LIBRARY IEEE. video_on_h : STD_LOGIC.ALL. : IN : OUT : OUT : OUT STD_LOGIC. USE IEEE. STD_LOGIC_VECTOR( 9 DOWNTO 0 )).STD_LOGIC_UNSIGNED. green_out.ALL. red. SIGNAL horiz_sync. SIGNAL h_count. . STD_LOGIC. blue red_out. ARCHITECTURE a OF VGA_SYNC IS : STD_LOGIC.video_on is High only when RGB data is displayed video_on <= video_on_H AND video_on_V. green.STD_LOGIC_ARITH. : STD_LOGIC_VECTOR( 9 DOWNTO 0 ). blue_out horiz_sync_out. v_count BEGIN -. USE IEEE. USE IEEE.

END IF.H_count 0 640 659 755 799 -IF ( h_count = 799 ) THEN h_count <= "0000000000".H_count counts pixels (640 + extra time for sync signals) --. . --Generate Horizontal Sync Signal using H_count IF ( h_count <= 755 ) AND (h_count => 659 ) THEN horiz_sync <= '0'.--Generate Horizontal and Vertical Timing Signals for Video Signal -. ELSE horiz_sync <= '1'. ELSE h_count <= h_count + 1. END IF.Horiz_sync -------------------------------------------________--------.

END IF.--V_count counts rows of pixels (480 + extra time for sync signals) --.V_count 0 480 493-494 524 -IF ( v_count >= 524 ) AND ( h_count => 699 ) THEN v_count <= "0000000000". .Generate Vertical Sync Signal using V_count IF ( v_count <= 494 ) AND ( v_count = >493 ) THEN vert_sync <= '0'. END IF. -. ELSE vert_sync <= '1'.Vert_sync ----------------------------------------_______------------. ELSIF ( h_count = 699 ) THEN v_count <= v_count + 1.

IF ( v_count <= 479 ) THEN video_on_v <= '1'.Put all video signals through DFFs to eliminate -. blue_out <= blue AND video_on. vert_sync_out <= vert_sync. END IF. END a. END PROCESS. .any delays that can cause a blurry image -. -. horiz_sync_out <= horiz_sync.Turn off RGB outputs when outside video display area red_out <= red AND video_on. ELSE video_on_h <= '0'. ELSE video_on_v <= '0'. green_out <= green AND video_on.Generate Video on Screen Signals for Pixel Data IF ( h_count <= 639 ) THEN video_on_h <= '1'.-. END IF. pixel_column <= h_count. pixel_row <= v_count.

0] pixel_column[9..0] OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT VGA_R ed VGA_Green VGA_Blue VGA_H Sync VGA_VSync GND 11 1 Video LED Design Example .VGA_SYNC C lock_48M hz P BSW ITC H 4 INPUT VCC INPUT VCC clock_48Mhz red green blue red_out green_out blue_out horiz_sync_out vert_sync_out video_on pixel_clock pixel_row[9..

0] Video Color Bar Design Example ..VGA_SYNC Clock_48Mhz INPUT VCC clock_48Mhz red green blue red_out green_out blue_out horiz_sync_out vert_sync_out video_on pixel_clock OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT VGA_Red VGA_Green VGA_Blue VGA_HSync VGA_VSync Pixel_column[5] Pixel_column[6] Pixel_column[7] 1 Pixel_row[9.0] pixel_row[9..0] Pixel_column[9.0] pixel_column[9...

01100110 .Address 000001000 : 000001001 : 000001010 : 000001011 : 000001100 : 000001101 : 000001110 : 000001111 : Font Data 00011000 . Figure 10. 00000000 . . 01111110 . 01100110 . 01100110 .6 Font Memory Data for the Character "A". 01100110 . 00111100 .

8 by 8 Font Pixel Data Character Address 000001 for A 6 Character Generation ROM 64 characters 512 by 8 ROM 8 3 Font Row Address 000. ...7 Accessing a Character Font Using a ROM.111 8 8-bit words per character Figure 10.

.0] rom_mux_output inst UP3core CHAR_ROM .0] f ont_row[2..Char_ROM clock character_address[5..0] f ont_col[2.

END a. -.Mux to pick off correct rom data bit from 8-bit word -.lpm_components.ALL. lpm_width => 8) PORT MAP ( address => rom_address.for on screen character generation rom_mux_output <= rom_data ( (CONV_INTEGER( NOT font_col( 2 DOWNTO 0 ))) ). : IN : IN : OUT STD_LOGIC_VECTOR( 5 DOWNTO 0 ). font_col rom_mux_output END Char_ROM.ALL. LIBRARY lpm.ALL. lpm_address_control => "UNREGISTERED".Each character is 8 8-bit words of pixel data char_gen_rom: lpm_rom GENERIC MAP ( lpm_widthad => 9. STD_LOGIC_VECTOR( 2 DOWNTO 0 ). lpm_outdata => "UNREGISTERED".Reads in mif file for character generator font data lpm_file => "tcgrom. ARCHITECTURE a OF Char_ROM IS : STD_LOGIC_VECTOR( 7 DOWNTO 0 ).ALL.STD_LOGIC_UNSIGNED.Small 8 by 8 Character Generator ROM for Video Display -. ENTITY Char_ROM IS character_address PORT( font_row. USE IEEE. lpm_numwords => "512".LIBRARY IEEE.mif".STD_LOGIC_ARITH. .STD_LOGIC_1164. USE IEEE. USE lpm. SIGNAL rom_data : STD_LOGIC_VECTOR( 8 DOWNTO 0 ). SIGNAL rom_address BEGIN -. -. q = > rom_data). rom_address <= character_address & font_row. USE IEEE. STD_LOGIC).

Table 10. / 40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57 0 1 2 3 4 5 6 7 8 9 A B C D E F 60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77 .1 Character Address Map for 8 by 8 Font ROM. . CHAR ADDRESS CHAR ADDRESS CHAR ADDRESS CHAR ADDRESS @ A B C D E F G H I J K L M N O 00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17 P Q R S T U V W X Y Z [ Dn Arrow ] Up Arrow Lft Arrow 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 Space ! " # $ % & ‘ ( ) * + .

1] rom_mux_output character_address[5...0] OUTPUT OUTPUT OUTPUT VGA_Red VGA_Green VGA_Blue OUTPUT OUTPUT VGA_HSync VGA_VSync Pixel_row[9.0] inst Character Test Design Example ..0] 1 Pixel_column[9..0] f ont_col[2..0] pixel_column[9.0] Char_ROM clock Pixel_row[9.0] f ont_row[2.4] Pixel_row[3...VGA_SYNC Clock_48Mhz VCC INPUT VCC clock_48Mhz red green blue red_out green_out blue_out horiz_sync_out vert_sync_out video_on pixel_clock pixel_row[9.1] Pixel_column[3....

Figure 10. .8 MIPS Computer Video Output.

mif". => "UNREGISTERED".Reads in mif file for data display titles =>"format.Character Format ROM for Video Display -.Displays constant format character data -.on left side of Display area format_rom: lpm_rom GENERIC MAP ( lpm_widthad lpm_numwords lpm_outdata lpm_address_control lpm_file lpm_width => 6. =>"60". => "UNREGISTERED". => 6) . -.-.

9 Display and Compute clock cycles available in a single Video Frame. .0 Horizontal Sync Counter 639 Compute New RGB Data 799 Displaying RGB Data 479 599 Vertical Sync Counter Figure 10.

Figure 10.10 Bouncing Ball Video Output. .

: STD_LOGIC_VECTOR( 9 DOWNTO 0 ).Turn off Green and Blue to make -. END ball. -.ENTITY ball IS PORT( : OUT STD_LOGIC. Ball_on. Blue : IN STD_LOGIC. Blue <= NOT Ball_on. SIGNAL vert_sync_out SIGNAL pixel_row. ARCHITECTURE behavior OF ball IS -.color Red when displaying ball Green <= NOT Ball_on. -. SIGNAL Size : STD_LOGIC_VECTOR( 10 DOWNTO 0 ).Video Display Signals SIGNAL reset.Ball center X address Ball_X_pos <= CONV_STD_LOGIC_VECTOR( 320. -.Size of Ball BEGIN Size <= CONV_STD_LOGIC_VECTOR (8.11 ). pixel_column : IN STD_LOGIC_VECTOR( 9 DOWNTO 0 )). SIGNAL Red. Green.Colors for pixel data on video signal Red <= '1'. .10 ). -. Direction : STD_LOGIC. SIGNAL Ball_Y_motion SIGNAL Ball_Y_pos. Ball_X_pos : STD_LOGIC_VECTOR( 10 DOWNTO 0 ).

pixel_row. ELSE Ball_on <= '0'.11).Set Ball_on = '1' to display ball <= pixel_column + Size ) AND IF ( Ball_X_pos ( Ball_X_pos + Size >= pixel_column ) AND ( Ball_Y_pos <= pixel_row + Size ) AND ( Ball_Y_pos + Size >= pixel_row ) THEN Ball_on <= '1'.Compute next ball Y position Ball_Y_pos <= Ball_Y_pos + Ball_Y_motion.11). pixel_column.RGB_Display: PROCESS ( Ball_X_pos. ELSIF Ball_Y_pos <= Size THEN Ball_Y_motion <= CONV_STD_LOGIC_VECTOR(2. Ball_Y_pos. END PROCESS Move_Ball. -.CONV_STD_LOGIC_VECTOR(2.Bounce off top or bottom of screen IF Ball_Y_pos >= 480 .Move ball once every vertical sync WAIT UNTIL Vert_sync'EVENT AND Vert_sync = '1'. END behavior. . Size ) BEGIN -.Size THEN Ball_Y_motion <= . END PROCESS RGB_Display. END IF. -. Move_Ball: PROCESS BEGIN -. END IF.

Sign up to vote on this title
UsefulNot useful