CFAUnit 2
Unit 212 hours · CACS 101

Computer Hardware

CPU, Memory, I/O Devices & Storage

🧠

CPU Architecture

The brain of the computer — ALU, CU, and Registers

ALU (Arithmetic Logic Unit)

Performs all arithmetic (add, subtract, multiply, divide) and logical (AND, OR, NOT, compare) operations. Results are placed in the Accumulator register.

CU (Control Unit)

Directs all CPU operations: fetches instructions from memory, decodes them, and coordinates the ALU, registers, and buses to execute them. Does not process data itself.

Registers

Tiny, ultra-fast storage locations inside the CPU. Faster than cache or RAM. Hold the current instruction, data being processed, and memory addresses during execution.

Key Registers

RegisterFull NamePurpose
ACCAccumulatorStores the current result of ALU operations
PCProgram CounterHolds the address of the NEXT instruction to fetch
IRInstruction RegisterHolds the CURRENT instruction being decoded/executed
MARMemory Address RegisterHolds the address of the memory location being accessed
MBR/MDRMemory Buffer/Data RegisterTemporarily holds data being read from or written to memory

Word Size: The size of the CPU's registers (8, 16, 32, or 64 bits). A 64-bit processor has 64-bit registers and can address 2⁶⁴ bytes of memory. Larger word size = more data processed per cycle.

🗄

Memory Hierarchy

Speed vs capacity trade-off: closer to CPU = faster but smaller

RegistersFastest · < 1 KB · Inside CPU
Cache (L1/L2/L3)Very Fast · 256 KB – 32 MB · On CPU chip
RAM (Primary)Fast · 4 GB – 256 GB · On Motherboard
Secondary (HDD/SSD)Slow · 250 GB – 10 TB · Peripheral

Cache Memory (L1 / L2 / L3)

L1 Cache

Inside CPU core. Fastest, smallest (8–64 KB). Holds current instructions and data.

L2 Cache

On CPU chip, shared between cores. 256 KB – 4 MB. Feeds L1 on cache miss.

L3 Cache

Shared across all cores. 4 MB – 64 MB. Last cache level before RAM. Slowest cache.

Cache hit: Data found in cache → fast retrieval. Cache miss: Data not in cache → fetch from RAM (slower). The CPU's cache controller predicts what data will be needed next.

Primary Memory (RAM & ROM)

TypeFull NameVolatile?PurposeSubtypes
DRAMDynamic RAMYes (loses data without power)Main system memoryDDR3, DDR4, DDR5 modules
SRAMStatic RAMYesCache memory (faster than DRAM)Stays stable without refresh
ROMRead Only MemoryNo (permanent)Stores BIOS/firmwarePROM, EPROM, EEPROM
FlashFlash MemoryNoUSB drives, SSDs, memory cardsCombines RAM speed with ROM permanence
💾

Secondary Storage Devices

Persistent storage — data survives power-off

Hard Disk Drive (HDD)

Magnetic platters spinning at 5400–7200 RPM. Read/write head moves to track data. Cheap and high capacity but slower and fragile.

Capacity: Up to 20 TB · Speed: Slow (ms access)

Solid State Drive (SSD)

Flash memory chips — no moving parts. Much faster than HDD, shock-resistant, silent. More expensive per GB.

Capacity: Up to 8 TB · Speed: Very fast (μs access)

Optical Disk

Laser reads/writes data as pits and lands on a reflective surface. CD (~700 MB), DVD (~4.7 GB), Blu-ray (~25 GB).

Capacity: Up to 128 GB (BD-XL) · Speed: Moderate

Flash / USB Drive

Portable flash memory in USB form factor. Plug and play. Used for data transfer and backup.

Capacity: Up to 2 TB · Speed: Fast (USB 3.0+)

Input Devices

Devices that feed data into the computer

DeviceTypeHow It WorksCommon Use
KeyboardManual key entryElectrical signal sent per keypress, mapped to ASCII/UnicodeText and command input
MousePointing deviceOptical/laser tracks movement; buttons send click eventsGUI navigation, drawing
ScannerImage inputCCD sensor captures light reflected from documentDigitizing documents/photos
Barcode ReaderOCR / source dataLaser reads parallel line patterns encoding numbersRetail, inventory management
OMROptical Mark RecognitionDetects pencil marks in predefined positionsMCQ answer sheets, surveys
OCROptical Character RecognitionSoftware interprets scanned text charactersConverting printed text to editable format
MICRMagnetic Ink Character RecognitionReads magnetic ink characters on chequesBank cheque processing
Webcam / Digital CameraImage/video inputCCD/CMOS sensor converts light to digital signalVideo calls, photography
MicrophoneAudio inputConverts sound waves to electrical signalVoice input, recording
TouchscreenTouch/gesture inputCapacitive or resistive layer detects touch coordinatesSmartphones, kiosks, tablets
🖥

Output Devices

Devices that present processed results to the user

Monitor (VDU)

Visual (Soft Copy)

Displays output on screen. Types: LCD, LED, OLED. Resolution: 1080p, 4K. Measured in inches diagonally.

Printer

Hard Copy

Produces permanent paper output. Types: Inkjet (home), Laser (office), Dot-matrix (continuous paper), Thermal (receipts).

Plotter

Hard Copy (large)

Produces high-precision large-format drawings. Used by engineers, architects, cartographers.

Speakers

Audio output

Convert digital audio signal to sound waves. Used in multimedia, voice responses, alarm systems.

Projector

Visual (large scale)

Projects display onto a large screen or wall. Used in classrooms, conferences, cinemas.

Headphones

Personal audio

Private audio output. Used in recording studios, gaming, assistive hearing devices.

🚌

Bus Architecture & Instruction Cycle

How data travels and how instructions execute

System Bus Types

Data Bus

Carries actual data between CPU, memory, and I/O devices. Width = word size (8/16/32/64 bits). Bidirectional.

Address Bus

Carries memory addresses from CPU to memory. Width determines how much memory CPU can address. Unidirectional.

Control Bus

Carries control signals: read/write commands, interrupt requests, clock signals. Coordinates all components.

Instruction Cycle (Fetch → Decode → Execute → Store)

1. FETCH

PC → MAR; Memory sends instruction → MBR → IR; PC increments

2. DECODE

CU reads IR; identifies opcode (what to do) and operand (what to do it to)

3. EXECUTE

ALU performs the operation; result stored in ACC register

4. STORE

Result written back to memory or I/O device if required

RISC vs CISC

Two philosophies for CPU instruction set design

FeatureRISCCISC
Full NameReduced Instruction Set ComputerComplex Instruction Set Computer
InstructionsSmall, simple, fixed-sizeLarge, complex, variable-size
ExecutionEach instruction: 1 clock cycleSome instructions: many clock cycles
RegistersMany general-purpose registersFewer registers
Memory accessLoad/Store model onlyInstructions can directly access memory
CompilerComplex compiler neededSimpler compiler
ExamplesARM (mobile), MIPS, PowerPCIntel x86, AMD (PCs, laptops)

Why RISC won in mobile

ARM (RISC) chips dominate smartphones because simple instructions = less transistors = less heat = less battery. Every iPhone and Android phone uses ARM.

Why CISC stays in PCs

x86 instruction set compatibility spans 40+ years. Your modern Intel/AMD CPU has a CISC front-end that internally translates to RISC micro-operations.

Analytical Questions

📋

Unit 2 Summary

Core topics and important exam questions

Core Topics Covered

CPU components: ALU, CU, Registers

Key registers: PC, ACC, IR, MAR, MBR

Memory hierarchy (registers → cache → RAM → secondary)

Primary memory: RAM (DRAM, SRAM), ROM, Flash

Secondary storage: HDD, SSD, optical, USB

Input devices (keyboard, mouse, scanner, OMR, MICR)

Output devices (monitor, printer, projector)

System bus: data, address, control

Instruction cycle: Fetch → Decode → Execute → Store

RISC vs CISC comparison

Important Exam Questions

Explain the components of CPU with diagram. (5 marks)

Describe the memory hierarchy. Why is cache needed? (5 marks)

Compare RAM and ROM. Compare HDD and SSD. (5 marks)

Explain the fetch-decode-execute cycle. (5 marks)

Differentiate between RISC and CISC with examples. (5 marks)

List and explain common input and output devices. (5 marks)

Syllabus Coverage Checklist

Motherboard

CPU architecture (ALU, CU, registers)

Memory hierarchy and types

Storage devices

Ports and interfaces

Expansion slots

Input/output hardware

BIOS/CMOS/SMPS (see Unit 1 for motherboard detail)

Microprocessor basics

🧠

How to Remember This Unit

Mnemonics for hardware components

CPU = "ACE"

A=ALU (does arithmetic) · C=Control Unit (directs traffic) · E=... well, registers (inside everywhere)

Memory hierarchy: "R-Can-Ruin-a-Superfast-System"

R=Registers · Ca=Cache · Ra=RAM · S=Secondary storage

Registers: "PC Always Installs Missed Data"

PC=Program Counter · ACC=Accumulator · IR=Instruction Register · MAR=Memory Address Register · MBR=Memory Buffer Register

RISC = "SAFE"

S=Simple instructions · A=ARM architecture · F=Fixed size · E=Each instruction = 1 cycle

Bus types: "DAC"

D=Data bus (carries data) · A=Address bus (carries addresses) · C=Control bus (carries commands)

Instruction cycle: "FDES"

F=Fetch · D=Decode · E=Execute · S=Store

Unit 2 Quiz

1. The part of the CPU that performs arithmetic and logical operations is called:

2. Which register holds the memory address of the next instruction to be fetched?

3. Cache memory is placed between:

4. Which is the correct order of memory speed (fastest to slowest)?

5. RISC architecture is characterized by:

BCAStudyHub

Your complete interactive study guide for TU BCA Semester I — covering all subjects with interactive tools, past papers, and exam prep.

TU BCASemester I

Program Info

University
Tribhuvan University
Program
BCA — Bachelor in Computer Application
Semester
I (First)
Subjects
5 (4 live, 1 coming soon)

Made by SawnN