现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章

上传人:E**** 文档编号:89252197 上传时间:2019-05-22 格式:PPT 页数:68 大小:1.18MB
返回 下载 相关 举报
现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章_第1页
第1页 / 共68页
现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章_第2页
第2页 / 共68页
现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章_第3页
第3页 / 共68页
现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章_第4页
第4页 / 共68页
现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章_第5页
第5页 / 共68页
点击查看更多>>
资源描述

《现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章》由会员分享,可在线阅读,更多相关《现代计算机组成原理 教学课件 ppt 作者 潘松 潘明 编著 第 6 章(68页珍藏版)》请在金锄头文库上搜索。

1、现代计算机组成原理,潘 明 潘 松 编著,科学出版社,第 6 章,16位CISC CPU设计,6.1 顶层系统设计,6.1.1 16位CPU的组成结构,图6-1 16位CPU结构框图,6.1 顶层系统设计,6.1.2指令系统设计,(1)单字指令,1指令格式,表6-1 单字节指令格式,6.1 顶层系统设计,(2)双字指令,表6-2 双字指令格式,表6-3 双字节指令,6.1 顶层系统设计,6.1.2指令系统设计,2指令操作码,表6-4 操作码功能表,6.1 顶层系统设计,6.1.2指令系统设计,2指令操作码,表6-5 常用指令举例,6.1 顶层系统设计,6.1.3 顶层结构的VHDL设计,1.

2、CPU元件的VHDL描述,【例6-1】CPU_LIB.VHD library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; package cpu_lib is type t_shift is (shftpass, shl, shr, rotl, rotr); subtype t_alu is unsigned(3 downto 0);,(接下页),6.1 顶层系统设计,6.1.3 顶层结构的VHDL设计,1. CPU元件的VHDL描述,constant alupass : unsigned(3 downto

3、0) := “0000“; constant andOp : unsigned(3 downto 0) := “0001“; constant orOp : unsigned(3 downto 0) := “0010“; constant notOp : unsigned(3 downto 0) := “0011“; constant xorOp : unsigned(3 downto 0) := “0100“; constant plus : unsigned(3 downto 0) := “0101“; constant alusub : unsigned(3 downto 0) := “

4、0110“; constant inc : unsigned(3 downto 0) := “0111“; constant dec : unsigned(3 downto 0) := “1000“; constant zero : unsigned(3 downto 0) := “1001“; type t_comp is (eq, neq, gt, gte, lt, lte); subtype t_reg is std_logic_vector(2 downto 0); type state is (reset1, reset2, reset3, reset4, reset5,reset6

5、, execute, nop, load, store, move, load2, load3, load4, store2, store3,store4, move2, move3, move4,incPc, incPc2, incPc3, incPc4, incPc5, incPc6, loadPc,loadPc2,loadPc3, loadPc4, bgtI2, bgtI3, bgtI4, bgtI5, bgtI6, bgtI7,bgtI8, bgtI9,bgtI10, braI2, braI3, braI4, braI5, braI6, loadI2,loadI3, loadI4, l

6、oadI5, loadI6,inc2, inc3, inc4); subtype bit16 is std_logic_vector(15 downto 0); end cpu_lib;,6.1 顶层系统设计,6.1.3 顶层结构的VHDL设计,1. CPU元件的VHDL描述,【例6-2】top.vhd library IEEE; use IEEE.std_logic_1164.all; use work.cpu_lib.all; entity top is end top; architecture behave of top is component mem port (addr : in

7、 bit16;sel,rw : in std_logic;ready : out std_logic; data : inout bit16); end component; component cpu port(clock, reset, ready : in std_logic;addr : out bit16; rw, vma : out std_logic;data : inout bit16); end component; signal addr, data : bit16 ; signal vma, rw, ready : std_logic; signal clock, res

8、et : std_logic := 0; begin clock = not clock after 50 ns ;reset = 1, 0 after 100 ns; m1 : mem port map (addr, vma, rw, ready, data); u1 : cpu port map(clock, reset, ready, addr, rw, vma,data); end behave;,6.1 顶层系统设计,6.1.3 顶层结构的VHDL设计,2. 顶层文件的原理图设计,(接下页),图6-2 CPU顶层结构图,6.1 顶层系统设计,6.1.3 顶层结构的VHDL设计,3CP

9、U与LCD显示模块的接口,图6-3 显示模块dsp的实体结构图,6.1 顶层系统设计,6.1.3 顶层结构的VHDL设计,3CPU与LCD显示模块的接口,图6-4 LCD显示屏的数据显示,6.1 顶层系统设计,6.1.4 软件设计实例,表6-6 示例程序,表6-7 存储器初始化文件RAM_16.mif的内容,6.2 CPU基本部件设计,6.2.1 运算器ALU,表6-8 运算器ALU的功能,图6-5 运算器ALU结构图,6.2 CPU基本部件设计,6.2.1 运算器ALU,图6-5 运算器ALU结构图,【例6-3】alu.vhd library IEEE; use IEEE.std_logic

10、_1164.all; use IEEE.std_logic_unsigned.all; use work.cpu_lib.all; entity alu is port( a, b : in bit16; sel : in t_alu; c : out bit16 ); end alu; architecture rtl of alu is begin aluproc: process(a, b, sel) begin case sel is when alupass= c c c c c c c c c c c= “0000000000000000“ after 1 ns; end case

11、;end process; end rtl;,6.2 CPU基本部件设计,6.2.1 运算器ALU,图6-6 运算器ALU的仿真波形,6.2 CPU基本部件设计,6.2.1 运算器ALU,表6-9 ALU运算仿真结果说明,6.2 CPU基本部件设计,6.2.2 比较器COMP,表6-10 比较器的运算类型,6.2 CPU基本部件设计,6.2.2 比较器COMP,图6-7比较器结构图,6.2 CPU基本部件设计,6.2.2 比较器COMP,【例6-4】COMP.VHD library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_ar

12、ith.all; use IEEE.std_logic_unsigned.all; use work.cpu_lib.all; entity comp is port( a, b : in bit16;sel : in t_comp;compout : out std_logic); end comp; architecture rtl of comp is begin compproc: process(a, b, sel) begin case sel is when eq = if a = b then compout if a /= b then compout if a b then

13、 compout if a = b then compout if a if a = b then compout = 1 after 1 ns ; else compout = 0 after 1 ns ;end if; end case ; end process; end rtl;,6.2 CPU基本部件设计,6.2.2 比较器COMP,图6-8 比较器COMP的仿真波形图,表6-11 比较器COMP的仿真波形说明,6.2 CPU基本部件设计,6.2.3 控制器CONTROL,图6-9 控制器CONTROL的实体结构图,【例6-5】control.vhd library IEEE; us

14、e IEEE.std_logic_1164.all; use work.cpu_lib.all; entity control is port( clock,reset ,ready,compout: in std_logic; instrReg : in bit16; progCntrWr,progCntrRd ,addrRegWr,addrRegRd,outRegWr, outRegRd : out std_logic; shiftSel : out t_shift; aluSel : out t_alu; compSel : out t_comp; opRegRd,opRegWr,ins

15、trWr,regRd,regWr ,rw,vma: out std_logic; regSel : out t_reg ); end control; architecture rtl of control is signal current_state, next_state : state; begin nxtstateproc: process( current_state, instrReg, compout,ready) begin progCntrWr aluSel aluSel=zero; shiftSel=shftpass; outRegWr=1;,(接下页),next_sta

16、te outRegRd outRegRd vma vma case instrReg(15 downto 11) is when “00000“ = next_state regSel regSel regSel progcntrRd progcntrRd regSel regSelnext_state = incPc;,(接下页),end case; when load2 = regSel vma vma regSel regSel regSel regSel outRegRd outRegRd progcntrRd outregRd outregRd vma vma = 1; rw = 0;,(接下页),if ready = 1 then regSel progcntrRd outregRd outregRd vma vma regSel o

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号