没有合适的资源?快使用搜索试试~ 我知道了~
cpu 用VHDL编写的
5星 · 超过95%的资源 需积分: 10 16 下载量 152 浏览量
2010-04-08
19:55:59
上传
评论
收藏 6KB TXT 举报
温馨提示
试读
9页
这是用VHDL语言编写的CPU , 主要功能是 Task One : Determine the instruction set. Task Two : Determine the architecture of the CPU and the registers,memory,and logic units needed. Task Three : Implement of the components of the CPU using VHDL and EABs(Embebded Array Blocks). Task Four : Test the CPU designed with some programs.
资源推荐
资源详情
资源评论
BR-1
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
ENTITY BR IS
PORT
( mbr_in : IN std_logic_vector(15 downto 0);
cs : IN std_logic_vector(31 downto 0);
clk : IN std_logic;
br_out : out std_logic_vector(15 downto 0)
);
END BR;
ARCHITECTURE behave OF BR IS
BEGIN
PROCESS(clk)
BEGIN
IF clk'event and clk='1' THEN
if cs(21)='1' then
br_out<=mbr_in;
end if;
END IF;
END PROCESS;
END behave;
ALU-2
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
ENTITY BR IS
PORT
( mbr_in : IN std_logic_vector(15 downto 0);
cs : IN std_logic_vector(31 downto 0);
clk : IN std_logic;
br_out : out std_logic_vector(15 downto 0)
);
END BR;
ARCHITECTURE behave OF BR IS
BEGIN
PROCESS(clk)
BEGIN
IF clk'event and clk='1' THEN
if cs(21)='1' then
br_out<=mbr_in;
end if;
END IF;
END PROCESS;
END behave;
ALU-2
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
ENTITY ALU IS
PORT
( br_in : IN std_logic_vector(15 downto 0);
cs : IN std_logic_vector(31 downto 0);
clk : IN std_logic;
accis0 : OUT std_logic;
acc : OUT std_logic_vector(15 downto 0)
);
END ALU;
ARCHITECTURE behave OF ALU IS
signal temp:std_logic_vector(15 downto 0);
BEGIN
acc <= temp;
accis0 <= '1' when temp="0000000000000000" else '0';
PROCESS(clk)
BEGIN
IF clk'event and clk='1' THEN
if cs(24)='1' then
temp<="0000000000000000"; --reset
elsif cs(22)='1' then --add
temp<=temp+br_in;
elsif cs(23)='1' then --sub
temp<=temp-br_in;
elsif cs(25)='1' then --shiftr
temp<='0'&temp(15 downto 1);
elsif cs(7)='1' then --shiftl
temp<=temp(14 downto 0)&'0';
elsif cs(1)='1' then --and
剩余8页未读,继续阅读
资源评论
- windforcloud2014-09-09很有利用价值,值得学习
- rebecca_5992012-05-24这个很有用,是16位的CPU
- lwt2312013-03-06这个还是很有用的,很容易理解的!
xqdjh
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功