没有合适的资源?快使用搜索试试~ 我知道了~
计算机系统1--原书第六章答案
资源详情
资源评论
资源推荐
Appendix F
Selected Solutions
F.6 Chapter 6 Solutions
6.1 Yes, for example, an iterative block where the test condition remains true for each iteration.
This procedure will never end and is therefore not finite and not an algorithm. The following
is an example of a procedure that isn’t an algorithm:
x3000 0101 000 000 1 00000 ( LOOP AND R0, R0, #0 )
x3001 0000 010 111111110 ( BRz LOOP )
This is not an algorithm because the branch instruction is always taken and the program loops
indefinitely.
6.3 The following program uses DeMorgan’s Law to set the appropriate bits of the machine busy
register.
x3000 1010000000001110 ( LDI R0, S )
x3001 1010001000001110 ( LDI R1, I )
x3002 0101010010100000 ( AND R2, R2, #0 )
x3003 0001010010100001 ( ADD R2, R2, #1 )
x3004 0001001001111111 ( L ADD R1, R1, #-1 )
x3005 0000100000000010 ( BRn D )
x3006 0001010010000010 ( ADD R2, R2, R2 )
x3007 0000111111111100 ( BRnzp L )
x3008 0001001010100000 ( D ADD R1, R2, #0 )
x3009 1001000000111111 ( NOT R0, R0 )
x300a 1001001001111111 ( NOT R1, R1 )
x300b 0101000000000001 ( AND R0, R0, R1 )
x300c 1001000000111111 ( NOT R0, R0 )
x300d 1011000000000001 ( STI R0, S )
x300e 1111000000100101 ( TRAP x25 )
1
我爱伸懒腰
- 粉丝: 85
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0