Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
5Activity
0 of .
Results for:
No results containing your search query
P. 1
VGA

VGA

Ratings:

4.83

(1)
|Views: 819|Likes:
Published by muhammad
how to print an image on the screen using FPGA
how to print an image on the screen using FPGA

More info:

Published by: muhammad on Dec 30, 2008
Copyright:Public Domain

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC or read online from Scribd
See more
See less

12/11/2012

 
How to show a picture on VGA using FPGAI will not talk too much about how to turn the VGA on using FPGA. You can findmore details about that in any FPGA prototyping book. I want to discuss how youtake an image and print it on the screen.First, you have to know that any image represented in 3 matrixes of pixels - Thegreen, red and blue matrix. You can send those matrixes via RS232 to the FPGA andthen print your image. But I will use a simple method. Just get the matrix value usingMATLAB and put it as an array in the VHDL code.What shall we do?Simply read an image using MATLAB. Then, we get the values of the matrixes. And because of synthesis time, we will choose the green matrix only to be shown. so youhave to get the value of the matrix . Now, the array in the VHDL code should be written in somehow. We have to make aM-file to generate the values of the matrix in the same way that we need, so that wewill just copy it and put the values in the VHDL code. Now, download the code and have fun!!!
In the VHDL code we take the pixels and show it pixel by pixel. Just notice the matrixlength to do it correctly.How can you show the color image?Well, we showed the green only. But this is not a problem. You have to put the red and blue matrix. And give the red and blue terminals (pin) the values of the pixels. In our code we put the blue and red as 0Ok,here is the code. Don't be afraid we just generate the matrix with MATLAB. Sowe just took a copy.
 
------------------------------------------------------------------------------------ Company:-- Engineer:---- Create Date: 15:40:42 12/08/2008-- Design Name:-- Module Name: Sync_XY_generator - Behavioral-- Project Name:-- Target Devices:-- Tool versions:-- Description:---- Dependencies:---- Revision:-- Revision 0.01 - File Created-- Additional Comments:------------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;use ieee.numeric_std.all;use std.textio.all;---- Uncomment the following library declaration if instantiating---- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;entity Sync isPort ( CLK50_in : in STD_LOGIC;HS : out STD_LOGIC;VS : out STD_LOGIC;r,g,b : out std_logic_vector(3 downto 0));end Sync;architecture Behavioral of Sync is------- signals declarationssubtype tmp is integer;type memory_array is array(integer range 0 to 138,integer range 0 to149) of tmp;signal mem : memory_array:= (( 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,0,0,0,0,0,0,0,2,6,8,9,19,22,14,4,1,9,1,0,0,0,0,8,29,48,43,32,25,26,25,13,0,1,2,17,34,31,10
 
,2,5,0,14,24,19,5,0,0,1,1,5,2,0,3,2,0,5,2,2,3,6,17,34,56,72,99,91,63,22,4,4,12,19,28,38,46,45,46,49,49,45,40,47,46,31,13,11,24,38,39,26,14,15,29,38,38,33,34,19,17,23,30,48,63,59,46,35,15,4,1,0,4,28,51,77,56,23,21,58,99,95,72,51,8,13,5,6),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,2,0,0,0,0,0,0,0,2,7,7,8,17,21,14,5,1,0,0,0,4,0,0,12,33,42,41,33,22,15,13,7,0,0,0,4,15,14,4,2,4,12,19,22,15,4,0,1,0,1,7,2,0,0,0,0,0,10,3,2,3,10,22,37,47,64,65,51,21,3,3,4,6,19,27,31,28,28,31,32,30,20,27,34,31,21,17,19,22,40,33,26,29,39,43,39,32,31,19,21,28,32,45,56,50,40,33,18,5,0,0,13,46,84,101,81,55,36,45,80,88,71,55,31,42,7,8),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,1,0,0,0,0,0,0,0,0,0,1,8,5,6,14,20,16,6,1,8,9,11,10,1,0,12,34,33,39,33,19,7,3,4,4,1,1,1,1,7,12,13,11,8,12,9,4,0,0,2,1,1,4,1,1,1,1,3,13,29,14,2,1,7,12,15,20,33,41,37,18,1,1,0,1,7,9,10,6,6,9,12,13,6,10,16,20,18,15,12,11,37,37,38,43,47,49,44,38,34,26,29,34,32,37,40,32,23,22,13,2,2,3,25,65,92,113,115,112,88,69,90,103,107,62,61,102,54,18),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,0,0,0,0,1,5,4,3,9,17,17,9,2,26,28,33,34,26,18,20,31,31,38,37,23,10,4,5,7,1,3,3,7,19,32,31,20,5,9,9,3,0,1,3,5,1,1,2,2,3,4,9,24,34,15,0,3,12,15,16,17,23,28,25,10,0,0,4,7,6,6,3,3,3,4,4,6,9,6,3,4,4,5,10,18,35,40,45,49,52,54,53,51,44,35,35,35,27,28,28,19,9,12,6,3,2,6,33,73,97,121,133,141,120,93,101,106,95,94,116,142,88,31),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,0,0,0,0,1,2,1,5,12,16,13,5,12,20,36,52,56,49,39,34,35,41,41,30,17,10,4,2,1,4,9,16,29,41,32,13,14,21,23,14,2,1,1,1,2,4,2,2,1,1,0,19,28,7,0,2,12,16,19,23,17,18,12,3,0,0,5,10,16,12,7,5,2,2,3,4,8,4,1,1,1,1,11,31,47,52,55,55,56,59,63,65,47,33,30,28,22,24,27,21,8,10,3,3,8,11,28,59,105,127,129,126,107,86,82,68,41,146,194,170,133,101),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,1,1,0,2,7,13,13,8,6,6,12,23,33,38,37,35,33,39,40,31,19,10,3,1,1,2,6,14,26,31,18,1,5,15,20,12,1,1,0,1,1,2,1,1,0,1,4,26,33,12,0,1,4,2,4,12,14,10,3,1,0,1,3,3,15,11,7,6,4,0,0,0,0,0,1,3,1,1,14,39,65,71,71,69,67,69,72,75,43,26,18,16,14,23,31,27,7,6,2,2,6,5,9,31,63,95,106,113,107,86,65,25,15,118,170,173,197,176),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,6,0,0,0,2,1,0,0,0,0,0,0,0,0,0,1,3,3,0,1,7,9,7,14,7,0,1,1,7,15,19,17,25,29,22,11,5,2,0,4,0,0,5,17,20,13,4,0,0,3,1,0,0,2,1,0,0,0,1,5,2,10,35,33,14,3,4,2,2,3,18,34,21,6,1,2,2,0,0,3,1,1,8,10,5,0,0,0,0,0,6,2,1,12,36,74,81,84,85,83,82,81,78,52,28,12,7,6,16,22,15,2,1,0,0,1,2,7,17,24,57,78,103,108,88,58,15,7,31,65,116,173,139),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,11,3,0,1,2,0,0,0,0,0,0,0,0,0,0,1,5,6,0,0,2,6,4,7,8,7,3,0,1,1,0,0,8,17,11,1,1,5,10,12,2,0,1,12,19,20,20,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,24,15,3,1,5,8,8,25,48,63,39,14,1,1,2,1,0,1,0,2,16,23,20,15,14,2,0,0,3,1,2,9,32,71,82,89,94,96,92,86,79,66,37,15,5,1,5,6,0,0,3,0,1,5,2,6,25,38,54,61,81,87,67,49,18,5,3,31,65,88,57),(5,0,0,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,1,1,7,4,0,0,2,1,16,5,0,1,0,0,2,0,12,18,9,0,0,0,7,17,8,1,0,1,5,13,23,2,3,0,0,0,0,0,1,0,0,0,0,0,0,0,2,1,3,0,5,3,15,48,50,66,38,8,6,8,0,0,0,2,10,1,9,46,57,38,30,20,0,0,5,6,3,5,31,68,77,90,101,100,87,83,88,72,39,11,5,7,2,0,0,1,0,0,2,0,2,19,51,74,74,70,64,60,56,40,23,4,1,6,94,115,58

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Sasha Rosca liked this
gabymour liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->