亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cpu.vhd

?? 32位元浮點CPU,用VHDL語言以類似組合語言的方式寫成
?? VHD
字號:
package commonConstants is	constant wordSize: integer := 32;	constant adrLength: integer := 16;end package commonConstants;library IEEE;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;use work.commonConstants.all;entity ram is port (        reset, en, r_w: in STD_LOGIC;        aBus: in STD_LOGIC_VECTOR(adrLength-1 downto 0);        dBus: inout STD_LOGIC_VECTOR(wordSize-1 downto 0));end ram;architecture ramArch of ram isconstant resAdrLength: integer := 6; -- address length restricted within architectureconstant memSize: integer := 2**resAdrLength;type ram_typ is array(0 to memSize-1) of STD_LOGIC_VECTOR(wordSize-1 downto 0);signal ram: ram_typ;begin	process(reset, en, r_w, aBus, dBus) begin	  	if reset = '1' then		      	-- basic instruction check	        	ram(0)  <= x"00002005"; -- direct load			     ram(1)  <= x"00000001"; -- negate		        ram(2)  <= x"00004004"; -- direct store		        ram(3)  <= x"00000000"; -- halt		        ram(5)  <= x"4009999A"; -- X = 4009999A(01000000000010011001100110011010)		elsif en = '1' and r_w = '0' then	  		ram(conv_integer(unsigned(aBus(resAdrLength-1 downto 0)))) <= dBus;		end if;	end process;	dBus <= ram(conv_integer(unsigned(aBus(resAdrLength-1 downto 0))))  			when reset = '0' and en = '1' and r_w = '1' else			(dbus'range => 'Z');end ramArch;---------------------------------------------------------library IEEE;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;use IEEE.std_logic_unsigned.all;use work.commonConstants.all;entity cpu is port (    	clk, reset 	: in  std_logic;    	m_en, m_rw	: out std_logic;    		aBus		: out std_logic_vector(adrLength-1 downto 0);	dBus		: inout std_logic_vector(wordSize-1 downto 0);	-- these signals "exported" so they can be monitored in post-P&R simulation	pcX, iarX	: out std_logic_vector(adrLength-1 downto 0);	iregX, accX, aluX	: out std_logic_vector(wordSize-1 downto 0));end cpu;architecture cpuArch of cpu istype state_type is (	reset_state, fetch, halt, negate, mload, dload, iload,	dstore, istore, branch, brZero, brPos, brNeg, add);signal state: state_type;type tick_type is (t0, t1, t2, t3, t4, t5, t6, t7);signal tick: tick_type;signal pc: 	std_logic_vector(adrLength-1 downto 0); -- program countersignal iReg: 	std_logic_vector(wordSize-1 downto 0); -- instruction registersignal iar: 	std_logic_vector(adrLength-1 downto 0); -- indirect address registersignal acc: 	std_logic_vector(wordSize-1 downto 0); -- accumulatorsignal alu: 	std_logic_vector(wordSize-1 downto 0); -- alu outputbegin	alu <= 	(not acc) + x"00000001" when state = negate else				acc + dbus when state = add else				(alu'range => '0');	pcX <= pc; iregX <= ireg; iarX <= iar; accX <= acc; aluX <= alu;	process(clk) -- perform actions that occur on rising clock edges	function nextTick(tick: tick_type) return tick_type is begin		-- return next logical value for tick		case tick is		when t0 => return t1; when t1 => return t2; when t2 => return t3;		when t3 => return t4; when t4 => return t5; when t5 => return t6;		when t6 => return t7; when others => return t0;		end case;	end function nextTick;	procedure decode is begin		-- Instruction decoding.		case iReg(15 downto 12) is		when x"0" =>			if iReg(11 downto 0) = x"000" then 				state <= halt;			elsif iReg(11 downto 0) = x"001" then 				state <= negate;			end if;		when x"1" => 	state <= mload;		when x"2" => 	state <= dload;		when x"3" => 	state <= iload;		when x"4" => 	state <= dstore;		when x"5" => 	state <= istore;		when x"6" => 	state <= branch;		when x"7" => 	state <= brZero;			when x"8" => 	state <= brPos;		when x"9" => 	state <= brNeg;		when x"a" => 	state <= add;		when others => state <= halt;		end case;	end procedure decode;  	procedure wrapup is begin		-- Do this at end of every instruction		state <= fetch; tick <= t0;	end procedure wrapup;	begin	  	if clk'event and clk = '1' then	  		if reset = '1' then 				state <= reset_state; tick <= t0;				pc <= (pc'range => '0'); iReg <= (iReg'range => '0');				acc <= (acc'range => '0'); iar <= (iar'range => '0');    			else				tick <= nextTick(tick) ; -- advance time by default				case state is				when reset_state => state <= fetch; tick <= t0;				when fetch => 	if tick = t1 then iReg <= dBus; end if;									if tick = t2 then 										decode; pc <= pc + '1'; tick <= t0;									end if;				when halt => tick <= t0; -- do nothing				when negate => acc <= alu;	wrapup;				-- load instructions				when mload => 					if iReg(11) = '0' then -- sign extension						acc <= x"00000" & ireg(11 downto 0); 					else						acc <= x"0000f" & ireg(11 downto 0);					end if;					wrapup;				when dload =>					if tick = t1 then acc <= dBus; end if;					if tick = t2 then wrapup; end if;				when iload =>					if tick = t1 then iar <= dBus(15 downto 0); end if;   --some problems					if tick = t4 then acc <= dBus; end if;					if tick = t5 then wrapup; end if;				-- store instructions			  					when dstore =>					if tick = t4 then wrapup; end if;				when istore =>					if tick = t1 then iar <= dBus(15 downto 0); end if;   --some problems					if tick = t7 then wrapup; end if;				-- branch instructions				when branch => 					pc <= x"0" & iReg(11 downto 0);					wrapup;				when brZero => 					if acc = x"0000" then pc <= x"0" & iReg(11 downto 0);	end if;					wrapup;				when brPos => 					if acc(15) = '0' and acc /= x"0000" then 						pc <= x"0" & iReg(11 downto 0);					end if;					wrapup;				when brNeg => 					if acc(15) = '1' then pc <= x"0" & iReg(11 downto 0);	end if;					wrapup;				-- arithmetic instructions				when add =>					if tick = t1 then acc <= alu; end if;					if tick = t2 then wrapup; end if;				when others => state <= halt;				end case;			end if;  		end if;	end process;	process(clk) begin -- perform actions that occur on falling clock edges		if clk'event and clk ='0' then			if reset = '1' then				m_en <= '0'; m_rw <= '1';				aBus <= (aBus'range => '0'); dBus <= (dBus'range => 'Z');			else				case state is				when fetch =>					if tick = t0 then m_en <= '1'; aBus <= pc; end if;					if tick = t2 then m_en <= '0'; aBus <= (aBus'range => '0'); end if;			  	when dload =>					if tick = t0 then m_en <= '1'; aBus <= x"0" & iReg(11 downto 0); end if;					if tick = t2 then m_en <= '0'; aBus <= (aBus'range => '0'); end if;			  	when iload =>					if tick = t0 then m_en <= '1'; aBus <= x"0" & iReg(11 downto 0); end if;					if tick = t2 then m_en <= '0'; aBus <= (aBus'range => '0'); end if;					if tick = t3 then m_en <= '1'; aBus <= iar; end if;					if tick = t5 then m_en <= '0'; aBus <= (abus'range => '0'); end if;								  	when dstore =>					if tick = t0 then m_en <= '1'; aBus <= x"0" & iReg(11 downto 0); end if;					if tick = t1 then m_rw <= '0'; dBus <= acc; end if;					if tick = t3 then m_rw <= '1'; end if;					if tick = t4 then 						m_en <= '0'; aBus <= (abus'range => '0'); dBus <= (dBus'range => 'Z'); 					end if;				when istore =>					if tick = t0 then m_en <= '1'; aBus <= x"0" & iReg(11 downto 0); end if;					if tick = t2 then m_en <= '0'; aBus <= (aBus'range => '0'); end if;					if tick = t3 then m_en <= '1'; aBus <= iar; end if;					if tick = t4 then m_rw <= '0'; dBus <= acc; end if;					if tick = t6 then m_rw <= '1'; end if;					if tick = t7 then 						m_en <= '0'; aBus <= (abus'range => '0'); dBus <= (dBus'range => 'Z'); 					end if;				when add =>					if tick = t0 then m_en <= '1'; aBus <= x"0" & iReg(11 downto 0); end if;					if tick = t2 then m_en <= '0'; aBus <= (aBus'range => '0'); end if;				when others => -- do nothing				end case;			end if;			end if;						end process;end cpuArch;-------------------------------library IEEE;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;use work.commonConstants.all;entity top is port(	clk, reset: in STD_LOGIC;	mem_enX, mem_rwX : out std_logic;	aBusX : out std_logic_vector(adrLength-1 downto 0);	dBusX : out std_logic_vector(wordSize-1 downto 0);	pcX, iarX : out std_logic_vector(adrLength-1 downto 0);	iregX, accX, aluX : out std_logic_vector(wordSize-1 downto 0));end top;architecture topArch of top iscomponent ram port (        reset, en, r_w: in STD_LOGIC;        aBus: in STD_LOGIC_VECTOR(adrLength-1 downto 0);        dBus: inout STD_LOGIC_VECTOR(wordSize-1 downto 0));end component;component cpu port (    	clk, reset:	in  STD_LOGIC;    	m_en, m_rw: out STD_LOGIC;    		aBus:	out STD_LOGIC_VECTOR(adrLength-1 downto 0);	dBus:	inout STD_LOGIC_VECTOR(wordSize-1 downto 0);	pcX, iarX : out std_logic_vector(adrLength-1 downto 0);	iregX, accX, aluX : out std_logic_vector(wordSize-1 downto 0));end component;signal mem_en, mem_rw: STD_LOGIC;signal aBus, pc, iar: STD_LOGIC_VECTOR(adrLength-1 downto 0);signal dBus, ireg, acc, alu: std_logic_vector(wordSize-1 downto 0);begin	ramC: ram port map(reset, mem_en, mem_rw, aBus, dBus);	cpuC: cpu port map(clk, reset, mem_en, mem_rw, aBus, dBus,			pc, iar, ireg, acc, alu);	mem_enX <= mem_en; mem_rwX <= mem_rw;	aBusX <= aBus; dBusX <= dBus;	pcX <= pc; iregX <= ireg; iarX <= iar; accX <= acc; aluX <= alu;end topArch;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区在线观看视频| 成人黄色777网| 国产在线精品免费av| 91免费版在线| 久久综合九色综合97_久久久| 成人欧美一区二区三区在线播放| 日韩 欧美一区二区三区| 成人福利视频在线| 日韩欧美一级在线播放| 亚洲精品日韩综合观看成人91| 久久99热国产| 欧美综合久久久| 国产精品嫩草影院com| 蜜臀av一区二区在线观看| 在线观看日韩一区| 日本一区二区三区久久久久久久久不| 日韩av一区二区三区| 99久久99久久免费精品蜜臀| 精品国产制服丝袜高跟| 亚洲r级在线视频| 色综合天天综合给合国产| 国产亚洲欧美色| 激情深爱一区二区| 日韩丝袜美女视频| 午夜不卡在线视频| 精品婷婷伊人一区三区三| 一区二区三区四区不卡在线 | 日本精品裸体写真集在线观看| 久久午夜羞羞影院免费观看| 日日摸夜夜添夜夜添亚洲女人| 欧美视频在线观看一区二区| 亚洲精品欧美综合四区| 91丨porny丨国产| 亚洲欧美aⅴ...| 91浏览器在线视频| 亚洲男人的天堂在线观看| 91在线免费播放| 亚洲综合一二三区| 欧美日韩中文一区| 青青草成人在线观看| 欧美一区二区大片| 国产在线不卡一区| 日本一区二区成人| 91麻豆国产福利精品| 亚洲午夜精品久久久久久久久| 91丨porny丨首页| 午夜亚洲福利老司机| 色欧美日韩亚洲| 久久夜色精品一区| 天堂在线一区二区| 欧美日韩一区二区三区高清| 秋霞成人午夜伦在线观看| 欧美精品粉嫩高潮一区二区| 日本欧洲一区二区| 日韩女优视频免费观看| 极品少妇一区二区三区精品视频| 欧美一卡二卡在线| 成人激情小说网站| 日韩毛片在线免费观看| 欧美三级日本三级少妇99| 亚洲高清视频的网址| 欧美一区二区视频在线观看2022| 日韩 欧美一区二区三区| 欧美疯狂性受xxxxx喷水图片| 免费在线看成人av| 欧美精三区欧美精三区| 国产精品综合一区二区三区| 国产喂奶挤奶一区二区三区| 一本久道中文字幕精品亚洲嫩 | 日韩一二三区不卡| 久久99精品国产麻豆婷婷洗澡| 久久久久久久久免费| www.日韩在线| 肉肉av福利一精品导航| 久久综合成人精品亚洲另类欧美 | 午夜精品免费在线| 日韩一区二区三区视频在线观看| 男人操女人的视频在线观看欧美| 久久精品人人做人人综合| 国产福利一区在线| 一区二区三区在线观看视频| 日韩一级黄色片| 91在线观看地址| 久久国产精品露脸对白| 亚洲综合小说图片| 精品福利一区二区三区| 欧美日韩国产美女| 国产成人综合在线播放| 全部av―极品视觉盛宴亚洲| 国产精品视频一区二区三区不卡| 日韩欧美成人一区| 色吊一区二区三区| 成人白浆超碰人人人人| 五月婷婷综合在线| 日韩一区中文字幕| 欧美精品三级日韩久久| www.欧美.com| 久久66热re国产| 亚洲人午夜精品天堂一二香蕉| 欧美疯狂性受xxxxx喷水图片| 在线国产亚洲欧美| 国产日韩精品一区| 久久久精品2019中文字幕之3| 色婷婷综合中文久久一本| 成人黄页在线观看| 久久精品国产精品亚洲精品 | 51精品视频一区二区三区| 91麻豆精东视频| 美女免费视频一区二区| 三级久久三级久久久| 国产精品网站在线观看| 中文字幕av一区二区三区| 欧美高清精品3d| 7777精品伊人久久久大香线蕉的| 本田岬高潮一区二区三区| 国产91在线看| 久久66热re国产| 国产精品一区久久久久| 亚洲视频在线一区观看| 一区在线观看免费| 久久网站热最新地址| 久久亚洲精华国产精华液| 精品日韩99亚洲| 欧美一区二区成人| 欧美va在线播放| 欧美成人女星排行榜| 精品欧美一区二区久久 | 亚洲另类中文字| 成人高清视频在线观看| 青青草国产成人99久久| 美女高潮久久久| 精品午夜一区二区三区在线观看| 日韩vs国产vs欧美| 久色婷婷小香蕉久久| 国产a视频精品免费观看| 国产成人亚洲综合色影视| 成人黄色小视频在线观看| 国产盗摄一区二区三区| 色老头久久综合| 欧美性生活久久| 精品电影一区二区| 久久综合久久久久88| 亚洲欧美电影一区二区| 亚洲一区二区三区美女| 韩国三级电影一区二区| av电影天堂一区二区在线| 成人精品一区二区三区四区| 色成年激情久久综合| 欧美性一二三区| 日韩一级大片在线观看| 国产人成一区二区三区影院| 中文字幕佐山爱一区二区免费| 亚洲精品国产无天堂网2021 | 国产精品不卡视频| 一区二区国产视频| 久久激五月天综合精品| 成人激情动漫在线观看| 91精品麻豆日日躁夜夜躁| 亚洲精品在线电影| 中文字幕制服丝袜成人av| 图片区小说区国产精品视频| 看电影不卡的网站| 欧美三级中文字幕在线观看| 日韩精品一区二区三区四区| 亚洲精品视频一区| 天堂一区二区在线| 日本精品视频一区二区| 日韩女优制服丝袜电影| 亚洲一区二区综合| 国产综合色视频| 欧美日韩国产综合一区二区| 欧洲一区二区三区在线| 国产欧美日韩在线| 久久国产人妖系列| 在线看日本不卡| 亚洲三级在线免费| 国产在线精品国自产拍免费| 91精品免费观看| 亚洲激情综合网| 福利一区在线观看| 欧美一区二区观看视频| 亚洲成人自拍偷拍| 波多野结衣欧美| 国产网红主播福利一区二区| 精品一区二区国语对白| 欧美视频中文一区二区三区在线观看| 亚洲天堂av一区| 国产999精品久久久久久| 精品久久久三级丝袜| 亚洲成人av一区二区| 欧美色倩网站大全免费| 久久精品人人做人人爽人人| 国产在线国偷精品免费看| 日韩欧美123| 日韩av一区二| 日韩免费电影网站| 亚洲一二三区在线观看| 欧美另类一区二区三区| 亚洲一区二区三区四区在线观看 | 日韩美女一区二区三区|