An interrupt is a signal from a device attached to a computer or from a program within the computer that requires the operating system to stop and figure out what to do next.Whenever an interrupt occurs, it causes the CPU to stop executing the current program. Then comes the control to interrupt the handler or interrupt service routine.The steps in which ISR handle interrupts are as follows −Step 1 − When an interrupt occurs let assume processor is executing i'th instruction and program counter will point to the next instruction (i+1)th.Step 2 − When an interrupt occurs the program value ... Read More
Memory is a storage part in a computer system. It is used to store the data, information, and programs at the time of processing on the computer. It stores data either temporarily or permanent. The main use of memory is saving and retrieving data.Types of MemoryGenerally computer system consists of two types of memory −Primary Memory or Volatile MemoryIt is called the internal memory of the computer. And it is also known as main memory or Temporary memory. It holds the data and instructions that are presently working on the system or by the CPU. Primary Memory is called volatile ... Read More
We know that an operating system is a resource allocator and it manages all the resources which are associated with the system.Let us see how operating system design is related to basic elements of a computer systemRegistersRegisters are available in the processor. These registers are used for storage and data transfer in the processor.There are registers which perform the operation of storage of data. It is known as data register (DR) and the register which stores the address known as address register (AR) and program counter (PC) register which is used for storing the address of next instruction.After the instructions ... Read More
In this article, we’ll be solving the problem of removing a given word from a given string. For example −Input : str = “remove a given word ”, word = “ remove ” Output : “ a given word ” Input : str = “ god is everywhere ”, word = “ is ” Output : “ god everywhere ”Approach to find The SolutionFor example, we can use a simple approach to remove a word from a string.First, put the given string in 2-D matrix form, where each word is stored in each row.Find the word in the matrix ... Read More
A CPU register is a small and temporary storage containing a set of data holding places that are part of the computer processor. A register holds an instruction, a storage address, or any kind of data.Before trying to understand some special purpose registers, let us try to understand the difference between General purpose and special purpose registers.Special purpose registers hold the status of a program. These registers are designated for a special purpose. Some of these registers are stack pointer, program counter etc.General purpose registers hold the temporary data while performing different operations. Some of these registers are accumulator, BX ... Read More
User registers can read or write by machine instructions. The user registers are divided into data registers and address registers.Data registersThese registers hold the numeric data values like integers and, in some architectures, hold floating-point values, characters, small bit arrays and other data. In low end CPUs, a special data register, called the accumulator, is used implicitly for many operations.Address registersThese registers hold addresses and are used by instructions to indirectly access primary memory.Some of the processors contain registers that are used to hold an address or to hold numeric values. In some cases, it is used as an index ... Read More
In this article, we will discuss the problem of rearranging a given array of n numbers. Basically, we have to select elements from the array. For selecting each element, we get some points that will be evaluated by the value of the current element * a number of elements selected before the current element. You should select elements to get maximum points. For Example −Input : arr[ ] = { 3, 1, 5, 6, 3 } If we select the elements in the way it is given, our points will be = 3 * 0 + 1 * ... Read More
Control register is called a processor register that changes or controls the general behaviour of a CPU or other services in the system.The common tasks performed by control registers are interrupt control, switching the addressing mode, paging control, and coprocessor control.Types of CPU Control RegisterThe different types of CPU control register are as follows −The control registers are those extra registers that are visible only in kernel mode.CR0 - Reads as 0, read-onlyCR1 - For general-purpose useCR2 - For general-purpose useCR3 - For general-purpose use and TLB interfaceCR4 - Processor Status RegisterCR5 - Interrupt Status RegisterCR6 - Interrupt Mask RegisterCR7 ... Read More
General purpose registers are additional registers that are present in CPU which is used for either memory address or data whenever needed. For example, storing current register content when there is an interruption.8086 processorLet us consider an 8086 processor. There are eight general purpose register in 8086 microprocessor which are explained below −AXThis is the accumulator of 16 bits and is separated into two 8-bits registers AH and AL to likewise perform 8-bits instruction. It is usually utilized for arithmetical and logical directions, yet in 8086 chips it isn't required to have an accumulator as the objective operand.Example − ADD ... Read More
I/O Structure consists of Programmed I/O, Interrupt driven I/O, DMS, CPU, Memory, External devices, these are all connected with the help of Peripheral I/O Buses and General I/O Buses.Different types of I/O Present inside the system are shown below −Programmed I/OIn the programmed I/O when we write the input then the device should be ready to take the data otherwise the program should wait for some time so that the device or buffer will be free then it can take the input.Once the input is taken then it will be checked whether the output device or output buffer is free ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP