Imp Question Notes
Imp Question Notes
Cache mapping is the method used to decide where data from main memory will be placed in the
cache memory.
1. Direct Mapping
Formula:
Cache Line = (Main Memory Block Address) MOD (Number of Cache Lines)
Fast
Can lead to frequent collisions if multiple blocks map to the same line.
• Cache is divided into sets, and each set has multiple lines (ways).
• A memory block maps to a specific set, but any line within that set.
Formula:
1. Registers
2. Cache Memory
• Types:
• Managed by the OS
• Usually read-only, though modern versions can be updated (like EEPROM, Flash)
6. Secondary Storage
Summary Table
Features:
Disadvantages:
• Von Neumann Bottleneck: CPU must wait when fetching instructions and data
Used In:
Harvard Architecture
Features:
Advantages:
Disadvantages:
Used In:
Summary Table
A CPU cycle refers to a single tick of the clock signal that drives a computer's central processing unit
(CPU). It's the basic unit of time in which the CPU can perform a task, like moving data, performing
arithmetic, or accessing memory.
• During each cycle, the CPU can execute a small part of an instruction (or a full instruction,
depending on complexity).
Example:
Let’s say the CPU is running at 3 GHz (3 gigahertz) — that means it can perform 3 billion cycles per
second.
• Complex instructions (like memory access or division) might take multiple cycles.
• Performance: More cycles per second (higher clock speed) usually means faster processing.
• Efficiency: CPUs are designed to do more work per cycle (this is why a 2 GHz CPU can
outperform a 3 GHz CPU if it does more per cycle).
• Optimization: Software developers try to write code that uses fewer CPU cycles to complete
a task — this means faster and more efficient programs.
Analogy:
• But smarter designs (more efficient CPUs) can do more with each move, not just move
faster.
What are Registers in a CPU?
Registers are small, ultra-fast memory units located inside the CPU. They are used to store and
manipulate data that the CPU is currently working on.
Feature Description
Registers hold:
• Instruction addresses
• Intermediate results
They enable the CPU to access and manipulate data without delay, unlike RAM or cache which takes
more time.
Program Counter (PC) Holds the address of the next instruction to execute
These are two fundamental concepts in computer science that help you understand how computers
work at a low level — from hardware to the code that directly interacts with it.
1. Computer Organization
Computer Organization focuses on how a computer system is structured internally and how its
different parts work together.
Main Components:
Component Function
2. Assembly Language
Assembly Language is a low-level programming language that has a 1-to-1 mapping with machine
instructions. It is specific to the CPU architecture (e.g., x86, ARM).
Key Features:
• Uses mnemonics (short codes) for operations (e.g., MOV, ADD, SUB)
• Requires an assembler to convert to machine code
• Assembly Language shows you how to write those instructions in a form the CPU
understands.
• Great for system programming, embedded systems, reverse engineering, and game dev.
• Makes you a better programmer even at higher levels like C++ or Python.