Please enable JavaScript.
Coggle requires JavaScript to display documents.
COA - Coggle Diagram
COA
Computer System
-
-
Bus
A more efficient scheme for transferring information
between registers in a multiple-register configuration is a common bus system
Bus Access
Three-State Bus Buffers
-
Control Input
-
0
Because of this feature, a large number of three-state gate outputs can be connected with wires to form a common bus line without endangering loading effects
-
-
-
-
The high-impedance state behaves like an open circuit, which means that the output is disconnected and does not have a logic significance
-
Multiplexers
The transfer of information from a bus into one of many destination registers can be accomplished by connecting the bus lines to the inputs of all destination registers and activating the load control of the particular destination register selected
A bus system will multiplex k registers of n bits each to pro-
duce an n-line common bus. The number of multiplexers needed to construct the bus is equal to n, the number of bits in each register. The size of each multiplexer must be k x 1 since it multiplexes k data lines
A typical digital computer has many registers, and paths must be provided to transfer information from one register to another
The number of wires will be excessive if separate lines are used between each register and all other registers in the system
Control signals determine which register is selected by the bus during each particular register transfer
A bus structure consists of a set of common lines, one for each bit of a register, through which binary information is transferred one at a time
Memory Transfer
Memory Representation
Examples
-
Read
The data are transferred to another register, called the data register, symbolized by DR
Consider a memory unit that receives the address from a register, called the address register, symbolized by AR
-
-
-
The particular memory word among the many available is selected by the memory address during the transfer
-
Operations
Read
The transfer of information from a memory word to the outside environment is called a read operation
-
Memory
Cache Memory
It facilitates the transfer of data between the processor and the main memory at the speed which matches to the speed of the processor
Cache Mapping
Techniques
-
-
Physical Address
Block/Line Offset
Short cut
- 4 more items...
Tag
-
The address requested by CPU is compared by converting it into tag and cache line and looking for the tag in the corresponding cache line.
-
-
-
-
Implementation 1
Comparator
- 2 more items...
Multiplexer
- 4 more items...
Implementation 2
-
Comparator
- 1 more item...
-
Cache mapping defines how a block from the main memory is mapped to the cache memory in case of a cache miss.
-
During cache mapping, block of main memory is simply copied to the cache and the block is not actually brought from the main memory.
-
-
-
-
Cache Operation
-
If the required word is found in the CPU registers, it is read from there.
Whenever CPU requires any word of memory, it is first searched in the CPU registers.
-
Execution of Program
-
The portion of the program that is mostly probably going to be executed in the near future is kept in the cache memory.
Whenever any program has to be executed, it is first loaded in the main memory.
-
-
-
-
-
-
-
-
Memory Hierarchy
Levels
Level 1
At level-1, Cache Memory is present
-
-
-
Level 2
-
It can communicate directly with the CPU and with auxiliary memory devices through an I/O processor.
At level-2, main memory is present
RAM
DRAM
-
-
DRAM cells are usually organized into a square matrix, with separate decoders for the rows and columns
-
-
-
-
-
RAM Chip Organization
- 5 more items...
-
-
Level 3
Performance
-
The time taken by the disk to complete an I/O request is called as disk service time or disk access time
-
-
Important Formulas
-
Average Disk Access Time
Average disk access time
= Average seek time + Average rotational delay + Transfer time + Controller overhead + Queuing delay
Disk Access Time
Disk access time
= Seek time + Rotational delay + Transfer time + Controller overhead + Queuing delay
Magnetic disk is a storage device that is used to write, rewrite and access data.
-
At level-3, secondary storage devices like Magnetic Disk are present.
-
-
Level 0
-
-
At level-0, registers are present which are contained inside the CPU
Since they are present inside the CPU, they have least access time.
Level 4
-
-
At level-4, tertiary storage devices like magnetic tape are present.
-
-
It ranges from the slowest but high capacity auxiliary memory to the fastest but low capacity cache memory.
Memory Addressing Modes
-
Indirect Addressing Mode
The address field of the instruction specifies the address of memory location that contains the effective address of the operand.
-
-
-
-
-
-
-
-
Displacement Addressing
Effective address of the operand is obtained by adding the content of index register with the address part of the instruction.
-
-
Relative Addressing Mode
Effective address of the operand is obtained by adding the content of program counter with the address part of the instruction.
Then, the operand value is fetched.
First, the instruction register RAUTO value is decremented by step size ‘d’.
Examples
ADD R1, -(R2) is interpreted as R2 ← [R2] – d followed by R1 ← [R1] + [[R2]]
Load R1, -(R2) is interpreted as R2 ← [R2] – d followed by R1 ← [[R2]]
-
After accessing the operand, the content of the register is automatically incremented by step size ‘d’.
-
-
Examples
ADD R1, (R2)+ is interpreted as R1 ← [R1] + [[R2]] followed by R2 ← [R2] + d
Load R1, (R2)+ is interpreted as R1 ← [[R2]] followed by R2 ← [R2] + d
This addressing mode is a special case of Register Indirect Addressing Mode where-
Effective Address of the Operand = Content of Register
-
Pipelining
-
Hazards
Types
Data Hazards
Types
WAW(OD)
-
WAW hazards occur only in pipelines that write in more than one stage, or allow an instruction to proceed even when a previous instruction is stalled
-
-
-
-
Dependency
True Dependent
Inst2 is (true) data dependent on Inst1, if Inst1 writes its output in a register Reg (or memory location) that Inst2 reads as its input
Anti Dependent
Inst2 is antidependent on Inst1, if Inst1 reads data from a register Reg(or memory location) which is subsequently overwritten by Inst2
Output Dependent
Inst2 is output dependent on Inst1 if both write in the same register Reg(or memory location) and Inst2 writes its output after Inst1
Control Dependent
Inst2 is control dependent on Inst1, if Inst1 must complete before a decision can be made whether or not to execute Inst2
Structural Hazards
A structural hazard occurs when two (or more) instructions that are already in pipeline need the same resource
The result is that instruction must be executed in series rather than parallel for a portion of pipeline
-
Control Hazards
Control hazards arise from branch, jump, and other control flow
change instructions
-
-
-
-
Stalls
If branch decision is taken nth stage, then there is a stall of n-1 cycles
-
-
-
Stall happens due to the draining of the instructions that are part of the branch not taken path due to the branch being taken
-
-
-
-
EX
Arithmetic operations, or calculate effective address for memory instructions, branch condition and branch target address calculated for branch instructions
MEM
Load reads, store writes with address calculated in previous stage. Other instructions do not use this stage.
ID
Instruction is decoded in the control unit to decide what has to be done, the source registers are read from the register file
WB
Write data back to register file, not applicable to branch instructions
IF
Instruction is fetched from memory based on PC address, and PC is incremented so that it points to the next instruction
IO
DMA
It refers to transfer of data directly between a fast storage device and memory bypassing CPU because of its limited speed
DMA provides a significant improvement in terms of latency and throughput as it allows the I/O device to access the memory directly, without using the processor
Direct memory access (DMA) controller takes over the control of buses to manage the transfer directly between the I/O device and memory
Bus Handling
Bus request(BR) and Bus grant (BG) signals are used by the
DMA controller to request the CPU to relinquish control of the buses and get the control of system buses
One common method CPU may be placed in an idle state extensively used in microprocessors is to disable the buses through special control signals
Bus Request
The bus request (BR) input is used by the DMA controller to request the CPU to relinquish control of the buses
When this input is active, the CPU terminates the execution of the current instruction and places the address bus, the data bus, and the read and write lines into a high-impedance state
The high-impedance state behaves like an open circuit, which means that the output is disconnected and does not have a logic
significance
Bus Grant
The CPU activates the bus grant (BG) output to inform the external DMA that the buses are in the high-impedance state
The DMA that originated the bus request can now take control of the buses to conduct memory transfers without processor intervention
When the DMA terminates the transfer, it disables the bus request line
The CPU disables the bus grant, takes control of the buses, and returns to its normal operation
The DMA controller uses hold request (HOLD) and hold acknowledge (HOLDA) signals to ask the CPU to stop driving the address, data and control buses so that the DMA controller can drive them to carry out a transfer
Each time the peripheral is ready to transfer a byte it asserts its DMA request(DRQ) line to the DMA controller
The DMA controller asserts the CPU’s hold request(HRQ) pin
When the CPU control circuitry is able to suspend execution (at the end of an instruction or by inserting wait states in T2) it asserts the hold acknowledge (HOLDA) signal to the
DMA controller and floats (“tri-states”) the address, data and control bus signals
The DMA controller then puts the memory address on the address bus, asserts either MEMR* plus IOW* or MEMW* plus IOR* on the control bus and asserts the appropriate DMA acknowledge line to the peripheral
The peripheral responds to the DMA acknowledge signal by reading or writing it’s data to the data bus
At the same time the memory responds to the
MEMR*/MEMW* control signal which causes
the data to be read/written directly from/to memory
At the end of the bus cycle the DMA controller
then negates hold request line and the CPU can
continue to execute until the next DMA request
-
To transfer a block of data between an I/O device and memory,
the controller stores initial values in the address register
The DMA channel then transfers the block of information from or to memory according to the control register
The starting address of the block in memory is given by the address register, and the length of the bytes to transfer is given by the word count register
-
Mode of Operation
-
Cycle stealing mode
In this mode, the DMA controller obtains access to the system buses like burst mode; but after one word of data transfer, the control of the system bus is released back to the CPU via
BG
It is then continually requested again via BR, transferring one byte of data per request, until the entire block of data has been transferred
This mode is suitable for the systems in which the CPU cannot
be disabled for the considerable length of time as in burst transfer modes such as for controllers monitoring the data in real time
The advantage is that CPU is not idled for as long as in burst mode, but the data block is not transferred as quickly
It is also called Interleaved DMA as it allows other memory transfers to be interleaved with the DMA
Single cycle DMA is better suited to transferring data over longer
periods of time, where there is enough time to acquire and release the bus for every word transferred
In this case, the CPU and other devices can still access the memory, at a reduced bandwidth. As a result, the CPU may be a bit slower because it will sometimes have to wait for a DMA cycle to complete, but it is not entirely shut out when a DMA transfer is in progress
When a single cycle DMA transfer occurs, more time is used in acquiring and transferring control of the memory to and from the DMA controller since it happens so much more frequently
This “overhead” frequently reduces the overall available memory bandwidth, especially when it is performed sequentially with the data transfers
Some systems overlap the memory bus arbitration handshaking with the memory data transfers so that the arbitration does not slow down the data transfers
Steps
-
-
-
-
For 1 byte of transfer of data, time taken by using cycle stealing mode (T) = time required for bus grant + 1 bus cycle to transfer data + time required to release the bus
Transparent mode
-
The DMA controller transfers data only when the CPU is busy in performing operations that do not use the system buses
So, the CPU never stops executing its programs but the biggest disadvantage is complex hardware circuitry that needs to determine when the CPU is not using the system buses
-
-
With Interleaved DMA, each data transfer includes 1 byte per instruction cycle
-
The microprocessor doesn't use the bus when it performs internal operations, such as decoding an instruction or ALU operations
-
Steps
Two Step
DMA controllers can transfer data in a two-step process by reading a value from one port or address in one bus cycle and writing that value to another port or address in a second bus cycle
Single Step
It is also possible for the DMA controller to carry out read and write operations simultaneously. In this case the data is
transferred directly between the I/O device and memory in the same bus cycle
-
DMA is a method for coordinating the data transfers between an I/O device and the core processing unit or memory in a computer
-
Interrupt Initiated IO
This mode uses an interrupt facility and special commands to inform the interface to issue the interrupt command when data becomes available and interface is ready for the data transfer
-
When the flag is set, the interface is informed and an interrupt is initiated
-
The CPU responds to the signal by storing the return address from the program counter (PC) into the memory stack and then branches to service that processes the I/O request
After the transfer is complete, CPU returns to the previous task it was executing
The branch address of the service can be chosen in two ways known as vectored and non-vectored interrupt
In vectored interrupt, the source that interrupts, supplies the branch information to the CPU while in case of non-vectored interrupt the branch address is assigned to a fixed location in memory
Programmed IO
-
An input instruction is required to store the data from the device to the CPU and a store instruction is required to transfer the data from the CPU to the device
Data transfer through this mode requires constant monitoring of the peripheral device by the CPU and also monitor the possibility of new transfer once the transfer has been initiated
-
Thus programmed I/O is a time consuming process that keeps the processor busy needlessly and leads to wastage of the CPU cycles
Architecture
-
-
Components
CPU
-
-
-
Instructions
Operation Code
-
Having a single instruction length is simpler and makes decoding easier, but is less efficient
Algorithm
-
-
-
If address size if k bits, for m address fields, the opcode size will be n-m*k
For m-1 address fields, the opcode size is n-(m-1)k with the prefix being the last value of n-(m-1)k-bit, m address opcode + 1
-
This logic can be applied recursively with the prefix of the previous opcode and the last value of the current op code + 1 will be the prefix of the next opcode
-
-
-
-
-
-
-
-
Interrupt
-
-
The CPU enters into a subroutine known as interrupt service subroutine (ISS) to transfer data from the device
-
-
-
An interrupt caused by an external signal applied to an interrupt input line of a CPU is known as hardware/external interrupt
Enable/Disable
Enabling of Interrupts
When interrupts are to be used they are enabled (made effective) using instruction EI (it is an 8085 instruction) in the main program
Disabling of Interrupts
When the microprocessor is performing certain important task it may be desired to prevent the occurrence of interrupts during that period
This is achieved using DI instruction. The use of DI instruction in the program prevents occurrence of all the interrupts
Masking
In certain situations it may be desired that some of the several interrupts should not occur while microprocessor is performing some important task
-
-
-
Types
Software Interrupts
-
-
Transitions from kernel to user mode are performed explicitly by the operating system, generally at the end of an interrupt handler or kernel call, using a privileged RFE (return from exception) instruction
-
The normal program execution of a microprocessor can be interrupted by a special instruction in the program
It can be used by the programmer to initiate an interrupt procedure at any desired point in the program. This instruction provides means for switching from a CPU user mode to the supervisor mode
Software interrupt is a special call instruction that behaves like
an interrupt rather than a subroutine call
-
-
External/Hardware
-
External interrupts depend on external conditions that are independent of the program being executed at the time
-
Interrupt Handling
The hardware procedure for processing an interrupt is very similar to the execution of a subroutine call instruction
The state of the CPU is pushed into a memory stack and the beginning address of the service routine is transferred
to the program counter
The beginning address of the service routine is determined by the hardware rather than the address field of an instruction
-
-
-
-
-
Just before going to the next fetch phase, control checks for any
interrupt signals
CPU State Handling
-
PSW
The PSW is stored in a separate hardware register and contains the status information that characterizes the state of the CPU
The collection of all status bit conditions in the CPU is sometimes called a program status word or PSW
-
Saving Registers
-
The service program must then include instructions to store status and register content before these resources are used
Only a few computers store both program counter and all status and register content in response to an interrupt
-
In some cases, there exist two sets of processor registers within the computer, one for each CPU mode. In this way, when the program switches from the user to the supervisor mode (or vice versa) in response to an interrupt, it is not necessary to store the contents of processor registers as each mode uses its own
set of registers
Priority
A priority interrupt is a system that establishes a priority over the various sources to determine which condition is to be serviced first when two or more requests arrive simultaneously
The system may also determine which conditions are permitted to interrupt the computer while another interrupt is being serviced
Higher-priority interrupt levels are assigned to requests which,
if delayed or interrupted, could have serious consequences
Software-Polling
-
-
-
The program that takes care of interrupts begins at the branch address and polls the interrupt sources in sequence
-
The highest priority source is tested first, and if its interrupt signal is on, control branches to a service routine for this source
Otherwise, the next-lower-priority source is tested, and so on
Thus the initial service routine for all interrupts consists of a program that tests the interrupt sources in sequence and branches to one of many possible service routines
The particular service routine reached belongs to the highest-priority device among all devices that interrupted the computer
The disadvantage of the software method is that if there are many
interrupts, the time required to poll them can exceed the time available to service the I/O device
-
When two devices interrupt the computer at the same time, the computer services the device, with the higher priority first
Devices with highspeed transfers such as magnetic disks are given high priority, and slow devices such as keyboards receive low priority
Hardware
A hardware priority-interrupt unit functions as an overall manager in an interrupt system environment
It accepts interrupt requests from many sources, determines which of the incoming requests has the highest priority, and issues an interrupt request to the computer based on this determination
To speed up the operation, each interrupt source has its own interrupt vector to access its own service routine directly
Thus no polling is required because all the decisions are established by the hardware priority-interrupt unit
The hardware priority function can be established by either a serial or a parallel connection of interrupt lines
Serial Connection
The daisy-chaining method of establishing priority consists of a serial connection of all devices that request an interrupt.
The device with the highest priority is placed in the first position, followed by lower-priority devices up to the device with the lowest priority, which is placed last in the chain
-
If any device has its interrupt signal in the low-level state, the interrupt line goes to the low-level state and enables the interrupt input in the CPU
When no interrupts arc pending, the interrupt line stays in the high-level state and no interrupts are recognized by the CPU
-
-
-
The acknowledge signal passes on to the next device through the PO (priority out) output only if device 1 is not requesting an interrupt
If device 1 has a pending interrupt, it blocks the acknowledge signal from the next device by placing a 0 in the PO output
It then proceeds to insert its own interrupt vector address (VAD) into the data bus for the CPU to use during the interrupt cycle
Parallel
The parallel priority interrupt method uses a register whose bits are set separately by the interrupt signal from each device
-
In addition to the interrupt register, the circuit may include a mask register whose purpose is to control the status of each interrupt request
-
The mask register can be programmed to disable lower-priority interrupts while a higher-priority device is being serviced
It can also provide a facility that allows a high-priority device to interrupt the CPU while a lower-priority device is being serviced
The priority logic consists of an interrupt register whose individual bits are set by external conditions and cleared by program instructions
Another output from the encoder sets an interrupt status flip-flop IST when an interrupt that is not masked occurs
The interrupt enable flip-flop IEN can be set or cleared by the program to provide an overall control over the interrupt system
-
The interrupt acknowledge INTACK signal from
the CPU enables the bus buffers in the output register and a vector address VAD is placed into the data bus
Priority Encoder
-
The logic of the priority encoder is such that if two or more inputs arrive at the same time, the input having the highest priority will take precedence
Interrupt Cycle
-
When IEN is cleared, the interrupt request coming from
IST is neglected by the CPU
-
If an instruction to clear IEN has been inserted in the program, it means that the user does not want his program to be interrupted
An instruction to set IEN indicates that the interrupt facility will be used while the current program is running
Most computers include internal hardware that clears IEN to 0 every time an interrupt is acknowledged by the processor
-
If either is equal to 0, control continues with the next
instruction
If both IEN and IST are equal to 1, the CPU goes to an interrupt
cycle
Interrupt cycle ops
- 6 more items...
Software Routines
-
The computer must have software routines for servicing the interrupt requests and for controlling the interrupt hardware registers
-
RISC/CISC
RISC
-
Simpler instructions, hence simple instruction decoding.
-
-
-
-
-
-
-
-
-
CISC
The CISC approach attempts to minimize the number of instructions per program but at the cost of increase in number of cycles per instruction
Complex instruction, hence complex instruction decoding.
-
-
-
-
-
-
-
-
-
-
-
Bus
-
-
Three State Bus Buffers
-
-
Two of the states are signals equivalent to logic 1 and 0 as in a conventional gate, with the third being a high impedance state
The high-impedance state behaves like an open circuit, which means that the output is disconnected and does not have
a logic significance
-
Interrupt
Priority Interrupt
A priority interrupt is a system that establishes a priority over the various sources to determine which condition is to be serviced first when two or more requests arrive simultaneously
The system may also determine which conditions are permitted to interrupt the computer while another interrupt is being serviced
Devices with highspeed transfers such as magnetic disks are given high priority, and slow devices such as keyboards receive low priority
Higher-priority interrupt levels are assigned to requests which,
if delayed or interrupted, could have serious consequences
When two devices interrupt the computer at the same time, the computer services the device, with the higher priority first
Daisy-Chaining Priority
The daisy-chaining method of establishing priority consists of a serial connection of all devices that request an interrupt
The device with the highest priority is placed in the first position, followed by lower-priority devices up to the device with the lowest priority, which is placed last in the chain
-
If any device has its interrupt signal in the low-level state, the interrupt line goes to the low-level state and enables the interrupt input in the CPU
When no interrupts are pending, the interrupt line stays in the high-level state and no interrupts are recognized by the CPU
Priority In/Out
Priority Out
The acknowledge signal(PI) passes on to the next device through
the PO (priority out) output only if the is not requesting an interrupt
If device 1 has a pending interrupt, it blocks the acknowledge signal from the next device by placing a 0 in the PO output
-
It then proceeds to insert its own interrupt vector address (VAD) into the data bus for the CPU to use during the interrupt cycle
-
-
Interrupt handlers
-
-
Bottom Half
A bottom half is used to process data, letting the top half to deal with new incoming interrupts
-