Cso Micro All Units
Cso Micro All Units
ed to a bus vary widely in their ▫ This circulates or rotates the bits of register around the two ends
Input unit: Consists of input devices that convert data into binary speed of operation. ▫ To synchronize their operational-speed, buffer- without any loss of data or contents. In this, the serial output of the shift
language. Input devices include keyboards, mice, joysticks, and registers can be used ▫ are included with the devices to hold the register is connected to its serial input. ▫ "cil" and "cir" is used for
scanners. information during transfers. ▫ prevent a high-speed processor from circular shift left and right respectively
Memory unit: Stores program information. being locked to a slow I/O device during data transfers. c) Arithmetic Shift:
Arithmetic and logic unit: Also known as the ALU. ▫ This shifts a signed binary number to left or right. ▫ An arithmetic shift
Output unit: The fifth functional unit. left multiplies a signed binary number by 2 and shift left divides the
Control unit: A functionally independent main part. Basic operational Concepts: number by 2.
These five units work together in a cycle called the fetch-decode- ▫ Arithmetic shift micro-operation leaves the sign bit unchanged
execute cycle: because the signed number remains same when it is multiplied or
Fetch: The control unit retrieves an instruction from memory. divided by 2.
Decode: The control unit breaks down the instruction into its ▫ An left arithmetic shift operation must be checked for the overflow
components (operation, operands) and sends them to the ALU.
Execute: The ALU performs the operation on the operands and stores
the result back in memory or sends it to the output unit.
❑Von Neumann architecture: Register Transfer Micro Programmed Control:
• Von Neumann architecture was first published by John von Neumann Definition: The process of moving data between registers within The function of the control unit in a digital computer is to initiate
in 1945. • His computer architecture design consists of a Control Unit, a computer system, under the control of the control unit. sequence of microoperations.
Arithmetic and Logic Unit (ALU), Memory Unit, Registers and Purpose: To enable data manipulation, storage, and retrieval for Control unit can be implemented in two ways :
Inputs/Outputs. • Historically there have been 2 types of Computers: 1. various operations. o Hardwired control
Fixed Program Computers – Their function is very specific and they Key Components:
o Microprogrammed control
couldn’t be reprogrammed, e.g. Calculators. 2. Stored Program Registers: Small, high-speed storage units within the processor.
Computers – These can be programmed to carry out many different Buses: Data pathways connecting registers and other Hardwired Control:
tasks, applications are stored on them, hence the name. • Von components. When the control signals are generated by hardware using
Neumann architecture is based on the stored-program computer Control Unit: Orchestrates data flow and register operations. conventional logic design techniques, the control unit is said to be
concept, where instruction data and program data are stored in the Register Transfer Language (RTL): hardwired.
same memory. This design is still used in most computers produced Symbolic notation for describing register transfers. The key characteristics are
today. Used for: High speed of operation
Modeling hardware behavior at a detailed level.
Designing digital circuits and systems. Expensive
Verifying correctness of hardware designs. Relatively complex
Example: R1 ← R2 + R3 (Add contents of R2 and R3, store No flexibility of adding new instructions
result in R1) Examples of CPU with hardwired control unit are Intel 8085, Motorola
Types of Register Transfer Operations: 6802, Zilog 80, and any RISC CPUs.
Register-to-register transfer: Data moves between registers. Microprogrammed Control:
Register-to-memory transfer: Data moves between a register and Control information is stored in control memory.
memory.
Control memory is programmed to initiate the required sequence of
Memory-to-register transfer: Data moves from memory to a
register. micro-operations.
Arithmetic operations: Performed on data in registers The key characteristics are
(e.g., addition, subtraction). Speed of operation is low when compared with hardwired
Logical operations: Performed on data in registers Less complex
(e.g., AND, OR, NOT). Less expensive
Shift operations: Shift data bits within a register (e.g., left Flexibility to add new instructions
shift, right shift).
Examples of CPU with microprogrammed control unit are Intel 8080,
What is Register Transfer Language (RTL)?
A symbolic notation used to describe the micro-operations that Motorola 68000 and any CISC CPUs.
move data between registers within a digital system. What is a microprogrammed control unit (MCU)?
An MCU is a type of control unit that uses a microprogram to
➢ Central Processing Unit (CPU): ▫ The Central Processing Unit (CPU) is Provides a concise and precise way to model the hardware-level
behavior of a system, independent of specific hardware control the operation of the processor.
the electronic circuit responsible for executing the instructions of a
implementation. MCUs are generally slower than hardwired control units, but they
computer program. ▫ It is sometimes referred to as the microprocessor
It's like a language that hardware designers use to communicate offer advantages like flexibility and easier programmability.
or processor. ▫ The CPU contains the ALU, CU and a variety of registers. What is a microprogram?
▪ Registers: Registers are high speed storage areas in the CPU. All data and document their designs.
RTL Syntax: A microprogram is a set of low-level instructions that specify the
must be stored in a register before it can be processed. MAR Memory exact sequence of micro-operations needed to execute a single
Uses symbols to represent registers, operations, and control
Address Register Holds the memory location of data that needs to be machine instruction.
signals.
accessed MDR Memory Data Register Holds data that is being Each micro-operation involves activating specific control signals
Example: R1 ← R2 + R3 (Add the contents of registers R2 and
transferred to or from memory AC Accumulator Where intermediate within the processor to perform tasks like fetching
R3, and store the result in R1)
arithmetic and logic results are stored PC Program Counter Contains the data, decoding instructions, or performing arithmetic operations.
Memory Transfer Operations: Refer to the fundamental
address of the next instruction to be executed CIR Curren Instruction What is control memory?
processes of reading data from memory and writing data to
Register Contains the current instruction during processing Control memory is a type of read-only memory (ROM) that
memory.
▪ Arithmetic and Logic Unit (ALU): The ALU allows arithmetic (add, stores the microprogram.
Common Notation:
subtract etc) and logic (AND, OR, NOT etc) operations to be carried out. During the fetch-decode-execute cycle, the control unit retrieves
DR ← M[AR] (Read operation): Transfers data from memory
▪ Control Unit (CU): The control unit controls the operation of the the appropriate microinstruction from control memory based on
location specified by address register (AR) to data register (DR).
computer’s ALU, memory and input/output devices, telling them how the current machine instruction being executed.
M[AR] ← DR (Write operation): Transfers data from data
to respond to the program instructions it has just read and interpreted The microinstruction then provides the control signals necessary
register (DR) to memory location specified by AR. to perform the next micro-operation.
from the memory unit. The control unit also provides the timing and Arithmetic micro-operations: Key characteristics of control memory:
control signals required by other computer components. ➢ Memory • Some of the basic micro-operations are addition, subtraction, Read-only: The microprogram in control memory is typically fixed
Unit: ▫ The memory unit is usually primary memory. Inside the primary increment and decrement. and cannot be modified dynamically.
memory consists of the Random Access Memory (RAM) and the Read- ➢ Add Micro-Operation: Fast access: Control memory needs to be fast enough to keep
Only Memory (ROM). ▫ It is defined by the following statement: R3 → R1 + R2 ▫ The above up with the execution speed of the processor.
▫ The RAM is used to store data that is currently in use. This is when statement instructs the data or contents of register R1 to be added to Limited capacity: Control memory typically stores only the
the computer is on, data that is used is added into the RAM. However, data or content of register R2 and the sum should be transferred to microprograms for frequently used instructions. Less common
since this is a volatile (temporary) memory, once the computer is off, all register R3. instructions may be decoded and executed using routines in
the data that was in the RAM is lost. ➢ Subtract Micro-Operation: main memory.
▫ The ROM is used to store permanent data and basic instructions such ▫ Let us again take an example: R3 → R1 + R2' + 1 ▫ In subtract micro- Benefits of using control memory:
as the BIOS/startup instructions for your computer. This is different to Flexibility: The microprogram can be easily changed to support
operation, instead of using minus operator we take 1's compliment and
RAM as the memory is non-volatile (permanent), therefore even when new instructions or modify existing functionality.
add 1 to the register which gets subtracted, i.e R1 - R2 is equivalent to
the computer is off, all these data is stored and retained in the ROM. Modular design: Microprograms can be broken down into
R3 → R1 + R2' + 1 smaller, manageable units.
➢ Input/Output Devices: ▫ Input Devices — devices that sends ➢ Increment/Decrement Micro-Operation: Cost-effective: MCUs with control memory can be cheaper to
information into the computer, eg: keyboard, mouse, microphone, ▫ Increment and decrement operation are generally performed by manufacture than hardwired control units.
touchscreen, etc. ▫ Output devices — devices that sends information adding and subtracting 1 to and from the register respectively. [R1 → Address sequencing
out of the computer, eg: monitor, speaker, printer, etc. R1 + 1R1 → R1 – 1] Symbolic Designation Description R3 ← R1 + R2 Address sequencing is a fundamental concept in computer
Buses Contents of R1+R2 transferred to R3. R3 ← R1 - R2 Contents of R1-R2 architecture that refers to the process of determining the next
Data is transmitted from one part of a computer to another, transferred to R3. R2 ← (R2)' Compliment the contents of R2. R2 ← (R2)' address in the control memory where the next microinstruction for
connecting all major internal components to the CPU and memory, by + 1 2's compliment the contents of R2. R3 ← R1 + (R2)' + 1 R1 + the 2's executing a machine instruction is stored. It's like following a
the means of Buses. A standard CPU system bus is comprised of a compliment of R2 (subtraction). R1 ← R1 + 1 Increment the contents of roadmap to navigate through the microprogram stored in control
control bus, data bus and address bus. R1 by 1. R1 ← R1 - 1 Decrement the contents of R1 by 1. ❑Logic micro- memory.
Types of Buses operations: Purpose:
Address Bus Carries the addresses of data (but not the data) between Defines the order in which microinstructions are fetched from
• These are binary micro-operations performed on the bits stored in the
the processor and memory control memory to execute a machine instruction.
registers. These operations consider each bit separately and treat them
Data Bus Carries data between the processor, the memory unit and the Ensures smooth and efficient execution of the machine instruction
as binary variables. • Let us consider the X-OR micro-operation with the by fetching the right microinstructions at the right time.
Input/Output devices contents of two registers R1 and R2. P: R1 ← R1 X-OR R2 • In the above Capabilities:
Control Bus Carries control signals/commands from the CPU (and status statement we have also included a Control Function. • Assume that Incrementing the Control Address Register (CAR): This is the
signals from other devices) in order to control and coordinate all the each register has 3 bits. Let the content of R1 be 010 and R2 be 100. The most basic capability, where the address in the CAR is simply
activities within the computer. XOR micro-operation will be: incremented to fetch the next microinstruction in sequence.
von Neumann Bottleneck: Limitations of von Neumann Architecture ❑Shift micro-operations: Conditional Branching: Based on the outcome of a previous
It is the computing system throughput limitation due to inadequate rate • These are used for serial transfer of data. That means we can shift the operation (e.g., the value of a status register), the address
of data transfer between memory and the CPU. contents of the register to the left or right. In the shift left operation the sequencing can jump to a different location in the control memory
The VNB causes CPU to wait and idle for a certain amount of time serial input transfers a bit to the right most position and in shift right to fetch the next microinstruction. This allows for conditional
while low speed memory is being accessed. operation the serial input transfers a bit to the left most position. • execution of different parts of the microprogram.
The VNB is named after John von Neumann, a computer scientist who There are three types of shifts as follows: Unconditional Branching: This is similar to conditional
was credited with the invention of the bus based computer a) Logical Shift: branching, but the jump to a different location happens regardless
architecture. of any condition. It's often used for loops or subroutine calls.
▫ It transfers 0 through the serial input. The symbol "shl" is used for
To allow faster memory access, various distributed memory “non- Subroutine Calls and Returns: Address sequencing facilitates
logical shift left and "shr" is used for logical shift right. R1 ← she R1R1
von” systems were proposed calling subroutines, which are smaller routines that can be used
← she R1 ▫ The register symbol must be same on both sides of arrows.
repeatedly within a program. It keeps track of the return address
b) Circular Shift:
so that after the subroutine execution, the control flow can return resources more effectively, reducing idle time and maximizing
to the main program. throughput.
Importance: Reduced Programming Complexity: Vector instructions can
Efficient address sequencing is crucial for optimal performance of simplify the code for performing repetitive operations on large
the processor. Any delays or errors in fetching the correct arrays, making it easier for programmers to express these types
microinstructions can significantly slow down the execution of the of computations.
machine instruction. Challenges of Vector Processing:
It enables complex operations by breaking down machine Increased Hardware Complexity: Vector processors require
instructions into smaller, manageable microinstructions and specialized hardware, such as vector registers and parallel
fetching them in the correct order. processing units, which can increase the cost and complexity of
The design of a control unit the processor.
involves defining the hardware and logic necessary to sequence Not all algorithms benefit: Not all algorithms are well-suited for
and orchestrate the execution of instructions within a processor. vector processing. Some algorithms may have dependencies
It plays a crucial role in directing the flow of data, activating between data elements that prevent them from being processed
various units in the processor, and ultimately determining the in parallel.
behavior of the computer system. Memory Access Bottleneck: Accessing data in memory can be
Components: a bottleneck for vector processing, as fetching large vectors can
Instruction Register (IR): Stores the currently fetched instruction take longer than the actual operation itself.
being executed.
Program Counter (PC): Points to the address of the next Applications of Vector Processing:
instruction to be fetched. Scientific Computing: Vector processing is widely used in
Decoder: Decodes the opcode (operation code) in the instruction scientific computing applications that involve large datasets, such
to determine the operation to be performed. as weather forecasting, climate modeling, and computational fluid
Control Logic: Generates control signals based on the decoded dynamics.
opcode and other inputs like flags and interrupt signals. Image and Signal Processing: Vector processing is also used
Pipelining is used to improve overall performance.
Sequential Logic: Responsible for updating the PC and fetching in image and signal processing applications, such as
the next instruction after completion of the current one. Features of the RISC pipeline filtering, compression, and transformation of images and audio
Control Memory (MCU only): Stores the microprogram, a RISC pipeline can use many registers to decrease the processor signals.
sequence of microinstructions detailing the steps for executing memory traffic and enhance operand referencing. Machine Learning: Vector processing is playing an increasingly
each machine instruction. It keeps the most frequently accessed operands in the CPU registers. important role in machine learning applications that involve
In the RISC pipeline, simplified instructions are used, leaving complex training algorithms on large datasets, such as deep learning and
What is Pipelining: instructions. image recognition.
In computer architecture, pipelining refers to a technique for
Here register to memory operations is reduced.
improving instruction execution speed by overlapping the what is array Processing:
execution stages of different instructions. Imagine it like an Instructions take a single clock cycle to get executed. The term "array processing" can be interpreted in two different
assembly line in a factory, where multiple stages of production ways, depending on the context:
happen simultaneously on different products 1. Processing data within an array:
. Example In this context, array processing refers to the act of applying
Here's how pipelining works: Let’s consider Instruction in the circumstances related to RISC operations to all elements of an array of data simultaneously. This
Instruction Fetch: The processor fetches an instruction from architecture. In RISC machines, registering is most of the operations. can involve simple operations like addition or multiplication, as
memory. well as more complex operations like filtering, sorting, or
Therefore, the instructions can be performed in two phases:
Instruction Decode: The instruction is decoded to determine performing statistical analyses.
the operation to be performed and the operands needed. E: Execute Instruction on register operands and keep/store the results
Operand Fetch: The operands (data) required for the operation in the register.
are fetched from memory or registers. F: Instruction Fetch to get the Instruction. Array processing can be done in different ways:
Execution: The ALU (Arithmetic Logic Unit) performs the Generally, the memory access in RISC is performed through STORE and Using traditional loops: This is the most basic approach, where
operation on the operands. LOAD operations. For these types of instructions, the following steps you iterate through each element of the array individually and
Write Back: The result of the operation is written back to a are required: apply the desired operation. However, this can be slow and
register or memory location inefficient for large arrays.
F: Fetch instructions to get the Instruction
Using specialized libraries or frameworks: Many programming
Benefits of Pipelining: E: Effective address calculation for the required memory operand languages and libraries offer optimized functions for performing
Increased processor speed: Pipelining significantly improves D: register-to-memory or memory-to-register data transfer through the common operations on arrays. These functions use vectorization
instruction throughput, potentially doubling or even tripling the bus and other techniques to improve performance.
execution speed compared to a non-pipelined processor. Using parallel processing techniques: If you have multiple
Improved efficiency: Resources are used more Importance of RISC processors or cores available, you can distribute the work of
effectively, reducing idle time and maximizing the utilization of The importance of RISC processors is as follows: processing the array across them. This can significantly improve
the processor's components. ▫ Register-based execution performance for large arrays.
▫ Fixed Length instruction and Fixed Instruction Format
Challenges/limitations of Pipelining: 2. Array processors:
▫ Few Powerful Instructions
Increased complexity: Pipelined processors require more In a different context, "array processing" can also refer to a
complex hardware and control logic to manage the overlaps and ▫ Hardwired control unit specific type of hardware processor designed to efficiently handle
potential hazards (data dependencies between instructions). ▫ Highly Pipelined Superscalar Architecture computations involving large arrays of data. These processors
Pipeline hazards: In certain situations, instructions waiting in ▫ Highly Integrated Architecture typically have special features like:
the pipeline may have to stall or be flushed due to data Advantages of RISC Vector registers: These registers can hold multiple data
dependencies, which can reduce the overall speedup. ▫ This RISC architecture allows developers the freedom to elements from an array, allowing for faster access and
make use of the space on the microprocessor. manipulation compared to regular registers.
what is Instruction Pipeline: Parallel processing units: These units can perform the same
▫ RISC allows high-level language compilers to generate
Instruction pipelining is a specific type of pipelining used in operation on all elements of a vector simultaneously, further
computer architecture to improve the speed of instruction efficient code due to the architecture having a set of improving performance.
execution by dividing the instruction cycle into smaller, instructions. Specialized instructions: Array processors often have
overlapping stages that run concurrently. Think of it like an ▫ RISC processors utilize only a few parameters; besides, instructions designed specifically for manipulating arrays, such as
assembly line in a factory, where different parts of the same RICS processors cannot call instructions; hence, it uses vector addition, multiplication, and sorting.
instruction are processed simultaneously on different "stations" fixed-length instructions that are easy to pipeline.
within the processor. ▫ RISC reduces the execution time while increasing the Examples of applications that benefit from array processing
include:
overall operation speed and efficiency.
what is Arithmetic Pipeline: Scientific computing: Calculations involving large datasets in
An arithmetic pipeline is a technique used in computer ▫ RISC is relatively simple because it has very few areas like weather forecasting, climate modeling, and fluid
architecture to improve the performance of arithmetic operations, instruction formats; also, a small number of instructions dynamics.
particularly multiplication and floating-point calculations. It works and a small number of addressing modes are needed. Image and signal processing: Operations like
by dividing the operation into smaller, overlapping stages that can filtering, compression, and transformation of images and audio
be executed concurrently on different units within the processor. what is Vector Processing: signals.
This is similar to how an assembly line in a factory works, where Vector processing is a technique used in computer architecture to Machine learning: Training algorithms on large datasets for
different parts of the same product are processed simultaneously improve the performance of computations that involve operating tasks like natural language processing and image recognition.
on different stations. on large arrays of data simultaneously. Instead of processing
each element of the array individually, vector processors can An instruction set, sometimes called an Instruction Set
RISC architecture : apply the same operation to all elements in parallel, significantly Architecture (ISA), is the fundamental collection of instructions
Reduced Instruction Set Computer is a special kind of Instruction Set boosting speed. Think of it like processing a bunch of apples on a that a microprocessor can understand and execute. It's like a
Architecture with attributes with lower cycles per Instruction (CPI) conveyer belt instead of doing them one by one. dictionary defining the commands the processor can interpret
than CISC. and the operations it can perform. Understanding the instruction
vector processing works: set is crucial for programmers and computer architects as it
RISC is a load/ store architecture as memory is only accessed through
Fetch Vector Instructions: The processor fetches an instruction determines the capabilities and limitations of the processor.
specific instructions rather than as a part of most instructions. Here are some key aspects of microprocessor instruction
that specifies the operation to be performed on the vector (array)
RISC architecture is widely used across various platforms, from cellular sets:
of data.
telephones to the fastest supercomputer Load Vector Data: The vector data is loaded from memory into Components of an Instruction:
special registers within the processor called vector Opcode: This is the code that identifies the specific operation to
RISC Pipeline: registers. These registers can hold multiple data elements, unlike be performed.
Pipelining, a (standard feature in RISC processors) is like an assembly regular registers which hold only one. Operands: These are the data elements involved in the
line. Because the processor function on different steps of the Execute Vector Operation: The ALU (Arithmetic Logic Unit) operation, such as register numbers or memory addresses.
Instruction at the same time, more instructions can be performs the specified operation on all elements of the vector data Addressing modes: These specify how the operands are
simultaneously using specialized parallel processing units. located in memory or registers.
operated/executed in a short time. Several steps vary in different
Store Vector Result: The result of the operation is stored back to Flags: These are status bits that indicate the outcome of
processors, but that steps are generally variations of these five: previous operations, like carry or overflow.
a vector register or memory location.
LTB:
A TLB, or Translation Lookaside Buffer, is a special type of
memory cache used in computer systems to speed up memory
access. Think of it as a shortcut or cheat sheet for the processor
to find frequently used memory locations much faster.
Here's how it works:
Mapping Memory: Every memory location in your computer has
a unique address, similar to a house address. These addresses
can be long and complex, making them difficult for the processor
to work with directly.
Translation and Storage: The TLB acts as a
middleman, storing recently used address translations in a
small, high-speed cache. These translations map virtual
addresses (the addresses used by programs) to their
corresponding physical addresses (the actual locations in RAM).
Faster Access: When the processor needs to access data, it
first checks the TLB. If the needed address translation is found
(a "TLB hit"), the physical address is retrieved instantly and the
data can be accessed quickly. This is like checking your address
book for a frequently called number instead of dialing the full
number every time.
Miss and Fallback: If the address translation is not found in the
TLB (a "TLB miss"), the processor must fall back to the slower
process of using the page table, a comprehensive list of all
address translations stored in main memory. This is like using
the phone book when the number isn't in your address book.
Benefits of Using TLB:
Significantly faster memory access: Finding memory
locations through the TLB can be many times faster than using
the page table, leading to improved program performance and
overall system responsiveness.
Reduces processor workload: The TLB frees up the processor
from performing frequent page table lookups, allowing it to focus
on other tasks.
Improves efficiency: By caching frequently used
translations, the TLB minimizes the need for slower accesses to
the page table in main memory.
Types of TLBs:
Instruction TLB (ITLB): Specifically stores translations for
instruction addresses, crucial for program execution.
Data TLB (DTLB): Stores translations for data addresses used
by programs to access various data structures.