Skip to content
VUBuddy

CS401 Midterm Short Notes by Almas Afzal

Computer Architecture and Assembly Language Programming PDF 2.3 MBUpdated 23 Oct 2026
Midterm past paper CS401 Midterm Short Notes by Almas Afzal PDF 2.3 MB
vubuddy.com
Type
Midterm past paper
Course
CS401 Computer Architecture and Assembly Language Programming
Size
PDF 2.3 MB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 2.3 MB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

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:

  1. Digital logic (AND, OR, NOT)
  2. 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.

Chapter 1 · Introduction to Assembly Language · 1.1. BASIC COMPUTER ARCHITECTURE · 1. Computer main parts:

  1. Processor (CPU) – Does the operations.
  2. Memory (RAM) – Stores data.
  3. 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.

This is done via 3 types of buses: · Bus · Purpose · Direction

Sends memory address (location) to access. Unidirectional (CPU →Memory)

Data Bus

Transfers actual data between CPU & Memory.

Bus · Purpose · Direction

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.
All CS401 files →
CS401 Computer Architecture and Assembly Language Programming All CS401 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.