CSC 308 Lecture Note
CSC 308 Lecture Note
There are two types of control unit: the hardwired control unit and the micro programmed control
unit. Instructions are executed with the help of these two control units.
In the hardwired control unit, the execution of operations is much faster, but the implementation,
modification, and decoding are difficult. In contrast, implementing, modifying, decoding micro-
programmed control units is very easy. The micro-programmed control unit is also able to handle
complex instructions. With the help of control signals generated by micro-programmed and
hardwired control units, fetching and execution of instructions are done.
Control Signals
The functionality of a processor's hardware is operated with the help of control signals. The control
signals function as described below:
Control signals are used to know what operation is going to be performed.
They are used to know about the sequence of operations that are performed by the
processor.
They are used to know about the timing at which an operation must be executed and
many other types of things.
The Instruction Register is a type of processor register used to contain an instruction that is
currently in execution. The instruction register is used to generate the OP-code bits respective of
the operation as well as the addressing mode of operands.
The above generated Op-code bits are received in the field of an instruction decoder. The
instruction decoder interprets the operation and instruction's addressing mode. Now on the basis
of the addressing mode of instruction and operation which exists in the instruction register, the
instruction decoder sets the corresponding Instruction signal INSi to 1. Some steps are used to
execute each instruction, i.e., instruction,
fetch, decode, operand fetch, Arithmetic and logical unit, and memory store. In general, these
five steps are used to execute an instruction.
The information about the current step of instruction must be known by the control unit. The Step
Counter is implemented, which is used to contain the signals. For the step counter to know about
the current step of instruction, a Clock is implemented. The one-clock cycle of the clock will be
completed for each step.
When the execution in current step is completed, the Counter Enable will "disable" the Step
Counter so that it will stop, then increment to the next step signal.
The Condition Signals is used if the execution of instruction depends on some conditions. There
are various conditions in which the signals are generated with the help of control signals that can
be less than, greater than, less than equal, greater than equal, and many more.
The external input is the last one. It is used to tell the Control Signal Generator about the
interrupts, which will affect the execution of an instruction.
So, on the basis of the input obtained by the conditional signals, step counter, external inputs, and
instruction register, the control signals will be generated with the help of Control signal
Generator.
1.2 Micro-programmed Control Unit (MCU)
A micro-programmed control unit is a control unit whose binary control values are saved as words
in memory. A micro-programmed control unit is a simple logic circuit, useful in two ways, i.e., it
is able to execute each instruction with the help of generating control signals, and it is also able to
do sequencing through microinstructions. It will generate the control signals with the help of
programs. The program which is used to create the control signals is known as the "Micro-
program". The micro-program is placed on the processor chip, which is a type of fast memory.
This memory is also known as the control store or control memory.
A micro-program is used to contain a set of microinstructions (or control word), each of which
contains different bit patterns. The n bit words are contained by each microinstruction. On the
basis of the bit pattern of a control word, every control signals differ from each other.
The instruction execution in a micro-programmed control unit is also performed in steps, as in the
hardwired CU. So for each step, the micro-program contains a control word/ microinstruction. To
execute a particular instruction, a sequence of microinstructions is needed. This process is known
as the micro-routine.
Disadvantages
The following are the disadvantages of Hardwired control unit:
The complexity of the design increases as it requires more control signals to be
generated (need of more encoders & decoders)
Modifications in the control signals are very difficult because it requires
rearranging of wires in the hardware circuit.
Adding a new feature is difficult & complex.
Difficult to test & correct mistakes in the original design.
It is Expensive.
The speed of the processing element in the SISD model is limited by the rate at which the computer
can transfer information internally. SISD architectures are often found in:
Characteristics:
i. Single Instruction Stream: SISD systems follow a single sequence of instructions.
This means that only one instruction is fetched, decoded, and executed at a time by the
processor.
ii. Single Data Stream: Only one data element is processed per instruction. Unlike more
advanced architectures like SIMD (Single Instruction, Multiple Data) or MIMD
(Multiple Instruction, Multiple Data), SISD processes one piece of data with each
instruction.
iii. Sequential Processing: Since only one instruction and one data element are involved,
SISD systems work sequentially. There’s no parallelism, meaning the processor can
only execute one operation at a time.
iv. Traditional Processor Design: SISD is found in older, simpler microprocessor
designs. Early computers, like those based on the von Neumann architecture, followed
the SISD model.
Advantages:
i. Simplicity: SISD systems are simple to design and implement since there’s no need for
parallel processing mechanisms or complex hardware.
ii. Cost-Effective: Due to their simplicity, SISD systems are typically less expensive to
manufacture, making them ideal for basic computing tasks.
Disadvantages:
i. Limited Performance: SISD systems are inherently slower than systems with parallelism
(like SIMD or MIMD) because each instruction works on only one piece of data at a time.
This makes SISD less efficient for tasks requiring large-scale computation.
ii. No Parallelism: There is no way to perform multiple operations simultaneously, which
limits its performance on modern, data-intensive applications like scientific computing or
large-scale simulations.
This approach is highly efficient for operations involving large datasets, where the same operation
needs to be performed repeatedly across many data elements.
SIMD is commonly used in multimedia processing (like image, video, and audio processing),
scientific computations, and machine learning.
Characteristics of SIMD:
i. Single Instruction Stream: One instruction operates on multiple data elements at the same
time.
ii. Multiple Data Streams: SIMD allows multiple data elements to be processed at the same
time. For example, an instruction that adds a constant to an entire array of values would
apply the addition operation to each element of the array concurrently.
iii. Parallelism: The core strength of SIMD lies in its ability to perform operations in parallel.
By applying the same instruction to multiple data elements, SIMD processors can
dramatically improve performance for data-heavy tasks, especially those that involve
repetitive calculations.
iv. Vector Processors and GPUs: Often found in vector processors and graphical processing
units (GPUs), where large datasets (like pixel data, matrix operations, or vectors) can be
processed efficiently in parallel.
Advantages:
i. Increased Performance: SIMD significantly improves performance for tasks that involve
large-scale repetitive computations.
ii. Efficient Use of Resources: SIMD allows processors to maximize their hardware
capabilities, making it more efficient than sequential execution.
iii. Energy Efficiency: By reducing the number of instructions required to process multiple
data elements, SIMD architectures can also help reduce energy consumption compared to
traditional SISD systems.
Disadvantages:
i. Limited Flexibility: SIMD is not suitable for tasks that involve operations on different
kinds of data or require complex decision-making for each element.
ii. Data Alignment and Memory Access: SIMD systems typically require that data be
organized and aligned in specific ways for optimal performance. Misalignment can lead to
inefficiencies or slowdowns in execution.
iii. Software Complexity: Writing software to take full advantage of SIMD may require
specialized knowledge, as developers need to ensure that the data is structured properly.
Disadvantages:
i. Complexity and Efficiency: MISD is rarely used in practice because the requirement for
multiple instructions on a single data stream is not common. Most problems in computing
can be more effectively solved using other paradigms like SIMD or MIMD, where
parallelism is applied across multiple data points rather than focusing on a single data
element.
ii. Limited Applicability: The types of applications where MISD would be useful are few.
Most tasks in modern computing involve processing multiple data elements at once, rather
than applying many instructions to one piece of data.
iii. Increased Hardware Requirements: Implementing MISD would require specialized
hardware to handle multiple instructions at the same time for a single data stream, which
increases the complexity and cost of the system.
Fault Tolerant Systems: In systems where data integrity and reliability are paramount
(e.g., space systems, critical military applications, or nuclear reactors), MISD architectures
could be used to apply multiple checks or operations to the same data for reliability
purposes.
High-Security Applications: In environments where high-security encryption or
processing of sensitive data is required, MISD might be used to apply multiple security
protocols to the same data in parallel to ensure robustness.
Error Detection and Correction: MISD can be used in systems designed to detect errors
in critical data by applying multiple distinct operations to ensure correctness. This could
be relevant in contexts where precision and failure prevention are more important than
speed.
Pipelining refers to the technique in which a given task is divided into a number of subtasks that
need to be performed in sequence. Each subtask is performed by a given functional unit. The
units are connected in a serial fashion and all of them operate simultaneously.
Types of Pipeline:
It is divided into 2 categories:
i. Arithmetic Pipeline- Arithmetic pipelines are usually found in most of the computers.
They are used for floating point operations, multiplication of fixed point numbers etc.
ii. Instruction Pipeline- This is discussed further below.
Instruction pipelining is a technique used in modern processors to improve their performance by
overlapping the execution of multiple instructions. A stream of instructions can be executed by
overlapping fetch, decode and execute phases of an instruction cycle.
It allows the processor to work on several instructions at the same time, each at different stages of
execution, rather than executing one instruction completely before moving on to the next. This
process can increase throughput and overall performance of the computer system. The pipeline
will be more efficient if the instruction cycle is divided into segments of equal duration.
A typical pipeline consists of several stages, with each stage responsible for a specific part of the
instruction cycle. A simple five-stage pipeline might look like this:
Example of Pipelining:
Without pipelining, the processor would execute them one by one, completing the ADD before
starting the SUB, and completing the SUB before starting the MUL.
With pipelining, while the ADD instruction is being executed, the SUB can be decoded and the
MUL can be fetched, effectively utilizing the CPU's resources more efficiently.
Advantages:
Increased throughput: More instructions can be completed in a given period, improving
overall performance.
Reduced execution time: Pipelining enables faster execution because different stages of
multiple instructions can occur simultaneously.
Disadvantages
The design of pipelined processor is complex and costly to manufacture.
The instruction latency (the time it takes for an instruction to complete in a pipelined
processor) is more.
Hazards: Potential problems may arise when instructions depend on the results of
previous instructions, leading to pipeline stalls or delays.
o Data hazards: Occur when an instruction depends on the result of a previous
instruction.
o Control hazards: Occur when the flow of control changes (like in branches),
affecting the instruction pipeline.
o Structural hazards: Occur when two instructions need the same hardware
resource at the same time.
Pipeline stalls: These are delays caused by hazards. For example, a data hazard might
require the pipeline to wait for a result before proceeding.
Forwarding (Data Forwarding): This allows data to be passed directly from one
pipeline stage to another without needing to wait for the data to be written back to
registers.
Branch Prediction: Used to predict the outcome of branches to avoid control hazards.
Stall Cycles: Sometimes the pipeline may intentionally pause execution (stall) to resolve
a hazard.
4.0 DATA TRANSFER MODES
In computer architecture, Input/Output (I/O) operations are essential for enabling communication
between the central processing unit (CPU) and external devices such as keyboards, displays, hard
drives, printers, and network interfaces. There are several mechanisms for managing how the CPU
interacts with I/O devices. These include:
Handshaking
Buffering
Programmed I/O
Interrupt- initiated I/O
Direct memory access (DMA)
4.1 Handshaking
Handshaking is a method used for communication between the CPU and an I/O device in which
both parties signal each other to indicate readiness for data transfer. This ensures synchronization
between the two devices, avoiding issues such as data loss or corruption. In the context of I/O,
handshaking usually involves the use of control signals (e.g., Ready, Busy, Data Valid) between
the CPU and the I/O device. For instance, the CPU may send a signal to an I/O device indicating
that data is ready to be transmitted, and the device responds by signaling that it is prepared to
receive the data. Handshake protocols can be seen in serial communication, where two devices
exchange data one bit at a time, synchronizing their operations through a series of control signals.
4.2 Buffering
Buffering is a technique used to temporarily hold data in memory (the "buffer") during I/O
operations. Buffers act as temporary storage between the CPU and I/O devices, allowing for
smooth, efficient data transfer even when there is a difference in the speed of processing between
the two. Buffering allows asynchronous communication, for example, if the CPU is faster than
an I/O device (such as a printer), it can continue processing while the device slowly processes the
data in the buffer. It also helps manage differences in the data transfer rates of the CPU and I/O
devices. For example, when a keyboard inputs data faster than it can be processed, the data can be
buffered until the CPU is ready to process it.
Buffering can take place in memory (e.g., using RAM) or dedicated hardware buffers on I/O
devices, helping to prevent data loss or delays.
Disadvantages: Inefficiency, as the CPU spends time checking the device even when it is not
ready, which can waste valuable processing time. The CPU can't do other tasks while it is polling,
For example, when polling a keyboard, the CPU may continuously check if a key has been pressed,
and when it detects the key press, it will process the input. This situation can be avoided by using
an interrupt facility.
Interrupt-driven I/O is an improvement over programmed I/O where the CPU does not have to
actively poll the device. Instead, the I/O device generates an interrupt signal to notify the CPU
when it is ready to perform I/O operations. Interrupts are hardware signals sent by I/O devices to
alert the CPU that the device needs attention (e.g., data is available for reading or space is available
for writing).
When the CPU receives an interrupt, it temporarily stops its current tasks (this is called context
switching) and executes a special function called an interrupt service routine (ISR). After the
ISR finishes, the CPU resumes its previous work. For instance, in a system where an I/O device
(like a disk) sends data, the CPU will only process the data when the device interrupts it, instead
of constantly polling the device.
Advantages: More efficient than programmed I/O, as the CPU is free to perform other tasks while
waiting for the interrupt. The CPU is only interrupted when it is actually needed, reducing
unnecessary resource consumption.
Disadvantages: Interrupt handling adds overhead, as managing interrupts and context switching
requires additional resources.
1. Handshaking
Strengths:
Synchronization: Handshaking ensures that both the CPU and I/O device are synchronized
in their operations. The devices exchange signals to confirm that they are ready to
send/receive data, reducing the chance of data corruption.
Simple to implement: The control signals used for handshaking are typically
straightforward, making it easy to implement for simple devices like keyboards or serial
communication.
Weaknesses:
Overhead: Handshaking introduces some overhead in terms of time, as both devices must
exchange signals to confirm readiness, leading to delays in data transfer.
Complexity in high-speed systems: As the speed of communication increases,
handshaking can become cumbersome, requiring more control lines or more complex
timing mechanisms.
Limited scalability: Handshaking may not scale well when multiple devices need to
communicate with the CPU simultaneously, as each device would require individual
signaling.
2. Buffering
Strengths:
Smooth data transfer: Buffering allows devices with differing speeds (such as the CPU
and a slow peripheral) to communicate without data loss. The buffer temporarily holds
data until the CPU is ready to process it.
Improves efficiency: By storing data temporarily in the buffer, the CPU is not forced to
wait for every I/O operation to complete before continuing its tasks.
Handles burst data: Buffering can effectively manage data bursts, such as a rapid stream
of data from a network interface, allowing the CPU to process data at its own pace.
Weaknesses:
Memory usage: Buffers consume memory space, and depending on the system design,
this can become a significant overhead.
Latency: Buffering introduces a delay because data must first be stored in the buffer
before it can be processed or sent to the destination. This may not be ideal for time-
sensitive applications.
Complexity: Managing buffers (especially in cases with multiple I/O devices) can
introduce complexity in both hardware design and software.
Strengths:
Weaknesses:
Inefficient CPU usage: Polling wastes CPU time because it constantly checks the status
of a device even when the device isn't ready to communicate. This can significantly
reduce overall system performance, especially in systems with many I/O devices.
CPU stalls: The CPU is idle or waiting, unable to perform other useful tasks while
polling. This can lead to poor utilization of processing power.
Slow response times: Since polling is based on checking status periodically, there may
be a noticeable delay between when a device becomes ready and when the CPU actually
performs the I/O operation.
4. Interrupt-Driven I/O
Strengths:
Efficient CPU usage: The CPU is free to perform other tasks until it is interrupted by an
I/O device, allowing the system to make better use of processing power.
Immediate response: Interrupts provide quick reactions to events, allowing the CPU to
handle I/O operations as soon as the device is ready without unnecessary delays.
Scalable: Interrupt-driven I/O can scale well in systems with multiple devices. The CPU
only needs to respond when an interrupt is received, instead of constantly checking the
status of each device.
Real-time processing: Interrupts enable real-time handling of events, such as user inputs
or incoming network packets, making them suitable for systems requiring quick
responses.
Weaknesses:
Summary of Comparison
An operating system that offers a solid definition for faults cannot be disrupted by a single point
of failure. It ensures business continuity and the high availability of crucial applications and
systems regardless of any failures.
Fault tolerance and dependable systems research covers a wide spectrum of applications ranging
across:
embedded real-time systems,
commercial transaction systems,
transportation systems,
military and space systems, etc.
The supporting research for fault tolerance includes:
system architecture,
design techniques,
coding theory,
testing,
validation,
proof of correctness,
modeling,
software reliability,
operating systems,
parallel processing, and
real-time processing.
These areas often involve widely diverse core expertise ranging from formal logic, mathematics
of stochastic modeling, graph theory, hardware design and software engineering.
5.1 Basic Terms of Fault Tolerance Computing
Fault tolerance can be built into a system to remove the risk of it having a single point of failure.
To do so, the system must have no single component that, if it were to stop working effectively,
would result in the entire system failing. Fault tolerance is reliant on aspects like load balancing
and failover, which remove the risk of a single point of failure. It will typically be part of the
operating system’s interface, which enables programmers to check the performance of data
throughout a transaction.
Three central terms in fault-tolerant design are fault, error, and failure. There is a cause effect
relationship between faults, errors, and failures. Specifically, faults are the cause of errors, and
errors are the cause of failures. Often the term failure is used interchangeably with the term
malfunction, however, the term failure is rapidly becoming the more commonly accepted one.
A fault is a physical defect, imperfection, or flaw that occurs within some hardware or software
component.
An error is the manifestation of a fault. Specifically, an error is a deviation from accuracy or
correctness. Finally, if the error results in the system performing one of its functions incorrectly
then a system failure has occurred.
A failure is the nonperformance of some action that is due or expected or the performance of some
function in a subnormal quantity or quality.
The concepts of faults, errors, and failures can be best presented by the use of a three-universe
model that is an adaptation of the four-universe models;
the first universe is the physical universe in which faults occur. The physical universe
contains the semiconductor devices, mechanical elements, displays, printers, power
supplies, and other physical entities that make up a system. A fault is a physical defect or
alteration of some component within the physical universe.
the second universe is the informational universe. The informational universe is where the
error occurs. Errors affect units of information such as data words within a computer or
digital voice or image information. An error has occurred when some unit of information
becomes incorrect.
the final universe is the external or user’s universe. The external universe is where the user
of a system ultimately sees the effect of faults and errors. The external universe is where
failures occur. The failure is any deviation that occurs from the desired or expected
behavior of a system. In summary, faults are physical events that occur in the physical
universe. Faults can result in errors in the informational universe, and errors can ultimately
lead to failures that are witnessed in the external universe of the system.
The cause-effect relationship implied in the three-universe model leads to the definition of two
important parameters; fault latency and error latency.
Fault latency is the length of time between the occurrence of a fault and the appearance of
an error due to that fault.
Error latency is the length of time between the occurrence of an error and the appearance
of the resulting failure. Based on the three-universe model, the total time between the
occurrence of a physical fault and the appearance of a failure will be the sum of the fault
latency and the error latency.
5.2 Characteristics of Faults
Faults could be classified based on the following parameters
a) Causes/Source of Faults
b) Nature of Faults
c) Fault Duration
d) Extent of Faults
e) Value of faults
a. Sources of faults: Faults can be the result of a variety of things that occur within electronic
components, external to the components, or during the component or system design process.
Problems at any of several points within the design process can result in faults within the system.
Specification mistakes, which include incorrect algorithms, architectures, or
hardware and software design specifications.
Implementation mistakes. Implementation, as defined here, is the process of
transforming hardware and software specifications into the physical hardware and
the actual software. The implementation can introduce faults because of poor
design, poor component selection, poor construction, or software coding mistakes.
Component defects. Manufacturing imperfections, random device defects, and
component wear-out are typical examples of component defects. Electronic
components simply become defective sometimes. The defect can be the result of
bonds breaking within the circuit or corrosion of the metal. Component defects are
the most commonly considered cause of faults.
External disturbance; for example, radiation, electromagnetic interference, battle
damage, operator mistakes, and environmental extremes.
b. Nature of faults: This specifies the type of fault; for example, whether it is a hardware
fault, a software fault, a fault in the analog circuitry, or a fault in the digital circuitry.
c. Fault Duration: The duration specifies the length of time that a fault is active.
Permanent fault, that remains in existence indefinitely if no corrective action is
taken.
Transient fault, which can appear and disappear within a very short period of time.
Intermittent fault that appears, disappears, and then reappears repeatedly.
d. Fault Extent: The extent of a fault specifies whether the fault is localized to a given
hardware or software module or globally affects the hardware, the software, or both.
e. Fault value: The fault value of a fault can be either determinate or indeterminate. A
determinate fault is one whose status remains unchanged throughout time unless externally
acted upon. An indeterminate fault is one whose status at some time, T, may be different
from its status at some increment of time greater than or less than T.
Three primary techniques for maintaining a system’s normal performance in an environment
where faults are of concern are: fault avoidance, fault masking, and fault tolerance.
Fault avoidance is a technique that is used in an attempt to prevent the occurrence
of faults. Fault avoidance can include such things as design reviews, component
screening, testing, and other quality control methods.
Fault masking is any process that prevents faults in a system from introducing errors
into the informational structure of that system.
Fault tolerance is the ability of a system to continue to perform its tasks after the
occurrence of faults. The ultimate goal of fault tolerance is to prevent system
failures from occurring. Since failures are directly caused by errors, the terms fault
tolerance and error tolerance are often used interchangeably.
Approaches for Fault Tolerance
Fault masking is one approach to tolerating faults.
Reconfiguration is the process of eliminating a faulty entity from a system and
restoring the system to some operational condition or state. If the reconfiguration
technique is used then the designer must be concerned with fault detection, fault
location, fault containment, and fault recovery.
Fault detection is the process of recognizing that a fault has occurred. Fault
detection is often required before any recovery procedure can be implemented.
Fault location is the process of determining where a fault has occurred so that an
appropriate recovery can be implemented.
Fault containment is the process of isolating a fault and preventing the effects of
that fault from propagating throughout a system. Fault containment is required in
all fault-tolerant designs.
Fault recovery is the process of remaining operational or regaining operational
status via reconfiguration even in the presence of faults.
Goals of Fault Tolerance
Fault tolerance is an attribute that is designed into a system to achieve some design goals such as;
dependability, reliability, availability, safety, performability, maintainability, and testability; fault
tolerance is one stem attribute capable of fulfilling such requirements.