一个机器周期 计算机_计算机科学组织| 机器周期

一个机器周期 计算机

机器周期 (Machine Cycle)

The cycle during which a machine language instruction is executed by the processor of the computer system is known as the machine cycle. If a program contains 10 machine language instruction, 10 separate machine cycles should be executed for running the program. As the machine cycle contains four phases namely fetching, decoding, executing and storing.

由计算机系统的处理器执行机器语言指令的周期称为机器周期 。 如果程序包含10条机器语言指令,则应运行10个单独的机器周期来运行该程序。 由于机器周期包含四个阶段,即获取,解码,执行和存储。

The four-phase of the machine cycle is usually grouped into two categories:

机器周期的四个阶段通常分为两类:

  1. Instruction cycle

    指令周期

  2. Execution cycle

    执行周期

1)指令周期 (1) Instruction cycle)

This concept describes the execution sequence of the program. Instruction cycle includes the first two phases, fetching and decoding.

这个概念描述了程序的执行顺序。 指令周期包括前两个阶段,即获取和解码。

i)提取周期 (i) Fetch cycle)

In this cycle, the instructions related to binary sequence is transferred from the memory to CPU.

在该循环中,与二进制序列相关的指令从存储器传送到CPU。

  • CPU generates the memory request based on the program counter to read the instruction from the memory.

    CPU根据程序计数器生成存储器请求,以从存储器中读取指令。

  • Program Counter holds the starting instruction address and immediately points the next instruction address.

    程序计数器保存起始指令地址,并立即指向下一个指令地址。

  • Here, the starting address is provided by the user and the next instruction address is calculated by incrementing.

    此处,起始地址由用户提供,下一条指令地址通过递增来计算。

  • Step size is depending on the size or length of the instruction i.e. if the instruction size is n byte then the step size is n.

    步长取决于指令的大小或长度,即,如果指令大小为n字节,则步长为n。

  • When the processor supports with fixed length instruction then the PC is incremented to affixed constant during the fetch cycle to points the next time instruction address.

    当处理器支持固定长度的指令时,则PC在读取周期内递增到固定的常数,以指向下一个时间指令地址。

  • So during the fetch cycle only the OPCODE related byte to transfer to the CPU. Then PC will be incremented by 1. During the decoding process, the program counter is incremented the next instruction address.

    因此,在获取周期中,只有与OPCODE相关的字节才能传输到CPU。 然后PC将增加1。在解码过程中,程序计数器将增加下一个指令地址。

  • The process of transfer the instruction related binary sequence from the memory to CPU is called an instruction fetch.

    将指令相关的二进制序列从存储器传输到CPU的过程称为指令提取。

ii)解码 (ii) Decoding)

This phase of instruction cycle is responsible for breaking down the instruction into different parts so that it can be easily understood before being processed by the CPU. The Instruction is usually decoded by the instruction decoder which is a vital component of the CPU. The decoding of an instruction is also known as interpreting. The instruction is interpreted to determine two keys attributes of an instruction the opcode and the operands. the type of operations to be performed is identified by the opcode and the data on which the operation is to be performed is identified by the operand. Data is transferred to the Data Register (DR).

指令周期的这个阶段负责将指令分解为不同的部分,以便在被CPU处理之前可以很容易地理解它。 指令通常由指令解码器解码,而指令解码器是CPU的重要组成部分。 指令的解码也称为解释。 解释该指令以确定操作码和操作数的一条指令的两个键属性。 操作码标识要执行的操作的类型,操作数标识要执行的数据。 数据被传输到数据寄存器(DR)。

2)执行周期 (2) Execution cycle)

Execution cycle includes two phase executing and storing. The execution cycle executes the instruction and stores the result back to the main memory or sends it to the output device of the computer system.

执行周期包括两个阶段的执行和存储。 执行周期执行该指令并将结果存储回主存储器或将其发送到计算机系统的输出设备。

i)执行 (i) Executing )

The objective of the execution cycle processes the currently fetched instructions.

执行周期的目标是处理当前获取的指令。

  • To process the instruction there is a need for identifying the type of the operations associated with the instruction.

    为了处理该指令,需要识别与该指令相关联的操作的类型。

  • Opcode indicates the type of the operations.

    操作码指示操作的类型。

  • The opcode is present in the instruction but that information is defined by the instruction format.

    指令中存在操作码,但该信息由指令格式定义。

  • Instruction format gives the layout of an instruction that means is shown the internal structure of an instruction.

    指令格式给出了指令的布局,即表示了指令的内部结构。

  • Instruction format is classified into five types based on the CPU organization.

    指令格式根据CPU的组织分为五种类型。

  • CPU Organisation is classified into three types based on the availability of the ALU operand.

    根据ALU操作数的可用性,CPU组织分为三种类型。

ii)存放 (ii) Storing)

In this phase the result computed in the execution phase is either sent to the memory or to an output device of the computer system. This PC of the CPU is also updated in this phase to point to the next instruction that is to be executed.

在此阶段,在执行阶段计算出的结果将发送到内存或计算机系统的输出设备。 在此阶段,CPU的此PC也将更新,以指向要执行的下一条指令。

Machine Cycle in Computer science organization

翻译自: https://www.includehelp.com/cso/machine-cycle.aspx

一个机器周期 计算机

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/377594.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

四、Transforms

transform是torchvision下的一个.py文件,这个python文件中定义了很多的类和方法,主要实现对图片进行一些变换操作 一、Transforms讲解 from torchvision import transforms#按着Ctrl,点击transforms进入到__init__.py文件中 from .transfo…

leetcode 134. 加油站 思考分析

目录题目1、暴力法,双层遍历2、贪心题目 在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发&#xff0…

单链线性表的实现

//函数结果状态代码#define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 //Status是函数的类型,其值是函数结果状态代码 typedef int Status; typedef int ElemType;…

时间模块,带Python示例

Python时间模块 (Python time Module) The time module is a built-in module in Python and it has various functions that require to perform more operations on time. This is one of the best modules in Python that used to solve various real-life time-related pro…

五、torchvision

一、下载CIFAR-10数据集 CIFAR-10数据集官网 通过阅读官网给的解释可以大概了解到,一共6w张图片,每张图片大小为3232,5w张训练图像,1w张测试图像,一共由十大类图像。 CIFAR10官网使用文档 torchvision.datasets.CIF…

leetcode 69. x 的平方根 思考分析

题目 实现 int sqrt(int x) 函数。 计算并返回 x 的平方根,其中 x 是非负整数。 由于返回类型是整数,结果只保留整数的部分,小数部分将被舍去。 示例 1: 输入: 4 输出: 2 示例 2: 输入: 8 输出: 2 说明: 8 的平方根是 2.82842…, 由于返回…

背包问题 小灰_小背包问题

背包问题 小灰Prerequisites: Algorithm for fractional knapsack problem 先决条件: 分数背包问题算法 Here, we are discussing the practical implementation of the fractional knapsack problem. It can be solved using the greedy approach and in fraction…

360浏览器兼容问题

360浏览器兼容问题 360浏览器又是一大奇葩,市场份额大,让我们不得不也对他做些兼容性处理。 360浏览器提供了两种浏览模式,极速模式和兼容模式,极速模式下是webkit内核的处理模式,兼容模式下是与IE内核相同的处理模式。…

转 设计师也需要了解的一些前端知识

一、常见视觉效果是如何实现的 一些事 关于文字效果 互联网的一些事 文字自身属性相关的效果css中都是有相对应的样式的,如字号、行高、加粗、倾斜、下划线等,但是一些特殊的效果,主要表现为ps中图层样式中的效果,css是无能为力的…

六、DataLoader

一、DataLoader参数解析 DataLoader官网使用手册 参数描述dataset说明数据集所在的位置、数据总数等batch_size每次取多少张图片shuffleTrue乱序、False顺序(默认)samplerbatch_samplernum_workers多进程,默认为0采用主进程加载数据collate_fnpin_memorydrop_las…

单调栈 leetcode整理(一)

目录单调栈知识402. 移掉K位数字1673. 找出最具竞争力的子序列316. 去除重复字母(1081. 不同字符的最小子序列)321. 拼接最大数单调栈知识 单调栈就是一个内部元素有序的栈(大->小 or 小->大),但是只用到它的一…

数字签名 那些密码技术_密码学中的数字签名

数字签名 那些密码技术A signature is usually used to bind signatory to the message. The digital signature is thus a technique that binds a person or the entity to the digital data. This binding ensures that the person sending the data is solely responsible …

七、torch.nn

一、神经网络模块 进入到PyTorch的torch.nnAPI学习页面 PyTorch提供了很多的神经网络方面的模块,NN就是Neural Networks的简称 二、Containers torch.nn下的Containers 一共有六个模块,最常用的就是Module模块,看解释可以知道&#xff0c…

Java多线程初学者指南(8):从线程返回数据的两种方法

本文介绍学习Java多线程中需要学习的从线程返回数据的两种方法。从线程中返回数据和向线程传递数据类似。也可以通过类成员以及回调函数来返回数据。原文链接 从线程中返回数据和向线程传递数据类似。也可以通过类成员以及回调函数来返回数据。但类成员在返回数据和传递数据时有…

【C++进阶】 遵循TDD原则,实现平面向量类(Vec2D)

目录1、明确要实现的类的方法以及成员函数2、假设已经编写Vec2D,根据要求,写出测试代码3、编写平面向量类Vec2D,并进行测试4、完整代码5、最终结果1、明确要实现的类的方法以及成员函数 考虑到效率问题,我们一般将函数的参数设置为引用类型。…

Keilc的中断号计算方法

中断号码 (中断向量-3)/8转载于:https://www.cnblogs.com/yuqilihualuo/p/3423634.html

md5模式 签名_MD的完整形式是什么?

md5模式 签名医师:医学博士/常务董事 (MD: Doctor of Medicine / Managing Director) 1)医学博士:医学博士 (1) MD: Doctor of Medicine) MD is an abbreviation of a Doctor of Medicine degree. In the field of Medicine, it is the main academic de…

八、卷积层

一、Conv2d torch.nn.Conv2d官网文档 torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride1, padding0, dilation1, groups1, biasTrue, padding_modezeros, deviceNone, dtypeNone) 参数解释官网详情说明in_channels输入的通道数,如果是彩色照片通道…

HTMl5结构元素:header

页眉header 页眉将是页面加载的第一个元素&#xff0c;包含了站点的标题、logo、网站导航等。<header> <div class"container_16"> <div class"logo"> <h1><a href"index.html"><strong>Real</st…

【C++grammar】左值、右值和将亡值

目录C03的左值和右值C11的左值和右值将亡值在C03中就有相关的概念 C03的左值和右值 通俗的理解&#xff1a; (1) 能放在等号左边的是lvalue (2) 只能放在等号右边的是rvalue (3) lvalue可以作为rvalue使用 对于第三点可以举个例子&#xff1a; int x ; x 6; //x是左值&#…