Capsule Notes CO
Capsule Notes CO
MODULE –I
CACHE MEMORY
Cache memory is a chip-based computer component that makes retrieving data from the
computer's memory more efficient.
Cache memory is fast and expensive
It acts as a temporary storage area that the computer's processor can retrieve data from easily.
Cache memory is sometimes called CPU (central processing unit) memory because it is typically
integrated directly into the CPU chip or placed on a separate chip that has a separate bus
interconnect with the CPU. Therefore, it is more accessible to the processor, and able to
increase efficiency, because it's physically close to the processor.
Cache memory operates between 10 to 100 times faster than RAM, requiring only a few
nanoseconds to respond to a CPU request.
Types of cache memory :-
L1 cache, or primary cache, is extremely fast but relatively small
L2 cache, or secondary cache, is often more capacious than L1. L2 cache may be embedded on
the CPU
Locality of Reference – it also known as the principle of locality, is the tendency of a processor to
access the same set of memory locations repetitively over a short period of time.
Locality of reference are of 2 types:-
1. Temporal Locality - Temporal locality refers to the tendency of a program to access the same
memory locations repeatedly within a short period of time
2. Spatial Locality- Spatial locality refers to the tendency of a program to access memory
locations that are physically close to each other. This means that if a particular data item is
accessed, nearby data items are likely to be accessed soon.
Virtual Memory
● Virtual memory is a memory management technique where secondary memory can be used as if it
were a part of the main memory.
● Virtual memory is a technique computers use to give the illusion of having more memory (RAM) than
they physically do.
● It does this by using a combination of RAM and disk space. When your computer runs out of physical
memory, it moves less frequently used data from RAM to a special file on the disk called a swap file or
page file. This frees up space in RAM for other tasks. When that data is needed again, it's moved back
into RAM
Module 2
Explain I/O interfacing with memory mapped i/o and program controlled I/O
I/O Interfacing
In computing, input/output, or I/O, refers to the communication between computers and the outside
world. There is a huge difference in speed of a processor and other peripheral components (I/O
devices). Therefore an I/O interface is needed to connect any external peripheral with computer. A
simple arrangement to connect I/O devices to a computer is to use a single bus structure. It consists of
three sets of lines to carry. They are address bus, control bus and data bus.
This figure illustrates the hardware required to connect an I/O device to the bus.
● the address decoder enables the device to recognize its address when this address appears on the
address lines.
●The data register holds the data being transferred to or from the processor.
● the status register contains information relevant to the operation of the I/O device.
● Both the data and status registers are connected to the data bus and assigned unique addresses.
MEMORY-MAPPEDI/O
ThearrangementofI/Odevicesandthememorysharethesameaddressspaceiscalled memory-
mapped I/O. With memory-mapped I/O, any machine instruction that can access memory can
be used to transfer data to or from an I/O device.
PROGRAMMEDI/O
They are the result of i/o instructions written in the computer program
Transferring data under program control requires constant monitoring of the peripheral by the
CPU
The processor executes a program that gives it direct control of the I/O operation, including
sensing device status, sending a read or write command, and transferring the data.
When the processor issues a command to the I/O module, it must wait until the I/O operation is
complete.
Disadvantage: CPU is waiting time by checking flag .
The working of programmed i/o is shown below.
INTERRUPTS
The interrupt is a signal emitted by hardware (may be i/o device) or software when a process or
an event needs immediate attention.
When more than one device raises an interrupt request signal, then additional information is
needed to decide which device to be considered first. The following methods are used to decide
which device to select
Polling, Vectored Interrupts, and Interrupt Nesting.
Polling: In polling, the first device encountered with IRQ bit set is the device that is to be
serviced first. Appropriate ISR is called to service the same. It is easy to implement but a lot of
time is wasted by interrogating the IRQ bit of all devices
Vectored Interrupts: In vectored interrupts, a device requesting an interrupt identifies itself
directly by sending a special code to the processor over the bus. This enables the processor to
identify the device that generated the interrupt. The special code can be the starting address of
the ISR or where the ISR is located in memory, and is called the interrupt vector.
Interrupt Nesting: In this method, I/O device is organized in a priority structure. Therefore,
interrupt request from a higher priority device is recognized whereas request from a lower
priority device is not. Processor accepts interrupts only from devices/processes having priority
more than it
DIRECT MEMORY ACCESS (DMA)
● It is a technique used for high speed I/O device.
●Here, the device interface transfer data directly to or from the memory without continuous
involvement by the processor
● A special control unit may be provided to allow the transfer of large block of data at high speed
directly between the external device and main memory, without continuous intervention by the
processor. This approach is called DMA.
● DMA transfers are performed by a control circuit called the DMA Controller.
DMA controller Transfers the block of data to and from memory in three modes burst mode, cycle
steal mode and transparent mode.
1. Burst Mode: Here, once the DMA controller gains the charge of the system bus, then it releases the
system bus only after completion of data transfer. Till then the CPU has to wait for the system buses.
2. Cycle Stealing Mode: In this mode, the DMA controller forces the CPU to stop its operation and
relinquish the control over the bus for a short term to DMA controller. After the transfer of every byte,
the DMA controller releases the bus and then again requests for the system bus. In this way, the DMA
controller steals the clock cycle for transferring every byte.
3. Transparent Mode: Here, the DMA controller takes the charge of system bus only if the processor
does not require the system bus.
Module 3
EXECUTING AN INSTRUCTION
A program is a set of instructions performing a meaningful task. An instruction is command to the
processor & is executed by carrying out a sequence of sub-operations called as micro-operations.
Processor fetches one instruction at a time and performs the operation specified.
Instructions are fetched from successive memory locations until a branch or a jump instruction is
encountered.
Processor keeps track of the address of the memory location containing the next instruction to be
fetched using Program Counter (PC).
Instruction Register (IR) stores currently executing instruction
Two phases of executing an instruction:-
1. Fetch phase
2. Execution phase
Fetch the contents of the memory location pointed to by the PC.
The contents of this location are loaded into the IR (fetch phase).
IR ← [[PC]]
Assuming that the memory is byte addressable, increment the contents of the PC by 4 (fetch
phase). PC ← [PC] + 4
Carry out the actions specified by the instruction in the IR (execution phase).
Explain about Internal Structure of a CPU
Internal organization (Functional units) of a processor contains:
● Registers for temporary storage
● Various digital circuits for executing different micro operations.(gates, MUX, decoders,
counters).
●internal path for movement of data between ALU and registers.
● Driver circuits for transmitting signals to external units. Receiver circuits for incoming signals
from external units.
PC:
❖ Keep track of execution of a program
❖ Contains the memory address of the next instruction to be fetched and executed.
MAR:
❖ Holds the address of the location to be accessed
. ❖ I/P of MAR is connected to Internal bus and an O/p to external bus.
MDR:
❖ Contains data to be written into or read out of the addressed location.
❖ Data can be loaded into MDR either from memory bus or from internal processor bus. ● The
data and address lines are connected to the internal bus via MDR and MAR
Registers:
❖ The processor registers R0 to Rn-1 vary considerably from one processor to another.
❖ Registers are provided for general purpose used by programmer.
❖ Special purpose registers-index & stack registers
❖ Registers Y,Z &TEMP are temporary registers used by processor during the execution of
some instruction.
Multiplexer:
❖ Select either the output of the register Y or a constant value 4 to be provided as input A of
the ALU
❖ Constant 4 is used by the processor to increment the contents of PC.
ALU:
Used to perform arithmetic and logical operation.
Data Path:
❖ The registers, ALU and interconnecting bus are collectively referred to as the data path.
Functions of Bus Interface Unit
It sends address of the memory or I/O.
It fetches instruction from memory.
It reads data from port/memory.
It Writes data into port/memory.
It supports instruction queuing.
Instruction Queue:
•To speed up program execution, the BIU fetches six instruction bytes ahead of time from
the memory.
• These pre-fetched instruction bytes are held for the execution unit in a group of registers
called Queue.
• With the help of queue it is possible to fetch next instruction when current instruction is
in execution.
• During this execution time the BIU fetches the next instruction or instructions from
memory into the instruction queue.
Execution Unit[EU]
The execution unit of 8086 Internal Architecture tells the BIU from where to fetch
instructions or data, decodes instructions and executes instructions. It contains :-
Control Circuitry • Instruction Decoder • Arithmetic Logic Unit (ALU) • Flag Register
• General Purpose Registers • Pointers and Index Registers
Mention the purpose of segment registers of 8086
The 8086 microprocessor uses segment registers to address memory locations.
It uses a segmented memory model, which means memory is divided into segments, and the
segment registers hold the starting address of these segments.
Here are the four main segment registers and their purposes:
1. Superscalar Architecture: The Pentium processor features a dual pipeline that allows it to
execute two instructions simultaneously, improving processing speed compared to earlier
processors like the 486, which could only execute one instruction at a time.
2. 64-bit Data Bus: The Pentium has a 64-bit external data bus, which allows it to transfer more
data at once between the processor and memory, enhancing performance. Internally, it
processes data using a 32-bit architecture.
3. Branch Prediction: Pentium processors include branch prediction technology, which predicts
the outcome of conditional operations. This helps to reduce delays by pre-loading instructions,
thus improving execution efficiency.
SELF EVALUATION SHEET
SL TOPIC STUDIED/NOT SIGNATURE SIGNATURE OF
NO. STUDIED OF STUDENT STAFF
1. Functional Units of a computer system
2. Bus interconnection
3. SRAM & DRAM comparison
4. Memory Hierarchy
5. Cache Memory
6. Virtual Memory
9. DMA
15. Pipelining