(萌新的数电学习)用VHDL语言设计CPU

一、目的:
完整、连贯地运用《数字逻辑》所学到的知识,熟练掌握 EDA 工具基本使用方法,为学习好后续《计算机原理》课程做铺垫。

二、设计内容
(一) 按照给定的数据通路、数据格式和指令系统,使用 EDA 工具设计一台用硬连线
逻辑控制的简易计算机;
(二) 要求灵活运用各方面知识,使得所设计的计算机具有较佳的性能;
(三) 对所设计计算机的性能指标进行分析,整理出设计报告。

三、详细设计
在这里插入图片描述
在这里插入图片描述

用VHDL语言设计的ZF

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity Zf is
port (X, EN,clk:in std_logic;
      Zf:out std_logic) ;
end entity;

architecture bhv of Zf is
begin
 process (CLK, EN)
 begin
   if(EN='1') then
     if (CLK'event and CLK='0') then Zf<=X;--down side and EN=0
     end if;
   end if;
 end process;
end architecture;

RTL视图
在这里插入图片描述

用VHDL语言设计的CF

library ieee;
use ieee.std_logic_1164.all ;
use ieee.std_logic_unsigned.all;

entity Cf is
port (X,EN,clk:in std_logic;
      cf:out std_logic) ;
end entity;

architecture bhv of Cf is
begin
 process (CLK, EN)
 begin
   if(EN='1' )then
     if(CLK'event and CLK='0' ) then Cf<=X;--down side
     end if;
   end if;
 end process ;
end architecture;

RTL视图
在这里插入图片描述

用VHDL语言设计的IR

library ieee;
use ieee.std_logic_1164.all;

entity IR is
port(input:in std_logic_vector(7 downto 0);
     clock,ld:in std_logic;
     output_a,output_b:out std_logic_vector(3 downto 0);
     R:out std_logic_vector(7 downto 0));
end IR;

architecture bhv of IR is
signal i:std_logic_vector(7 downto 0):="00000000";
begin
  process (clock,input,ld)
  begin
    if(clock'event and clock='0') then--rising clock .
      if(ld='1') then i<=input;
      end if;
    end if;
  end process;
  output_a<=i(7 downto 4);
  output_b<=i(3 downto 0);
  R<=i;
end bhv;

RTL视图
在这里插入图片描述

CPU的设计我采用的是分层设计的方法。
最顶层的设计如图:
在这里插入图片描述
func部分如图:
在这里插入图片描述
decoder部分如图:
在这里插入图片描述
zhiling部分如图:
在这里插入图片描述

  • 4
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值