硬件课程设计报告 RISC模型机的设计
来源:互联网 发布:远望谷公司怎么样 知乎 编辑:程序博客网 时间:2024/05/21 06:32
<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;mso-font-charset:0;mso-generic-font-family:roman;mso-font-pitch:variable;mso-font-signature:-1610611985 1107304683 0 0 159 0;}@font-face{font-family:Cambria;panose-1:2 4 5 3 5 4 6 3 2 4;mso-font-charset:0;mso-generic-font-family:roman;mso-font-pitch:variable;mso-font-signature:-1610611985 1073741899 0 0 159 0;}@font-face{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;mso-font-charset:0;mso-generic-font-family:swiss;mso-font-pitch:variable;mso-font-signature:-1610611985 1073750139 0 0 159 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-unhide:no;mso-style-qformat:yes;mso-style-parent:"";margin:0in;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family:宋体;mso-bidi-font-family:"Times New Roman";mso-font-kerning:1.0pt;}h2{mso-style-priority:9;mso-style-qformat:yes;mso-style-link:"标题 2 Char";mso-style-next:正文;margin-top:13.0pt;margin-right:0in;margin-bottom:13.0pt;margin-left:0in;text-align:justify;text-justify:inter-ideograph;line-height:173%;mso-pagination:lines-together;page-break-after:avoid;mso-outline-level:2;font-size:16.0pt;font-family:"Cambria","serif";mso-font-kerning:1.0pt;}h3{mso-style-priority:9;mso-style-qformat:yes;mso-style-link:"标题 3 Char";mso-style-next:正文;margin-top:13.0pt;margin-right:0in;margin-bottom:13.0pt;margin-left:0in;text-align:justify;text-justify:inter-ideograph;line-height:173%;mso-pagination:lines-together;page-break-after:avoid;mso-outline-level:3;font-size:16.0pt;font-family:"Calibri","sans-serif";mso-font-kerning:1.0pt;}h4{mso-style-priority:9;mso-style-qformat:yes;mso-style-link:"标题 4 Char";mso-style-next:正文;margin-top:14.0pt;margin-right:0in;margin-bottom:14.5pt;margin-left:0in;text-align:justify;text-justify:inter-ideograph;line-height:156%;mso-pagination:lines-together;page-break-after:avoid;mso-outline-level:4;font-size:14.0pt;font-family:"Cambria","serif";mso-font-kerning:1.0pt;}p.MsoHeader, li.MsoHeader, div.MsoHeader{mso-style-noshow:yes;mso-style-priority:99;mso-style-link:"页眉 Char";margin:0in;margin-bottom:.0001pt;text-align:center;mso-pagination:none;tab-stops:center 207.65pt right 415.3pt;layout-grid-mode:char;border:none;mso-border-bottom-alt:solid windowtext .75pt;padding:0in;mso-padding-alt:0in 0in 1.0pt 0in;font-size:9.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family:宋体;mso-bidi-font-family:"Times New Roman";mso-font-kerning:1.0pt;}p.MsoFooter, li.MsoFooter, div.MsoFooter{mso-style-priority:99;mso-style-link:"页脚 Char";margin:0in;margin-bottom:.0001pt;mso-pagination:none;tab-stops:center 207.65pt right 415.3pt;layout-grid-mode:char;font-size:9.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family:宋体;mso-bidi-font-family:"Times New Roman";mso-font-kerning:1.0pt;}span.2Char{mso-style-name:"标题 2 Char";mso-style-priority:9;mso-style-unhide:no;mso-style-locked:yes;mso-style-link:"标题 2";mso-ansi-font-size:16.0pt;mso-bidi-font-size:16.0pt;font-family:"Cambria","serif";mso-ascii-font-family:Cambria;mso-hansi-font-family:Cambria;mso-font-kerning:1.0pt;font-weight:bold;}span.3Char{mso-style-name:"标题 3 Char";mso-style-priority:9;mso-style-unhide:no;mso-style-locked:yes;mso-style-link:"标题 3";mso-ansi-font-size:16.0pt;mso-bidi-font-size:16.0pt;mso-font-kerning:1.0pt;font-weight:bold;}span.4Char{mso-style-name:"标题 4 Char";mso-style-priority:9;mso-style-unhide:no;mso-style-locked:yes;mso-style-link:"标题 4";mso-ansi-font-size:14.0pt;mso-bidi-font-size:14.0pt;font-family:"Cambria","serif";mso-ascii-font-family:Cambria;mso-hansi-font-family:Cambria;mso-font-kerning:1.0pt;font-weight:bold;}span.Char{mso-style-name:"页眉 Char";mso-style-noshow:yes;mso-style-priority:99;mso-style-unhide:no;mso-style-locked:yes;mso-style-link:页眉;mso-ansi-font-size:9.0pt;mso-bidi-font-size:9.0pt;mso-font-kerning:1.0pt;}span.Char0{mso-style-name:"页脚 Char";mso-style-priority:99;mso-style-unhide:no;mso-style-locked:yes;mso-style-link:页脚;mso-ansi-font-size:9.0pt;mso-bidi-font-size:9.0pt;mso-font-kerning:1.0pt;}.MsoChpDefault{mso-style-type:export-only;mso-default-props:yes;font-size:10.0pt;mso-ansi-font-size:10.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:Calibri;mso-fareast-font-family:宋体;mso-hansi-font-family:Calibri;}@page Section1{size:595.3pt 841.9pt;margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:42.55pt;mso-footer-margin:49.6pt;mso-paper-source:0;layout-grid:15.6pt;}div.Section1{page:Section1;}@page Section2{size:595.3pt 841.9pt;margin:1.0in .75in 1.0in .75in;mso-header-margin:42.55pt;mso-footer-margin:49.6pt;mso-columns:2 even 21.25pt;mso-paper-source:0;layout-grid:15.6pt;}div.Section2{page:Section2;}@page Section3{size:8.5in 11.0in;margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}div.Section3{page:Section3;} /* List Definitions */ @list l0{mso-list-id:553080071;mso-list-type:hybrid;mso-list-template-ids:1582726994 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}@list l0:level1{mso-level-tab-stop:none;mso-level-number-position:left;margin-left:21.0pt;text-indent:-21.0pt;}@list l1{mso-list-id:959730200;mso-list-type:hybrid;mso-list-template-ids:1781987724 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}@list l1:level1{mso-level-tab-stop:none;mso-level-number-position:left;margin-left:21.0pt;text-indent:-21.0pt;}ol{margin-bottom:0in;}ul{margin-bottom:0in;}-->
<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;mso-font-charset:0;mso-generic-font-family:roman;mso-font-pitch:variable;mso-font-signature:-1610611985 1107304683 0 0 159 0;}@font-face{font-family:Cambria;panose-1:2 4 5 3 5 4 6 3 2 4;mso-font-charset:0;mso-generic-font-family:roman;mso-font-pitch:variable;mso-font-signature:-1610611985 1073741899 0 0 159 0;}@font-face{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;mso-font-charset:0;mso-generic-font-family:swiss;mso-font-pitch:variable;mso-font-signature:-1610611985 1073750139 0 0 159 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-unhide:no;mso-style-qformat:yes;mso-style-parent:"";margin:0in;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family:宋体;mso-bidi-font-family:"Times New Roman";mso-font-kerning:1.0pt;}p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing{mso-style-priority:1;mso-style-unhide:no;mso-style-qformat:yes;mso-style-parent:"";mso-style-link:"无间隔 Char";margin:0in;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family:宋体;mso-bidi-font-family:"Times New Roman";mso-font-kerning:1.0pt;}span.Char{mso-style-name:"无间隔 Char";mso-style-priority:1;mso-style-unhide:no;mso-style-locked:yes;mso-style-link:无间隔;mso-ansi-font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-font-kerning:1.0pt;}.MsoChpDefault{mso-style-type:export-only;mso-default-props:yes;font-size:10.0pt;mso-ansi-font-size:10.0pt;mso-bidi-font-size:10.0pt;mso-ascii-font-family:Calibri;mso-fareast-font-family:宋体;mso-hansi-font-family:Calibri;}@page Section1{size:8.5in 11.0in;margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}div.Section1{page:Section1;}-->硬件课程设计报告
RISC模型机的设计
一、设计目的
对所学计算机硬件课程进行系统化,进一步提高硬件设计及动手能力。
二、设计内容与要求
(1)选用使用频率比较高的五条基本指令:MOV、ADD、STORE、LOAD、JMP。
(2)寻址方式采用寄存器寻址及直接寻址两种方式。
(3)指令格式采用单字长及双字长两种格式。
(4)设计不采用微程序,在CPLD中设计控制逻辑。
三、设计原理
1. 指令格式
单字长指令格式为:
操作码
RS
RD
双字长指令格式为:
操作码
RS
RD
ADDR
其中RS、RD为不同状态,则选中不同的寄存器:
RS或RD
寄存器
00
01
10
11
R0
R1
R2
Ac
指令系统如下:
MOV RS, RD
ADD RS, RD
JMP RS
LOAD [ADDR], RD
STORE RS, [ADDR]
MOV,ADD,JMP三条指令为单周期执行完成。STORE,LOAD两条指令为两周期执行完成,ADDR为存或取数的直接地址。第一机器周期完成取操作码、作标记;第二机器周期完成取直接地址并完成取数或存数。
2. 指令周期执行流程
3. RISC模型机数据通路图
图中PLD模块用able语言设计来实现,它是用来产生各部件的控制信号。其余模块根据设备上提供的资源用硬布线来构成。
四、具体设计及结果分析
1. 实验步骤
(1)在ispDesignEXPERT系统中建立RISC设计项目,包括顶层模块原理图(top.sch),PLD子模块程序,经编译,将生成的JED文件下载至CPLD芯片ispLSI1032中。
(2)按所给的接线图连接线路。
(3)用所设计的指令系统,编写一段机器指令程序。
(4)运行CMPP20进行联机,将上述程序装载到实验系统的RAM中。
(5)将时序单元的STOP开关拨至RUN状态,STEP开关拨至STEP状态,通过按START微动开关,来单步机器指令,可通过地址显示灯检查指令执行的地址,运行完后检查RAM中的运算结果。
实验中若将时序单元(STATE UNIT)中的Φ接至信号源单元(SIGNAL UNIT)的H23上则可用来单步执行机器指令操作;若将Φ接至KK2+上则可单步执行每个节拍来调试实验程序,其方法是将STEP开关拨至EXEC状态后,按一下START启动键,然后每按动一次KK2键产生一个节拍。
(6)联机运行程序时,进入软件界面,装载机器指令后,选择RISC通路图,按相应功能键即可联机运行、监控、调试程序。
2. CPLD芯片设计
顶层模块电路图(top.sch)
3. RISC接线图
4. PLD的ABEL程序
MODULE PLD
T1,T2,T3,T4 PIN ;
I7,I6,I5,I4,I3,I2,I1,I0 PIN ;
PC_B, ALU_B ,CS,WR PIN ;
LD,LDAR,LDAC,LDIR,LDPC PIN ;
CLR, R0_B,R1_B,R2_B PIN ;
LDDR, LDR0,LDR1,LDR2 PIN ;
MOV,ADD,JMP,LOAD,STA NODE ISTYPE 'COM' ;
RS_B, LDRi NODE ;
F NODE ISTYPE 'REG';
EQUATIONS
MOV=!I6&!I5&!I4; ADD=!I6&!I5&I4; JMP=!I6&I5&!I4;
LOAD=!I6&I5&I4; STA=I6&!I5&!I4;
F.AR=CLR; F.CLK=!((LOAD#STA)&T4); F:=!F.FB;
PC_B =(!T1&!(LOAD&T3)&!(STA&T3))#F;
CS =(!T2&!F)#(!T1&!(T2&LOAD)&!(T3&STA)&F);
LDIR =T3&!F;
LDPC =!T2&!(JMP&T3);
LDDR =(!ADD&T4);
ALU_B =!(ADD&T4);
WR =!(T3&STA&F);
LD =!(JMP&(T3#T4))#F;
LDAR =T2#LOAD&T4&!F#STA&T4&!F;
RS_B =((!(MOV&T3)&!(ADD&T3)&!(JMP&(T4#T3)))&!F)
#(!(STA&T3)&F);
LDRi =(!(MOV&T3)&!(ADD&T4)#F)&(!(LOAD&T2)#!F);
R0_B =RS_B#I3#I2; R1_B=RS_B#I3#!I2;
R2_B =RS_B#!I3#I2;
LDAC =LDRi#!I1#!I0; LDR0=LDRi#I1#I0;
LDR1 =LDRi#I1#!I0; LDR2=LDRi#!I1#I0;
END
5. 调试程序
各指令操作码(I6I5I4):
MOV 000
ADD 001
JMP 010
LOAD 011
STA 100
一段功能伪代码:
$P00 LOAD R0
$P01 08
$P02 MOV R0 AC
$P03 ADD RO
$P04 STORE RO
$P05 09
$P06 MOV R0 R1
$P07 JMP R1
$P08 01
$P09 FF
对应的机器码实现:
$P0030
$P0108
$P0203
$P0314
$P0440
$P0509
$P0601
$P0725
$P0801
$P09FF
6. 调试结果
说明:主要标出了变化的寄存器(或ram)和源(或目的)寄存器(或ram)
AR
IR
PC
ALU
MEM
R0
AC
DR
R1
Load [08] R0
0
T1
00
00
00
30
00
00
T2
30
T3
01
T4
01
08
1
T1
08
01
T2
01
T3
02
T4
MOV R0 AC
2
T1
02
03
T2
03
T3
03
01
T4
ADD AC R0
3
T1
03
14
T2
14
T3
04
01
T4
02
02
STORE R0 [09]
4
T1
04
40
T2
40
T3
05
4A
T4
05
09
5
T1
09
T2
T3
06
02
T4
MOV R0 R1
6
T1
06
01
T2
01
T3
07
02
02
T4
JMP R1
7
T1
07
25
T2
25
T3
02
02
T4
- 硬件课程设计报告 RISC模型机的设计
- 基本模型机的设计与实现课程设计报告
- 硬件课程设计报告--基于Basys2的多功能电子琴
- 计算机组成原理课程设计之设计RISC处理器
- 微机原理课程设计设计报告
- (总结)JAVA课程设计报告:记事本的设计与实现
- 计算机组成原理课程设计-基本模型机的设计与实现
- 硬件课程设计
- C语言课程设计报告--很久很久以前的课程设计报告
- 探讨SPARC结构的RISC设计技术
- 基于状态机的简易RISC CPU设计
- 课程设计报告
- 课程设计报告
- 课程设计报告
- 课程设计报告
- C++课程设计报告——贪吃蛇和迷宫的设计及实现
- 【课程设计报告】题目0:设计校园两点之间的最小单元路径
- 课程设计报告,简单的银行管理系统
- 将默认的Netbeans中文版设置为英文界面/如何将Netbeans 6.5设置为英文界面
- 上传多个文件到oracle数据库
- 使用测试工具进行HTTP测试。
- js捕获键盘事件firefox和ie有区别
- AJAX开发简略
- 硬件课程设计报告 RISC模型机的设计
- php webservice java
- 软件课程设计报告
- 方位角的表示及示意图
- Tip #10 使用Google AJAX 库 API
- C++ gui QT4 OPENGL 开发1
- [Oracle]分割字符串返回数组
- oracle权限管理
- 猫扑:模范中国丈夫与传统日本妻子