计算机体系结构 哈佛结构_计算机体系结构:中断

计算机体系结构 哈佛结构

计算机体系结构:中断 (Computer Architecture: Interrupts)

Data transfer between the CPU and the peripherals is initiated by the CPU. But the CPU cannot start the transfer unless the peripheral is ready to communicate with the CPU. When a device is ready to communicate with the CPU, it generates an interrupt signal. A number of input-output devices are attached to the computer and each device is able to generate an interrupt request.

CPU和外围设备之间的数据传输由CPU启动。 但是,除非外围设备准备好与CPU通信,否则CPU无法开始传输。 当设备准备与CPU通信时,它将生成一个中断信号。 计算机上连接了许多输入输出设备,每个设备都可以生成中断请求。

The main job of the interrupt system is to identify the source of the interrupt. There is also a possibility that several devices will request simultaneously for CPU communication. Then, the interrupt system has to decide which device is to be serviced first.

中断系统的主要工作是识别中断源。 还有可能几个设备将同时请求进行CPU通信。 然后,中断系统必须决定首先要维修哪个设备。

优先中断 (Priority Interrupt)

A priority interrupt is a system which decides the priority at which various devices, which generates the interrupt signal at the same time, will be serviced by the CPU. The system has authority to decide which conditions are allowed to interrupt the CPU, while some other interrupt is being serviced. Generally, devices with high speed transfer such as magnetic disks are given high priority and slow devices such as keyboards are given low priority.

优先级中断是一种系统,它决定由CPU同时生成中断信号的各种设备所服务的优先级。 系统有权决定允许哪些条件来中断CPU,同时正在处理其他一些中断。 通常,诸如磁盘之类的具有高速传输的设备被赋予高优先级,而诸如键盘之类的慢速设备则被赋予低优先级。

When two or more devices interrupt the computer simultaneously, the computer services the device with the higher priority first.

当两个或多个设备同时中断计算机时,计算机将首先以更高的优先级为设备提供服务。

中断类型: (Types of Interrupts:)

Following are some different types of interrupts:

以下是一些不同类型的中断:



硬件中断 (Hardware Interrupts)

When the signal for the processor is from an external device or hardware then this interrupts is known as hardware interrupt.

当处理器的信号来自外部设备或硬件时,此中断称为硬件中断

Let us consider an example: when we press any key on our keyboard to do some action, then this pressing of the key will generate an interrupt signal for the processor to perform certain action. Such an interrupt can be of two types:

让我们考虑一个例子:当我们按下键盘上的任意键来执行某些操作时,那么按下此键将产生一个中断信号,供处理器执行某些操作。 这样的中断可以有两种类型:

  • Maskable Interrupt可屏蔽中断
  • The hardware interrupts which can be delayed when a much high priority interrupt has occurred at the same time.

    硬件中断可以在高优先级中断同时发生时延迟。

  • Non Maskable Interrupt不可屏蔽中断
  • The hardware interrupts which cannot be delayed and should be processed by the processor immediately.

    硬件中断不能延迟,应该立即由处理器处理。

软件中断 (Software Interrupts)

The interrupt that is caused by any internal system of the computer system is known as a software interrupt. It can also be of two types:

由计算机系统的任何内部系统引起的中断称为软件中断 。 它也可以有两种类型:

  • Normal Interrupt正常中断
  • The interrupts that are caused by software instructions are called normal software interrupts.

    由软件指令引起的中断称为普通软件中断

  • Exception例外
  • Unplanned interrupts which are produced during the execution of some program are called exceptions, such as division by zero.

    在某些程序执行期间产生的计划外中断称为异常 ,例如被零除。

菊花链优先 (Daisy Chaining Priority)

This way of deciding the interrupt priority consists of serial connection of all the devices which generates an interrupt signal. The device with the highest priority is placed at the first position followed by lower priority devices and the device which has lowest priority among all is placed at the last in the chain.

这种确定中断优先级的方式包括产生中断信号的所有设备的串行连接。 优先级最高的设备位于第一位置,其次是低优先级的设备,而优先级最低的设备位于链的最后。

In daisy chaining system all the devices are connected in a serial form. The interrupt line request is common to all devices. If any device has interrupt signal in low level state then interrupt line goes to low level state and enables the interrupt input in the CPU. When there is no interrupt the interrupt line stays in high level state. The CPU respond to the interrupt by enabling the interrupt acknowledge line. This signal is received by the device 1 at its PI input. The acknowledge signal passes to next device through PO output only if device 1 is not requesting an interrupt.

在菊花链系统中,所有设备都以串行形式连接。 中断线请求是所有设备通用的。 如果任何设备的中断信号处于低电平状态,则中断线将变为低电平状态并启用CPU中的中断输入。 没有中断时,中断线保持高电平状态。 CPU通过启用中断确认线来响应中断。 该信号由设备1的PI输入接收。 仅当设备1不请求中断时,确认信号才通过PO输出传递到下一个设备。

The following figure shows the block diagram for daisy chaining priority system.

下图显示了菊花链优先系统的框图。

计算机体系结构 哈佛结构_计算机体系结构:中断

翻译自: https://www.studytonight.com/computer-architecture/priority-interrupt

计算机体系结构 哈佛结构