📄 square_v01_00_02.vhd
字号:
------------------------------------------------------------------------------------ Company: SANDEEPANI - Bangalore-- Engineer: PRAVEEN FELIX-- -- Create Date: 15:10:20 09/01/2008 -- Design Name: Geometric Square-- Module Name: square - Behavioral -- Project Name: Moving Geometric Objects on VGA monitor-- Target Devices: XILINX Spartan 3 Starter Kit xc3s200-4ft256-- Tool versions: XILINX ISE Project Navigator 9.2.04i, MENTOR GRAPHICS ModelSim SE 6.2f -- Description: Generates a geometric Square---- Dependencies: ---- Revision: v01_00_00 / v01_00_02-- 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;-- including VGA_GEOMETRY_PACKAGEuse WORK.MY_PACK.ALL;---- Uncomment the following library declaration if instantiating---- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;entity square_v01_00_02 is Port ( pixel_row : in STD_LOGIC_VECTOR (9 downto 0); -- Display pixel row pixel_column : in STD_LOGIC_VECTOR (9 downto 0); -- Display pixel column updown : in STD_LOGIC_VECTOR (9 downto 0); -- UP-DOWN Movement factor leftright : in STD_LOGIC_VECTOR (9 downto 0); -- LEFT-RIGHT Movement factor square : out STD_LOGIC; -- Square out a_side : out STD_LOGIC_VECTOR (9 downto 0); -- a side of square frame b_side : out STD_LOGIC_VECTOR (9 downto 0); -- b side of square frame c_side : out STD_LOGIC_VECTOR (9 downto 0); -- c side of square frame d_side : out STD_LOGIC_VECTOR (9 downto 0) -- d side of square frame );end square_v01_00_02;architecture Behavioral of square_v01_00_02 is -- Internal Signal Description---------------------------------------------- -- A Frame which can hold a square is shown below with its boundaries marked -- a arow - Upper bar of the frame -- -------- bcolumn - Left bar of the frame -- | | crow - Lower bar of the frame -- b| |d dcolumn - Right bar of the frame -- | | -- -------- -- c signal arow, bcolumn, crow, dcolumn : STD_LOGIC_VECTOR (9 downto 0); -- Four boundaries of the sqaure framebegin -- Boundary calculation arow <= updown; -- Upper bar bcolumn <= leftright; -- Left bar crow <= conv_std_logic_vector(SQUARE_HT-1,10) + updown; -- Lower bar dcolumn <= conv_std_logic_vector(SQUARE_LEN-1,10) + leftright; -- Right bar -- Output square <= '1' when pixel_row >= arow and pixel_row <= crow and pixel_column >= bcolumn and pixel_column <= dcolumn else '0'; a_side <= arow; b_side <= bcolumn; c_side <= crow; d_side <= dcolumn;end Behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -