Hardware and VMs - Class 1
Hardware and VMs - Class 1
Instruction Handling
Complex Instruction Set Computer
Instruction Handling
• CISC processors enable a more streamlined approach to coding. For
instance, the instruction ADD x, y simplifies the addition of two variables.
[This reduces the lines of code needed for operations that might
otherwise take several steps.]
Complex Instruction Set Computer
Instruction Handling
• CISC processors enable a more streamlined approach to coding. For
instance, the instruction ADD x, y simplifies the addition of two variables.
[This reduces the lines of code needed for operations that might
otherwise take several steps.]
• After execution, the result of the addition is stored back in the first
operand, depicted as x := x + y. [This is a common CISC practice, where
the operation’s result is stored in one of the input registers, promoting
efficiency in register usage.]
Complex Instruction Set Computer
Instruction Length
Complex Instruction Set Computer
Instruction Length
• Both Fixed and Variable Length instructions, providing flexibility to the
programmer and compiler.
Complex Instruction Set Computer
Instruction Length
• Both Fixed and Variable Length instructions, providing flexibility to the
programmer and compiler.
• A Fixed Length instruction, simplifies the CPU's decoding process.
[However, it may not always be the most space-efficient, as simple
instructions occupy the same amount of space as more complex ones.]
Complex Instruction Set Computer
Instruction Length
• Both Fixed and Variable Length instructions, providing flexibility to the
programmer and compiler.
• A Fixed Length instruction, simplifies the CPU's decoding process.
[However, it may not always be the most space-efficient, as simple
instructions occupy the same amount of space as more complex ones.]
• Variable Length instruction, can occupy varying amounts of space in
the instruction set. [This allows for a more compact representation of
complex instructions, but it requires a more sophisticated decoding
mechanism within the CPU to handle the variability in instruction size.]
Complex Instruction Set Computer
Control Unit
Complex Instruction Set Computer
Control Unit
• Hardwired Control Unit: Uses logic circuits for direct operation control.
[Faster due to fixed logic pathways]
Complex Instruction Set Computer
Control Unit
• Hardwired Control Unit: Uses logic circuits for direct operation control.
[Faster due to fixed logic pathways]
• Programmable Control Unit: Employs microprograms for instruction
execution. [Complex instruction sets and adaptability]
Complex Instruction Set Computer
Features
• Rich instruction set for diverse operations.
⚬ Small, individual instructions
• Fewer registers, with emphasis on memory-based processing. [Many
registers in modern CISC processors]
• Complex instructions for high-level operations.
• Various instruction formats for operational versatility. [Increased
complexity for flexibility]
Complex Instruction Set Computer
Features
• Multicycle instructions, with one instruction leading to several micro-
operations.
⚬ MOVSB
■ moves a byte from one memory location to another
■ loading the source and destination addresses, moving the byte,
updating the pointers, and adjusting the counter.
• Utilizes variable length instructions for operational flexibility -> can
change number of bits utilised
• Challenges with instruction pipelining due to instruction complexity.
[Advanced pipelining techniques in modern processors]
Cntd..
• Instruction Fetch (IF): Retrieves the instruction from memory. [Critical for
lining up the next instruction to be executed]
The Five Stages of Processor Pipelining
• Instruction Fetch (IF): Retrieves the instruction from memory. [Critical for
lining up the next instruction to be executed]
• Instruction Decode (ID): Interprets what the instruction is and what
actions are required. [Translates binary code into control signals for
other CPU parts]
The Five Stages of Processor Pipelining
• Instruction Fetch (IF): Retrieves the instruction from memory. [Critical for
lining up the next instruction to be executed]
• Instruction Decode (ID): Interprets what the instruction is and what
actions are required. [Translates binary code into control signals for
other CPU parts]
• Operand Fetch (OF): Gathers the data needed for the execution.
[Involves accessing CPU registers or memory]
The Five Stages of Processor Pipelining
• Code Segmentation:
Running Parallel Code
• Code Segmentation:
⚬ The program should be split into blocks of code. This division allows
tasks to be executed simultaneously across many processors. [For
example, in data analysis, different processors could handle
calculations for separate chunks of a large dataset at the same
time.]
Running Parallel Code
• Distributed Processing:
Running Parallel Code
• Distributed Processing:
⚬ Each block is then processed by a different processor, enabling
multiple blocks to be processed independently and concurrently.
[Consider a simulation of weather patterns where calculations for
different geographic regions are handled by separate processors.]
Running Parallel Code
• Parallel Execution:
Running Parallel Code
• Parallel Execution:
⚬ Requires orchestration between parallel tasks, ensuring that tasks
that are dependent on the output of others are synchronized. [In the
weather simulation, while one processor calculates temperature
changes, another might calculate humidity levels, and they must
exchange this information to predict weather patterns accurately.]
Virtual Machines
Virtual Machines
• The Host OS retrieves the required data from its storage, like fetching
contents from a file on the disk.
The Mechanism
• The Host OS retrieves the required data from its storage, like fetching
contents from a file on the disk.
• After retrieval, the Host OS passes the data back to the VM software.
The Mechanism
• The Host OS retrieves the required data from its storage, like fetching
contents from a file on the disk.
• After retrieval, the Host OS passes the data back to the VM software.
• The VM software then relays the data to the Guest OS.
The Mechanism
• The Host OS retrieves the required data from its storage, like fetching
contents from a file on the disk.
• After retrieval, the Host OS passes the data back to the VM software.
• The VM software then relays the data to the Guest OS.
• Finally, the Guest OS delivers the data to the application, completing
the request cycle
The Mechanism
• The Host OS retrieves the required data from its storage, like fetching
contents from a file on the disk.
• After retrieval, the Host OS passes the data back to the VM software.
• The VM software then relays the data to the Guest OS.
• Finally, the Guest OS delivers the data to the application, completing
the request cycle
Tasks Performed By VM Software
Tasks Performed By VM Software
• Web Server Software Testing: VMs enable testing of different web server
software across various operating systems and configurations.
(Facilitates a comprehensive testing strategy, ensuring that the web
server software performs well in diverse environments.)