⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pos_sel.vhd

📁 simple thermometr in vhdl
💻 VHD
字号:
------------------------------------------------------------------------------------ Company: -- Engineer: -- -- Create Date:    15:18:33 11/23/2007 -- Design Name: -- Module Name:    pos_sel - 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;---- Uncomment the following library declaration if instantiating---- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;entity pos_sel is    Port ( clk : in  STD_LOGIC;			  cfr1 : in  STD_LOGIC_VECTOR (3 downto 0);           cfr2 : in  STD_LOGIC_VECTOR (3 downto 0);           cfr3 : in  STD_LOGIC_VECTOR (3 downto 0);			  pixel_add : in STD_LOGIC_VECTOR (9 downto 0);           decimal : in  STD_LOGIC;           segno : in  STD_LOGIC;			  inizio : out STD_LOGIC_VECTOR (9 downto 0);			  fine : out STD_LOGIC_VECTOR (9 downto 0);           cifra : out  STD_LOGIC_VECTOR (3 downto 0));end pos_sel;architecture Behavioral of pos_sel isbeginprocess(clk)beginif(clk='1' and clk'event)thenif(conv_integer(pixel_add)< 223)theninizio <= "0011011111";end if;if(conv_integer(pixel_add)>222 and conv_integer(pixel_add)<242)theninizio <="0011011111";fine <="0011110010";if(segno = '1')thencifra <= "1010";elsecifra <="1111";end if;end if;if(conv_integer(pixel_add)>244 and conv_integer(pixel_add)<275)theninizio <="0011110101";fine <="0100010011";if(cfr1 ="0001")thencifra <= "0001";elsecifra <= "1111";end if;end if;if(conv_integer(pixel_add)>277 and conv_integer(pixel_add)<308)theninizio <="0100010110";fine <="0100110100";if(cfr1 ="0000" and cfr2="0000")thencifra <="1111";elsecifra <= cfr2;end if;end if;if(conv_integer(pixel_add)>310 and conv_integer(pixel_add)<341)theninizio <="0100110111";fine <="0101010101";cifra <= cfr3;end if;if(conv_integer(pixel_add)>343 and conv_integer(pixel_add)<352)theninizio <="0101011000";fine <="0101100000";cifra <="1011";end if;if(conv_integer(pixel_add)>354 and conv_integer(pixel_add)<385)theninizio <="0101100011";fine <="0110000001";if(decimal ='0')thencifra <="0000";elsecifra <="0101";end if;end if;if(conv_integer(pixel_add)>387 and conv_integer(pixel_add)<418)theninizio <="0110000100";fine <="0110100010";cifra <="1100";end if;if(conv_integer(pixel_add)>417)thenfine <="0110100010";end if;end if;end process;end Behavioral;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -