Explore chapters and articles related to this topic
Arithmetic and Logic Unit Organisation
Published in Pranabananda Chakraborty, Computer Organisation and Architecture, 2020
Exception is defined as a peculiar situation that arises when the result of a computation falls outside the prescribed domain of expressible range (both positive and negative) of normal numbers. It happens if any of the followings is found while performing operations: underflow, overflow, divide by zero, inexact, and invalid. The first three have already been mentioned. Inexact is defined as a situation when the result of the computation requires rounding in order to be represented in one of the normal formats. An invalid exception occurs if operations, such as 0/0 or −1, are attempted. When an exception occurs, the processor must then set the corresponding exception flag, and the related interrupt is issued. Control is then passed to the respective interrupt service routine (ISR), which may be system-defined or even user-defined. Alternatively, the application program itself can examine the situation, and test on its own for the occurrence of such exceptions as necessary, and then decide what to do and how to proceed. Usually, when exception occurs, the results are set to special values.
Interrupts
Published in Julio Sanchez, Maria P. Canton, Microcontroller Programming, 2018
Julio Sanchez, Maria P. Canton
The interrupt handler, also called the interrupt service routine or the ISR, is the code that receives control upon occurrence of the interrupt. Most of the programming that goes into the service routine is specific to the application; however, there are certain housekeeping operations that should be included. The following list describes the structure of an interrupt service routine for the mid-range PICs: Preserve the value in the w register.Preserve the value of the STATUS register.Execute the application-specific operations.Restore the value of the STATUS register at the time of the interrupt.Restore the value of the w register at the time of the interrupt.Issue the RETFIE instruction to end the interrupt handler.
The central processing unit
Published in D.A. Bradley, N.C. Burd, D. Dawson, A.J. Loader, Mechatronics, 2018
D.A. Bradley, N.C. Burd, D. Dawson, A.J. Loader
There are three common approaches to saving the remaining CPU registers. The first of these involves the CPU automatically saving the contents of its programmable registers at the beginning of the ISR, and automatically restoring them on execution of the ‘return from interrupt’ instruction. This method may be convenient for the software programmer in that saving and restoring the CPU registers is done automatically, but it also has the disadvantage that it takes longer for the CPU to start executing instructions in the ISR immediately after the interrupt. This interrupt latency occurs because, for each register stored on the stack, the CPU must perform a write cycle to the stack in memory. The more registers the CPU has, the longer it takes to stack the registers and start executing the instructions in the ISR. In real-time systems, a short interrupt latency is required to allow a fast response to interrupts.
Modelling of a Nonlinear Fuzzy Three-Input PID Controller and Its Simulation and Experimental Realization
Published in IETE Technical Review, 2021
From Figure 24, it can be observed that the real-time digital control system mainly consists of four elements which are controlled process, PC with a clocked control algorithm, analogue to digital (A/D) and digital to analogue (D/A) converters, and a sensor. The interfacing between the external environment and the PC is achieved using A/D and D/A converters. The operation of the A/D and D/A converters and the control algorithm depends on the time pulses generated by the clock. The time duration between two consecutive pulses is defined as the sampling time. When the clock delivers an interrupt, an interrupt service routine (ISR) is called. During ISR, the A/D converter provides a discrete representation of the sensor measurement. Based on this measurement, the control effort is calculated via a control algorithm, which is fuzzy PID control in this case. In the end of ISR, the control signal value is updated and set by the D/A converter to be held for the next sampling interval.