软导作业2016年11月11日07:32:27

1. Program with machine language according to the following c.

int_8 a = 1;
int_8 c = a + 3;

(1)Write your assembly code & machine code
(2)Explain machine code execution with the fetch-decode-execute cycle
(3)Explain functions about IR, PC, ACC registers in a CPU
(4)Explain physical meaning about vars a & c in a machine

1.(1) LOD # 1–>STO X –> LOD X –> ADD#3 –> STO Y –> HLT

1.(2)
Main memory –> fetch instruction –> Decode instruction –>Registers –>Get data –>Execute the instruction –> Main memory

1.(3)
IR:指令寄存器,用来保存当前正在执行的一条指令
PC:程序计数器,存放下一条指令在内存中的地址
ACC:累加寄存器,功能是当运算器的算术逻辑单元(ALU)执行全部算术和逻辑运算时,为ALU提供一个工作区,暂时存放ALU运算结果

1(4)

2. 简答题
(1)What are stored in memory?
(2)Can a data or a instruction stored in the same place?
(3)Explain Instruction Format with example instructions.

2(1) 指令和数据

2(2) 可以

2(3)

例:ADD X :00000000 10000000

前八位称命令指示,第四位为寻址模式,例子中为0,表示操作数是该地址的内容;后八位称为操作数,表示数值或地址,例子中表示内存中地址128。整个例子表示加上将内存地址128中的数据

3. 解释以下词汇
(1)汇编语言(Assembly Language)
(2)编译(Compiler)
(3)命令式语言(Imperative programming)
(4)函数编程语言(Functional programming)
(5)过程式编程(Procedural programming)

3(1)
A language that uses mnemonic codes(助记忆符号) to represent machinelanguage
instructions

3(2)
A program that translates a high-level language program
into machine code

3(3)
Imperative programming is a programming paradigm that uses statements that change a program’s state

3(4)
Functional programming is a programming paradigm–a style of building the structure and elements of computer programs–that treats computation as the evaluation of mathematical functions and avoid changing-state and mutable data

3(5)
A programming paradigm, derived from structured programming, based upon the concept of the procedure call

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值