CS401 Midterm Short Notes by Almas Afzal
- Type
- Midterm past paper
- Course
- CS401 Computer Architecture and Assembly Language Programming
- Size
- PDF 2.3 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 43. Download the file for all 43 pages.
CS401 – Preface
Q1. What is Assembly Language?
- A programming language that talks directly to the computer.
- In high-level languages (like C, C++, Java), there is a “gap” between the
programmer and the machine.
- This gap is filled by compilers or interpreters, but in assembly, you bypass most of them.
- It works close to hardware, giving you more control.
Q2. Is it difficult?
- People think it’s hard, but it’s actually simple.
- It looks hard because we are used to thinking computers are complicated.
- Assembly is just direct and clear — what you write is exactly what the computer does.
3. Course focus
- Examples will use IBM PC with Intel processors.
- Concepts will be platform-independent (can work on any system).
Basic knowledge needed:
- Digital logic (AND, OR, NOT)
- Binary numbers and arithmetic
Q4. Why learn Assembly?
Optimization: Makes code faster by removing unnecessary instructions. Real-time systems: Needed when operations must finish in a fixed time. Fine control: You control each instruction — no hidden steps like in “for” loops in high-level languages.
Q5. When to use it?
- In performance-critical parts of a program (e.g., image processing).
- To make programs run faster by saving CPU cycles.
- To meet exact timing requirements in hardware control systems.
Q6. How to learn it?
- You can’t just read; you must practice.
- Try every example, run code, test, and experiment.
- Only by doing this will you see how powerful and simple it is.
- Processor (CPU) – Does the operations.
- Memory (RAM) – Stores data.
- I/O devices – Connects computer to outside world (keyboard, display, etc.).
For now, we focus only on Processor + Memory.
2. Communication between CPU & Memory
To work, CPU must:
- Know which data to read/write.
- Tell memory whether to read or write.
- Actually transfer the data.
Sends memory address (location) to access. Unidirectional (CPU →Memory)
Data Bus
Transfers actual data between CPU & Memory.
Control Bus Sends control signals (read/write, status info).
3. How each bus works
- Tells memory exactly which cell to use (like giving an address to a postman).
- Always one-way from CPU to Memory.
- Example: “Fifth book from top” = specific memory location.
- Memory cell size is called cell width (often 8-bit = 1 byte).
Data Bus
- Transfers actual data.
- Can go both directions: 1. CPU →Memory (write) 2. Memory →CPU (read)
Control Bus
Sends read/write commands and special status signals. Also lets peripherals send “status” back to CPU (e.g., “door locked” message). Ensures synchronization — CPU reads when memory is ready, writes when memory can accept.
4. Why synchronization is important
- If CPU wants to read but memory is trying to write →No communication happens.
- Control bus ensures CPU and memory act in correct order (one speaks, one listens).
1.2 Registers
What are Registers?
- Tiny, super-fast storage areas inside the CPU.
- Used to hold data (operands) temporarily while processing.
- Faster than main memory.
- Very few in number →precious resource.
Why do we need Registers?
- CPU can get only one data item at a time from memory via the data bus.
Related CS401 files
All CS401 files →- CS401 Midterm Past Papers by Mohsin Chinioti Midterm PDF 1.4 MB
- CS401 Midterm MCQs by Talha Sajid Midterm PDF 1 MB
- CS401 Midterm Past Papers Midterm PDF 92 KB
- CS401 Midterm Topics by Ray Afzal Midterm PDF 500 KB
- CS401 Highlighted Handouts Highlighted PDF 1.5 MB
- CS401 Grand Quiz by Junaid Quiz PDF 368 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.