VIRTUAL COMPUTERS TRB CSI › Programming with C++ › virtual computers,

VIRTUAL COMPUTERS

Virtual Computer என்பது physical hardware computer அல்ல. ஒரு programming language அல்லது software system-க்கு தேவையான imaginary / abstract machine model-ஐ software மூலம் உருவாக்குவது. Simple Tamil: Programmer எழுதும் program, actual CPU-ஐ …

Premium — locked Advanced 20 min 161 cards 3 programs 10 MCQs v2
This is a premium lesson. You can see the shape of every card — unlock to read them. Unlock

VIRTUAL COMPUTERS…

Premium This card is part of the premium lesson. Unlock
Definition

Virtual Computer என்பது physical hardware computer அல்ல. ஒரு programming language அல்லது software system-க்கு……

Premium This card is part of the premium lesson. Unlock
Definition

1. WHY DO WE NEED A VIRTUAL C……

Premium This card is part of the premium lesson. Unlock
Definition

Different computers-க்கு different: CPU Instruction Set Memory organization Operating System Hardware archite……

Premium This card is part of the premium lesson. Unlock

SIMPLE REAL-LIFE EXAMPLE

Definition

Suppose Java program: System.out.println("Hello"); Java source code நேரடியாக Intel/AMD/ARM machine code ஆக மட……

Premium This card is part of the premium lesson. Unlock
Definition

1. VIRTUAL COMPUTER என்றால் A……

Premium This card is part of the premium lesson. Unlock
Definition

இல்லை. Physical computer: CPU RAM Storage Keyboard Monitor Virtual computer: Virtual Instructions Virtual Mem……

Premium This card is part of the premium lesson. Unlock

IMPORTANT EXAM POINT

Definition

Programming language theory-ல் V……

Premium This card is part of the premium lesson. Unlock
Definition
Meaning 1

Programming Language Virtual Machine ஒரு programming langua……

Premium This card is part of the premium lesson. Unlock
Definition
Meaning 2

Full System Virtual Machine ஒரே physical computer-ல் another complete operating system run செய்வது. Examples:……

Premium This card is part of the premium lesson. Unlock

BASIC STRUCTURE

Definition

High-Level Program ↓ Compiler / Translator ↓ Intermed……

Premium This card is part of the premium lesson. Unlock

ABSTRACT MACHINE

Definition

Virtual computer-க்கு closely……

Premium This card is part of the premium lesson. Unlock
Definition

ஒரு programming language-ன் execution behavior-ஐ explain செய்ய theoretically define செய்யப்பட்ட ……

Premium This card is part of the premium lesson. Unlock

PHYSICAL MACHINE VS ABSTRACT MACHINE

VIRTUAL INSTRUCTION SET

Definition

Physical CPU instruction: ADD MOV JMP LOAD STORE Virtual computer-க்கும் own virtu……

Premium This card is part of the premium lesson. Unlock

STACK-BASED VIRTUAL MACHINE

Definition

பல virtual machines stack-bas……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

Need: 10 + 20 Virtual instructio……

Premium This card is part of the premium lesson. Unlock

empty After: PUSH 10 Stack: 10 Then: PUSH 20 Stack: 20 1……

Premium This card is part of the premium lesson. Unlock

REGISTER-BASED MACHINE

சில virtual machines register……

Premium This card is part of the premium lesson. Unlock
Concept

R1 = 10 R2 = 20 R3 = R1 + R2 ……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER AND TRANSLATION

Concept

Suppose source language: x = a + b Translator அதை virtual instructions-ஆக மாற்றலாம்: LOAD a LOAD b ADD ST……

Premium This card is part of the premium lesson. Unlock

INTERMEDIATE REPRESENTATION

Concept

Virtual computers பெரும்பாலும் Intermediate Representation (I……

Premium This card is part of the premium lesson. Unlock
Concept

High-Level Source ↓ Intermedi……

Premium This card is part of the premium lesson. Unlock
Concept

1. WHY INTERMEDIATE CODE?…

Premium This card is part of the premium lesson. Unlock
Concept

Suppose 3 source languages: Language A Language B Language C and 3 machines: Machine X Machine Y Machine Z Ev……

Premium This card is part of the premium lesson. Unlock

PORTABILITY

Concept

Virtual computer-ன் major benefit: Portability ஒரே intermediate program ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

Java Bytecode ↓ Windows JVM → Windows Linux JVM → Linux macOS JV……

Premium This card is part of the premium lesson. Unlock

MACHINE INDEPENDENCE

Explanation

Virtual machine ஒரு standard machine interface provide செய்கிறது. Virt……

Premium This card is part of the premium lesson. Unlock

JAVA VIRTUAL MACHINE - EXAMPLE

Explanation

C++ unit என்றாலும் virtual co……

Premium This card is part of the premium lesson. Unlock
Explanation

Flow: Test.java ↓ Java Compiler ↓ Tes……

Premium This card is part of the premium lesson. Unlock

BYTECODE

Definition

Physical machine code அல்லாமல் virtual machine……

Premium This card is part of the premium lesson. Unlock
Important

Bytecode ≠ Source Code Bytecode ≠ Native ……

Premium This card is part of the premium lesson. Unlock

P-CODE

Important

Programming language history-ல் important term: P-code / Portable Code Pascal implementations ப……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER AS AN INTERPRETER

Important

ஒரு virtual computer-ஐ software interpreter போல implement செய்யலாம். Pseudo logic: Fetch virtual instruction ……

Premium This card is part of the premium lesson. Unlock

JIT COMPILATION

Important

Virtual machine every instruction-ஐ always interpreter மூலம் மட்டும் execute செய்ய வேண்டியதில்லை. Modern VMs:……

Premium This card is part of the premium lesson. Unlock

INTERPRETER VS JIT

Important

Interpreter Virtual instruction ↓ Interpret ↓ Execute JIT Virtua……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER COMPONENTS

Important

A virtual computer may conceptually contain: Virtual CPU Vir……

Premium This card is part of the premium lesson. Unlock

VIRTUAL CPU

Important

Physical CPU-க்கு equivalent conceptual execution componen……

Premium This card is part of the premium lesson. Unlock

VIRTUAL MEMORY MODEL

Important

Virtual computer programming language var……

Premium This card is part of the premium lesson. Unlock
Explanation
Code

Stack Heap Static Area…

Premium This card is part of the premium lesson. Unlock
Concept

+----------------+ | Code | +----------------+ | Static Data | +--------……

Premium This card is part of the premium lesson. Unlock

VIRTUAL STACK

Concept

Function calls மற்றும் local ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int add(int a, int b) { return a + b; } Conceptual call: main() ↓ add()……

Premium This card is part of the premium lesson. Unlock

PROGRAM COUNTER

Explanation

Virtual computer-லும்: Program Counter (PC) next instruction location track செய்ய conceptu……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER AND RUNTIME SYSTEM

Explanation

Programming language runtime system: Memory allocation Function calls Exception handling……

Premium This card is part of the premium lesson. Unlock

RUNTIME ENVIRONMENT VS VIRTUAL MACHINE

Explanation

பல practical systems-ல் இரண்ட……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER AND BINDING

Explanation

Virtual machine சில bindings runtime-ல் decide செய்ய உ……

Premium This card is part of the premium lesson. Unlock
Explanation

Actual function runtime-ல் select ஆகலாம். இந்த pro……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER AND MEMORY MANAGEMENT

Explanation

Virtual machine language-க்கு automatic memory management support கொடுக்கலாம். Example Java: Object created ↓……

Premium This card is part of the premium lesson. Unlock

VIRTUAL MACHINE vs EMULATOR

Explanation

இவை related ஆனால் exactly same அல்ல. Emulator ஒரு particular hardware architecture-ஐ imitate செய்கிறது. Exa……

Premium This card is part of the premium lesson. Unlock

VIRTUAL MACHINE vs HYPERVISOR

Explanation

இது exam confusion area. Language VM JVM CLR Purpose: Program/intermediate code ex……

Premium This card is part of the premium lesson. Unlock

SYSTEM VIRTUAL MACHINE

Explanation

One physical computer: Physical Hardware ↓ Hypervisor / \ VM 1 VM 2 ↓ ↓ Linux Windows ஒவ்வொரு ……

Premium This card is part of the premium lesson. Unlock

PROCESS VIRTUAL MACHINE

Explanation

ஒரு single program execute செய்ய lifetime மட்டும் இருக்கும் virtu……

Premium This card is part of the premium lesson. Unlock

SYSTEM VM VS PROCESS VM

VIRTUAL COMPUTER ADVANTAGES

Explanation

Important advantages: Portability Machine independence Simpler compiler design Security……

Premium This card is part of the premium lesson. Unlock

PORTABILITY - INCH BY INCH

Explanation

Without VM: Program ↓ Specific CPU Machine Code New CPU வந்தால்: Recompile / Adapt With VM: P……

Premium This card is part of the premium lesson. Unlock

SECURITY

Explanation

Virtual machine program மற்றும் hardware இடையே controlled layer ஆக இருக்கலாம். Program ↓ VM ↓ Checks ↓ O……

Premium This card is part of the premium lesson. Unlock

SANDBOX

Explanation

Virtual machine applications isolated env……

Premium This card is part of the premium lesson. Unlock
Concept

Untrusted Program ↓ Controlle……

Premium This card is part of the premium lesson. Unlock

DISADVANTAGES

Concept

Virtual computer use செய்வதால் சில disadvantages: Extra execution layer Runtime overhead More memor……

Premium This card is part of the premium lesson. Unlock

NATIVE EXECUTION VS VIRTUAL MACHINE EXECUTION

Concept

Native C++ Source ↓ Native Compiler ↓ Mach……

Premium This card is part of the premium lesson. Unlock

C++ AND VIRTUAL COMPUTER

Concept

Important clarification: Traditional C++ execution: C++ Source ↓ Compiler ↓ Native Object Code ↓ Linker ↓ Exe……

Premium This card is part of the premium lesson. Unlock

C++ AND VIRTUAL FUNCTIONS ARE DIFFERENT

Concept

கவனம்: Virtual Computer மற்றும் Virtual Function completely differe……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

virtual void display(); இது v……

Premium This card is part of the premium lesson. Unlock

MACHINE HIERARCHY

Explanation

Programming language system-ஐ levels-ஆக பார்க்கலாம்: Level 5 → High-Level Programming Language ↓ Level 4 → Vi……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER AS AN ABSTRACTION

Explanation

Physical hardware complicated. Programmer physical details: Transistors Registers Bus signals Instruction tim……

Premium This card is part of the premium lesson. Unlock

ABSTRACTION LAYERS

Explanation

Application Program ↓ Programming Language ↓ Virtual Ma……

Premium This card is part of the premium lesson. Unlock

VIRTUAL COMPUTER AND LANGUAGE IMPLEMENTATION

Explanation

ஒரு programming language implement செய்ய இரண்டு common paths: Direct Compilation ……

Premium This card is part of the premium lesson. Unlock

HYBRID IMPLEMENTATION

Explanation

Compilation + interpretation combine செய்தால்: Source ↓ Compiler ↓ Intermediate Code……

Premium This card is part of the premium lesson. Unlock

FORMAL VIEW

Explanation

Virtual computer-ஐ mathematical state model-ஆகவும் பார்க்கலாம். Machine state: State = Memory + Registers + S……

Premium This card is part of the premium lesson. Unlock

STATE TRANSITION EXAMPLE

Explanation

Virtual instructions: PUSH 5 ……

Premium This card is part of the premium lesson. Unlock
Explanation

After PUSH 5: S1: Stack = [5] After PUSH 3: S2: Stack = [5, 3] Af……

Premium This card is part of the premium lesson. Unlock
Comparison
Physical Computer vs Virtual Computer
Comparison
Native Machine Code vs Bytecode
Important

Remember this flow: Source Program ↓ Compil……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error

Confuse செய்ய வேண்டாம்: Virtual Computer ≠ Physical Computer Virtual Computer ≠ Virtual……

Premium This card is part of the premium lesson. Unlock
Memory Trick

VIRTUAL V → Virtual machine I → Intermediate code R → Runtime execution T → Translation U → Uniform platform ……

Premium This card is part of the premium lesson. Unlock
TRB Point

1. A software-defined abstrac……

Premium This card is part of the premium lesson. Unlock
TRB Point

Answer: Virtual Machine / Vir……

Premium This card is part of the premium lesson. Unlock

JVM stands for:

TRB Point

Answer: Java Virtual Machine…

Premium This card is part of the premium lesson. Unlock

Java compiler produces:

TRB Point

Answer: Bytecode…

Premium This card is part of the premium lesson. Unlock

Bytecode is executed by:

TRB Point

Answer: JVM…

Premium This card is part of the premium lesson. Unlock

Virtual machines mainly improve:

TRB Point

Answer: Portability / machine……

Premium This card is part of the premium lesson. Unlock

P-code is associated with:

TRB Point

Answer: Intermediate portable……

Premium This card is part of the premium lesson. Unlock

P-code runs on:

TRB Point

Answer: P-machine…

Premium This card is part of the premium lesson. Unlock

JVM is primarily a:

TRB Point

Answer: Process/language virt……

Premium This card is part of the premium lesson. Unlock
TRB Point

1. Which mechanism converts in……

Premium This card is part of the premium lesson. Unlock
TRB Point

Answer: JIT compiler…

Premium This card is part of the premium lesson. Unlock
TRB Point

1. C++ normally requires JVM?…

Premium This card is part of the premium lesson. Unlock
TRB Point

Answer: No…

Premium This card is part of the premium lesson. Unlock
MCQ

A virtual computer is:…

Premium This card is part of the premium lesson. Unlock
MCQ

JVM executes:…

Premium This card is part of the premium lesson. Unlock
MCQ

The main purpose of a languag……

Premium This card is part of the premium lesson. Unlock
MCQ

Intermediate code improves:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which is not native machine c……

Premium This card is part of the premium lesson. Unlock
MCQ

JIT means:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which is an example of a lang……

Premium This card is part of the premium lesson. Unlock
MCQ

A virtual machine based on pu……

Premium This card is part of the premium lesson. Unlock
MCQ

Which is the correct order?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which statement about traditi……

Premium This card is part of the premium lesson. Unlock
TRB Point
Exam point

2 Marks Define Virtual Computer. A virtual computer is an abstract or software-defined machine that prov……

Premium This card is part of the premium lesson. Unlock
TRB Point

1. Definition 2. Abstract machine concept 3. Intermediate code ……

Premium This card is part of the premium lesson. Unlock
Summary

Virtual Computer ↓ Abstract / Software Machine ↓ Has virtual instructions ↓ Executes intermediate code ↓ Hide……

Premium This card is part of the premium lesson. Unlock
Text size
17px
Theme
Contents
Print / PDF
Program