Computer Organization & Architecture

Unit 3: Computer Organization

From instruction codes to interrupt handling โ€” master Mano's Basic Computer architecture, the common bus system, and the complete instruction cycle used in every modern processor.

โฑ๏ธ 7 hrs theory + 5 hrs lab  |  ๐ŸŽฏ GATE ~4 marks  |  ๐Ÿ–ฅ๏ธ Mano's Basic Computer

๐Ÿ’ผ Jobs this unlocks: Hardware Design Engineer (โ‚น6โ€“10 LPA)  |  VLSI Engineer (โ‚น8โ€“15 LPA)  |  Embedded Systems (โ‚น5โ€“9 LPA)

Section A

Opening Hook โ€” The Brain Inside Your Phone

๐Ÿข Qualcomm Snapdragon 8 Gen 3 โ€” The โ‚น80,000-Crore Bus Architecture in Your Pocket

When you unlock your OnePlus 12 or Samsung Galaxy S24 Ultra, a marvel of computer organization springs to life. The Qualcomm Snapdragon 8 Gen 3 chip inside contains over 20 billion transistors on a die smaller than your fingernail. But raw transistors are useless without organisation โ€” how data moves between the CPU cores, memory, GPU, and I/O peripherals.

At the heart of this chip lies a bus architecture โ€” a set of shared communication pathways that connect the Kryo CPU cores, the Adreno 750 GPU, the Hexagon DSP, and LPDDR5X memory. Every instruction you trigger โ€” opening Instagram, running a BGMI match, scanning a UPI QR code โ€” travels through this bus system at speeds exceeding 4 GHz. The bus must arbitrate: Who gets to talk? In what order? How does the CPU fetch the next instruction while the GPU renders a frame?

This chapter teaches you exactly how a computer is organised internally โ€” using Mano's Basic Computer as the foundational model. Every concept here โ€” registers, buses, instruction cycles, interrupts โ€” maps directly to what happens inside that Snapdragon chip. Understanding this is the difference between a coder and a computer engineer.

๐Ÿ‡ฎ๐Ÿ‡ณ Qualcomm India (Hyderabad)๐Ÿ‡ฎ๐Ÿ‡ณ Samsung R&D (Bangalore)๐Ÿ‡ฎ๐Ÿ‡ณ ARM India (Bangalore)๐Ÿ‡ฎ๐Ÿ‡ณ Intel India (Bangalore)๐Ÿ‡ฎ๐Ÿ‡ณ MediaTek India๐Ÿ‡ฎ๐Ÿ‡ณ ISRO (Ahmedabad)
India is the world's #2 chip design hub. Qualcomm's Hyderabad centre designed critical components of the Snapdragon 8 Gen 3's bus interconnect. Over 20,000 chip designers in India work on processor organisation โ€” the exact topic of this chapter. GATE COA questions worth ~4 marks come directly from Mano's Basic Computer topics covered here.
Section B

Learning Outcomes โ€” Bloom's Taxonomy Mapped (12 Outcomes)

Bloom's LevelLearning Outcome
๐Ÿ”ต RememberLO1: List all 8 registers of Mano's Basic Computer with their bit-widths and functions
๐Ÿ”ต RememberLO2: State the 16-bit instruction format: I(1) + Opcode(3) + Address(12) and recall all 7 memory-reference opcodes
๐ŸŸข UnderstandLO3: Explain how the common bus system uses MUX selection lines Sโ‚‚Sโ‚Sโ‚€ to route data between registers
๐ŸŸข UnderstandLO4: Describe the Fetch-Decode-Execute cycle with timing signals Tโ‚€, Tโ‚, Tโ‚‚ and their micro-operations
๐ŸŸก ApplyLO5: Trace the complete execution of any memory-reference instruction (AND, ADD, LDA, STA, BUN, BSA, ISZ) through all timing states
๐ŸŸก ApplyLO6: Write RTL (Register Transfer Language) micro-operations for each instruction and timing signal
๐ŸŸ  AnalyzeLO7: Compare hardwired vs microprogrammed control units โ€” speed, flexibility, complexity, and use cases
๐ŸŸ  AnalyzeLO8: Analyze the interrupt cycle and determine how IEN, FGI, FGO flags interact to handle I/O
๐Ÿ”ด EvaluateLO9: Evaluate design trade-offs in bus width, register count, and instruction format for a basic CPU
๐Ÿ”ด EvaluateLO10: Justify why Mano's 25-instruction architecture is sufficient to demonstrate Turing-completeness
๐ŸŸฃ CreateLO11: Design a simple CPU simulator that implements the fetch-decode-execute cycle for Mano's instructions
๐ŸŸฃ CreateLO12: Construct timing diagrams and control signal tables for a new custom instruction added to Mano's ISA
Section C

Concept Explanation โ€” Mano's Basic Computer from Scratch

1. Instruction Codes

Every computer instruction is a binary code that tells the CPU what to do and where to find data. In Mano's Basic Computer, instructions are exactly 16 bits long.

๐Ÿ“ 16-Bit Mano Instruction Format

  15   14  13  12   11                          0
โ”Œโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  I โ”‚    Opcode    โ”‚        Address (12 bits)    โ”‚
โ”‚    โ”‚  (3 bits)    โ”‚                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  โ†‘        โ†‘                    โ†‘
  โ”‚        โ”‚                    โ””โ”€โ”€ Memory address (0โ€“4095)
  โ”‚        โ””โ”€โ”€ Operation code (0โ€“7)
  โ””โ”€โ”€ Addressing mode: 0 = Direct, 1 = Indirect

Bit 15 (I): The indirect addressing bit. When I = 0, the address field directly points to the operand. When I = 1, the address field points to a memory location that contains the actual operand address.

Bits 14โ€“12 (Opcode): 3 bits = 8 possible opcodes (0โ€“7). Seven are memory-reference instructions; opcode 111 is used for register-reference and I/O instructions.

Bits 11โ€“0 (Address): 12 bits = 2ยนยฒ = 4096 addressable memory locations (4K words).

Opcode Table โ€” The 7 Memory-Reference Instructions

Opcode (Hex)SymbolOperationRTL Description
0x0 (000)ANDBitwise ANDAC โ† AC โˆง M[effective address]
0x1 (001)ADDAdd to ACAC โ† AC + M[effective address], E โ† carry
0x2 (010)LDALoad to ACAC โ† M[effective address]
0x3 (011)STAStore ACM[effective address] โ† AC
0x4 (100)BUNBranch UnconditionallyPC โ† effective address
0x5 (101)BSABranch and Save ReturnM[effective address] โ† PC, PC โ† effective address + 1
0x6 (110)ISZIncrement and Skip if ZeroM[effective address] โ† M[effective address] + 1; if result = 0, PC โ† PC + 1
Mnemonic trick for opcodes: All Adding Ladies Should Bring Beautiful Items โ†’ AND, ADD, LDA, STA, BUN, BSA, ISZ (opcodes 0โ€“6 in order). This appears in GATE questions every year!

Direct vs Indirect Addressing โ€” The Courier Analogy:

Direct (I=0): You give a courier the address "Flat 301, Tower B." He goes straight there. The address in the instruction IS the location of the data.

Indirect (I=1): You give a courier the address "Go to the security desk." The security desk has a chit saying "Flat 301, Tower B." The courier goes to the desk first, reads the chit, then goes to the flat. The instruction points to a place that holds the actual address.

Students confuse opcode 111 (7) with memory-reference instructions. When opcode = 111, the instruction is NOT a memory-reference instruction. If I=0, it's a register-reference instruction. If I=1, it's an I/O instruction. The 12-bit address field now becomes individual operation bits, not a memory address.

2. Computer Registers

Registers are the fastest storage inside the CPU โ€” like Post-it notes on your desk versus a filing cabinet across the room (RAM). Mano's Basic Computer has 8 registers:

๐Ÿ—„๏ธ Register Set of Mano's Basic Computer

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  MANO'S BASIC COMPUTER REGISTERS            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Register โ”‚ Bits โ”‚ Function                                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ PC       โ”‚  12  โ”‚ Program Counter โ€” next instruction addr   โ”‚
โ”‚ AR       โ”‚  12  โ”‚ Address Register โ€” holds memory address   โ”‚
โ”‚ IR       โ”‚  16  โ”‚ Instruction Register โ€” current instructionโ”‚
โ”‚ AC       โ”‚  16  โ”‚ Accumulator โ€” main data register, ALU     โ”‚
โ”‚ DR       โ”‚  16  โ”‚ Data Register โ€” operand from memory       โ”‚
โ”‚ TR       โ”‚  16  โ”‚ Temporary Register โ€” temp storage         โ”‚
โ”‚ INPR     โ”‚   8  โ”‚ Input Register โ€” keyboard input char      โ”‚
โ”‚ OUTR     โ”‚   8  โ”‚ Output Register โ€” display output char     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ E        โ”‚   1  โ”‚ Carry flip-flop (overflow from AC)        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Memory   โ”‚  16  โ”‚ 4096 words ร— 16 bits = 4K ร— 16           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why 12-bit PC and AR? Because the address field is 12 bits, addressing 2ยนยฒ = 4096 locations. The PC and AR only need to hold addresses, so 12 bits suffice.

Why 16-bit AC, DR, IR, TR? Because the memory word size is 16 bits. Data and instructions are both 16 bits wide, so these registers match.

Why 8-bit INPR and OUTR? Because I/O devices (keyboard, printer) use ASCII characters, which are 8 bits (0โ€“255).

Think of registers like the counters at an Indian railway station: PC is the queue number display (tells which passenger/instruction is next). AR is the "Go to Window 5" direction (address to access). IR is the form you fill (the instruction being processed). AC is the cashier's drawer (where computation happens). DR is the customer's wallet (brings data). INPR is the microphone (input device). OUTR is the speaker (output device).

3. Common Bus System

The common bus is a shared highway that connects all registers and memory. Only one register can put data on the bus at a time. A multiplexer (MUX) controlled by three selection lines Sโ‚‚Sโ‚Sโ‚€ decides who gets to "drive" the bus.

๐Ÿ”€ Common Bus System โ€” Full Architecture

         Sโ‚‚ Sโ‚ Sโ‚€  (Bus Select Lines from Control Unit)
          โ”‚  โ”‚  โ”‚
          โ–ผ  โ–ผ  โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚   16-bit MUX    โ”‚ โ—„โ”€โ”€ Selects which register outputs to bus
    โ”‚  (Multiplexer)  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚
             โ–ผ
    โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
    โ•‘          16-BIT COMMON BUS                 โ•‘
    โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
      โ”‚      โ”‚      โ”‚      โ”‚      โ”‚      โ”‚      โ”‚
      โ–ผ      โ–ผ      โ–ผ      โ–ผ      โ–ผ      โ–ผ      โ–ผ
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ AR  โ”‚โ”‚ PC  โ”‚โ”‚ DR  โ”‚โ”‚ AC  โ”‚โ”‚ IR  โ”‚โ”‚ TR  โ”‚โ”‚Memoryโ”‚
   โ”‚[12] โ”‚โ”‚[12] โ”‚โ”‚[16] โ”‚โ”‚[16] โ”‚โ”‚[16] โ”‚โ”‚[16] โ”‚โ”‚[4Kร—16]โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚         MUX SELECT LINE ENCODING                 โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚ Sโ‚‚Sโ‚Sโ‚€  โ”‚  Register on Bus                      โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  0 0 1  โ”‚  AR  (Address Register)                โ”‚
  โ”‚  0 1 0  โ”‚  PC  (Program Counter)                 โ”‚
  โ”‚  0 1 1  โ”‚  DR  (Data Register)                   โ”‚
  โ”‚  1 0 0  โ”‚  AC  (Accumulator)                     โ”‚
  โ”‚  1 0 1  โ”‚  IR  (Instruction Register)            โ”‚
  โ”‚  1 1 0  โ”‚  TR  (Temporary Register)              โ”‚
  โ”‚  1 1 1  โ”‚  Memory (M[AR])                        โ”‚
  โ”‚  0 0 0  โ”‚  None (bus idle)                       โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  Data Flow Example:  DR โ† M[AR]
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  1. Control sets Sโ‚‚Sโ‚Sโ‚€ = 111 (Memory on bus)
  2. Memory reads word at address in AR
  3. Data appears on common bus
  4. DR load signal is activated
  5. DR latches the data from bus

Analogy โ€” Delhi Metro Shared Track: Think of the common bus as a Delhi Metro line. Only one train (register data) can use a track segment at a time. The signalling system (Sโ‚‚Sโ‚Sโ‚€) decides which train goes next. If two trains try to use the same track โ€” collision! Similarly, if two registers drive the bus simultaneously โ€” data corruption!

Bus โ‰  multiple parallel connections. A common bus is a SHARED medium. Students often draw it as separate wires from each register to every other register. In reality, there is ONE set of 16 wires, and a MUX decides who outputs to them. This saves enormous wiring compared to point-to-point connections (which would need n(n-1)/2 connections for n registers).

4. Computer Instructions

Mano's Basic Computer has exactly 25 instructions divided into three categories:

๐Ÿ“‹ Complete Instruction Set โ€” Three Categories

Category 1: Memory-Reference Instructions (7 instructions)

These use a 12-bit address to access memory. Opcode = 000 to 110. I bit determines direct/indirect.

SymbolOpcodeDescription
AND000AND memory word to AC
ADD001Add memory word to AC
LDA010Load memory word to AC
STA011Store AC in memory
BUN100Branch unconditionally
BSA101Branch and save return address
ISZ110Increment and skip if zero
Category 2: Register-Reference Instructions (12 instructions)

Opcode = 111, I = 0. The 12-bit field specifies the operation (only one bit is set).

Hex CodeSymbolDescription
7800CLAClear AC
7400CLEClear E (carry flip-flop)
7200CMAComplement AC
7100CMEComplement E
7080CIRCircular right shift AC and E
7040CILCircular left shift AC and E
7020INCIncrement AC
7010SPASkip if AC positive (ACโ‚โ‚… = 0)
7008SNASkip if AC negative (ACโ‚โ‚… = 1)
7004SZASkip if AC zero
7002SZESkip if E is zero
7001HLTHalt the computer
Category 3: I/O Instructions (6 instructions)

Opcode = 111, I = 1. Used for input/output and interrupt control.

Hex CodeSymbolDescription
F800INPInput character to AC(0โ€“7)
F400OUTOutput character from AC(0โ€“7)
F200SKISkip if input flag FGI = 1
F100SKOSkip if output flag FGO = 1
F080IONInterrupt enable on (IEN โ† 1)
F040IOFInterrupt enable off (IEN โ† 0)
25 instructions are enough to compute anything! Mano's Basic Computer with just 25 instructions is Turing-complete โ€” meaning it can theoretically compute anything that any modern computer can, given enough time and memory. Your Snapdragon has billions of transistors, but the fundamental principle is the same.

5. Timing and Control

The control unit is the "brain of the brain" โ€” it generates signals that tell every other component what to do and when. There are two fundamentally different approaches:

Approach 1: Hardwired Control Unit

โšก Hardwired Control โ€” Speed at the Cost of Flexibility

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚              HARDWIRED CONTROL UNIT             โ”‚
  โ”‚                                                 โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
  โ”‚  โ”‚  IR    โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Decoder    โ”‚โ”€โ”€โ”€โ–ถโ”‚ Controlโ”‚ โ”‚
  โ”‚  โ”‚(opcode)โ”‚     โ”‚  (3ร—8 dec)   โ”‚    โ”‚ Logic  โ”‚ โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚(gates) โ”‚ โ”‚
  โ”‚                                      โ”‚        โ”‚ โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚        โ”‚ โ”‚
  โ”‚  โ”‚Sequenceโ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Decoder    โ”‚โ”€โ”€โ”€โ–ถโ”‚        โ”‚ โ”‚
  โ”‚  โ”‚Counter โ”‚     โ”‚  (4ร—16 dec)  โ”‚    โ”‚        โ”‚ โ”‚
  โ”‚  โ”‚ (SC)   โ”‚     โ”‚  Tโ‚€,Tโ‚...Tโ‚โ‚…โ”‚    โ”‚        โ”‚ โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ”‚
  โ”‚                                          โ”‚      โ”‚
  โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
  โ”‚         โ–ผ                                       โ”‚
  โ”‚  Control Signals: Load, Clear, Increment,      โ”‚
  โ”‚  Read, Write, MUX select (Sโ‚‚Sโ‚Sโ‚€), ALU op     โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  How it works:
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  โ€ข Instruction opcode bits from IR are decoded (3-to-8 decoder)
  โ€ข Sequence counter SC provides timing signals Tโ‚€, Tโ‚, Tโ‚‚...
  โ€ข Combinational logic gates combine decoded signals + timing
    to produce exact control signals at each clock cycle
  โ€ข SC increments each clock: Tโ‚€ โ†’ Tโ‚ โ†’ Tโ‚‚ โ†’ ...
  โ€ข After instruction completes, SC is cleared back to Tโ‚€

Approach 2: Microprogrammed Control Unit

๐Ÿงฌ Microprogrammed Control โ€” Flexibility at the Cost of Speed

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚          MICROPROGRAMMED CONTROL UNIT           โ”‚
  โ”‚                                                 โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
  โ”‚  โ”‚  IR    โ”‚โ”€โ”€โ”€โ–ถโ”‚  Mapping Logic     โ”‚           โ”‚
  โ”‚  โ”‚(opcode)โ”‚    โ”‚  (opcodeโ†’ยตaddr)    โ”‚           โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
  โ”‚                         โ”‚                        โ”‚
  โ”‚                         โ–ผ                        โ”‚
  โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”‚
  โ”‚              โ”‚  Control Address โ”‚                โ”‚
  โ”‚              โ”‚  Register (CAR)  โ”‚                โ”‚
  โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ”‚
  โ”‚                       โ”‚                          โ”‚
  โ”‚                       โ–ผ                          โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚
  โ”‚  โ”‚       CONTROL MEMORY (ROM)          โ”‚        โ”‚
  โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚        โ”‚
  โ”‚  โ”‚  โ”‚ ยตAddress โ”‚ Control โ”‚ Next Addrโ”‚  โ”‚        โ”‚
  โ”‚  โ”‚  โ”‚          โ”‚  Word   โ”‚  Field   โ”‚  โ”‚        โ”‚
  โ”‚  โ”‚  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚  โ”‚        โ”‚
  โ”‚  โ”‚  โ”‚  0x00    โ”‚ 01010.. โ”‚  0x01    โ”‚  โ”‚        โ”‚
  โ”‚  โ”‚  โ”‚  0x01    โ”‚ 11001.. โ”‚  0x02    โ”‚  โ”‚        โ”‚
  โ”‚  โ”‚  โ”‚  0x02    โ”‚ 00110.. โ”‚  0x00    โ”‚  โ”‚        โ”‚
  โ”‚  โ”‚  โ”‚   ...    โ”‚   ...   โ”‚   ...    โ”‚  โ”‚        โ”‚
  โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚        โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ”‚
  โ”‚                         โ”‚                        โ”‚
  โ”‚                         โ–ผ                        โ”‚
  โ”‚                  Control Signals                 โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  How it works:
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  โ€ข Each machine instruction maps to a sequence of ยต-instructions
  โ€ข ยต-instructions stored in Control Memory (ROM)
  โ€ข Each ยต-instruction word contains control signal bits
  โ€ข CAR sequences through ยต-instructions automatically
  โ€ข To change CPU behavior, just reprogram the ROM!

Comparison Table: Hardwired vs Microprogrammed

FeatureHardwiredMicroprogrammed
SpeedFaster (direct gate logic)Slower (ROM lookup each cycle)
FlexibilityInflexible โ€” redesign gates to modifyFlexible โ€” just update ROM contents
CostExpensive for complex ISAsCheaper for complex ISAs
Design ComplexityHigh (boolean equations grow exponentially)Lower (systematic tabular approach)
Used InRISC CPUs (ARM, MIPS)CISC CPUs (x86, VAX)
Bug FixingRequires physical redesignMicrocode patch (Intel does this!)
ExampleMano's Basic ComputerIntel Pentium, IBM System/360
GATE QuestionsFrequently askedComparison questions common
Qualcomm's Snapdragon uses hardwired control for its ARM Cortex cores (RISC architecture โ€” simple, fast instructions). But Intel's Core i7 (used in many Indian office PCs and data centres) uses microprogrammed control for its complex x86 CISC architecture. When Intel discovers a CPU bug (like Spectre/Meltdown in 2018), they push a microcode update โ€” literally reprogramming the control memory via a software patch!

6. Instruction Cycle โ€” Fetch-Decode-Execute

Every instruction goes through a three-phase cycle. Think of it as the heartbeat of the CPU โ€” it repeats for every single instruction, billions of times per second in modern processors.

๐Ÿ”„ Fetch-Decode-Execute State Diagram

  START
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Tโ‚€: FETCH Phase โ€” Step 1                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”‚
โ”‚  โ”‚  AR โ† PC                       โ”‚             โ”‚
โ”‚  โ”‚  (Put PC address into AR)       โ”‚             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚
โ”‚  Bus: Sโ‚‚Sโ‚Sโ‚€ = 010 (PC on bus), AR load         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Tโ‚: FETCH Phase โ€” Step 2                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”‚
โ”‚  โ”‚  IR โ† M[AR],  PC โ† PC + 1     โ”‚             โ”‚
โ”‚  โ”‚  (Read instruction from memory) โ”‚             โ”‚
โ”‚  โ”‚  (Increment PC to next addr)    โ”‚             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚
โ”‚  Bus: Sโ‚‚Sโ‚Sโ‚€ = 111 (Memory on bus), IR load     โ”‚
โ”‚  PC increment signal activated simultaneously    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Tโ‚‚: DECODE Phase                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”‚
โ”‚  โ”‚  Decode IR(14โ€“12) โ†’ opcode      โ”‚             โ”‚
โ”‚  โ”‚  AR โ† IR(11โ€“0)                  โ”‚             โ”‚
โ”‚  โ”‚  Determine: I, Dโ‚€โ€“Dโ‚‡            โ”‚             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚
โ”‚  3ร—8 Decoder produces Dโ‚€โ€“Dโ‚‡ from opcode bits    โ”‚
โ”‚  I = IR(15), decides direct/indirect             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚                     โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚ Dโ‚‡'I (Dโ‚‡=0)โ”‚      โ”‚ Dโ‚‡ (Dโ‚‡=1)  โ”‚
     โ”‚ Memory-Ref  โ”‚      โ”‚ Reg/IO Ref  โ”‚
     โ”‚ Instruction โ”‚      โ”‚ Instruction โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚                     โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚ Tโ‚ƒ: Check I โ”‚      โ”‚ Tโ‚ƒ: Executeโ”‚
     โ”‚ If I=1:     โ”‚      โ”‚ directly   โ”‚
     โ”‚ ARโ†M[AR]    โ”‚      โ”‚ (one cycle)โ”‚
     โ”‚(indirect)   โ”‚      โ”‚ SCโ†0       โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚Tโ‚„โ€“Tโ‚†:      โ”‚
     โ”‚EXECUTE Phaseโ”‚
     โ”‚(varies by   โ”‚
     โ”‚ instruction)โ”‚
     โ”‚ SC โ† 0      โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Analogy: Instruction Cycle = IRCTC Train Booking

Tโ‚€ (Fetch-1): You open IRCTC and type the train number (AR โ† PC โ€” you tell the system which record to look up).
Tโ‚ (Fetch-2): IRCTC retrieves the train details (IR โ† M[AR] โ€” read instruction from memory). You automatically move to the next step (PC++).
Tโ‚‚ (Decode): You read the form โ€” is this a booking? Cancellation? Tatkal? (Decode opcode). You also note the PNR/address details (AR โ† IR address).
Tโ‚ƒ (Indirect?): If it says "see agent for details," you first go to the agent (indirect addressing) before proceeding.
Tโ‚„+ (Execute): You actually click "Book" or "Cancel" โ€” the real work happens. After completion, you go back to start for the next operation (SC โ† 0).

Every train booking follows this cycle. Every CPU instruction follows this cycle. Billions of times per second.

7. Memory-Reference Instructions โ€” Complete Micro-operations

Each memory-reference instruction executes after the fetch and decode phases (Tโ‚€โ€“Tโ‚‚). If indirect addressing (I=1), Tโ‚ƒ resolves the effective address. The actual operation happens at Tโ‚„ (or Tโ‚ƒ for direct).

๐Ÿ”ง All 7 Memory-Reference Micro-operations

AND (Opcode 000) โ€” Dโ‚€Tโ‚…
Dโ‚€Tโ‚„: DR โ† M[AR]        // Read operand from memory
Dโ‚€Tโ‚…: AC โ† AC โˆง DR,     // Bitwise AND with accumulator
       SC โ† 0            // Clear sequence counter
ADD (Opcode 001) โ€” Dโ‚Tโ‚…
Dโ‚Tโ‚„: DR โ† M[AR]        // Read operand from memory
Dโ‚Tโ‚…: AC โ† AC + DR,     // Add operand to accumulator
       E โ† Cout,         // Carry goes to E flip-flop
       SC โ† 0            // Clear sequence counter
LDA (Opcode 010) โ€” Dโ‚‚Tโ‚…
Dโ‚‚Tโ‚„: DR โ† M[AR]        // Read operand from memory
Dโ‚‚Tโ‚…: AC โ† DR,          // Load data into accumulator
       SC โ† 0            // Clear sequence counter
STA (Opcode 011) โ€” Dโ‚ƒTโ‚„
Dโ‚ƒTโ‚„: M[AR] โ† AC,       // Store accumulator to memory
       SC โ† 0            // Clear sequence counter
BUN (Opcode 100) โ€” Dโ‚„Tโ‚„
Dโ‚„Tโ‚„: PC โ† AR,          // Set PC to branch address
       SC โ† 0            // Clear sequence counter
BSA (Opcode 101) โ€” Dโ‚…Tโ‚…
Dโ‚…Tโ‚„: M[AR] โ† PC,       // Save return address
       AR โ† AR + 1       // Point to next location
Dโ‚…Tโ‚…: PC โ† AR,          // Jump to subroutine
       SC โ† 0            // Clear sequence counter
ISZ (Opcode 110) โ€” Dโ‚†Tโ‚†
Dโ‚†Tโ‚„: DR โ† M[AR]        // Read memory word
Dโ‚†Tโ‚…: DR โ† DR + 1       // Increment the word
Dโ‚†Tโ‚†: M[AR] โ† DR,       // Write back to memory
       if (DR = 0) then PC โ† PC + 1,  // Skip next if zero
       SC โ† 0            // Clear sequence counter

๐Ÿ“ Execution Trace: ADD Instruction

Let's trace ADD 200 (direct addressing). Assume: PC=100, M[100]=1200โ‚โ‚† (ADD instruction with address 200), M[200]=0005โ‚โ‚†, AC=0003โ‚โ‚†

TimeMicro-operationARIRDRACPCBus
Tโ‚€AR โ† PC100โ€”โ€”0003100PCโ†’Busโ†’AR
Tโ‚IR โ† M[AR], PC++1001200โ€”0003101Mโ†’Busโ†’IR
Tโ‚‚Decode, AR โ† IR(0โ€“11)2001200โ€”0003101IRโ†’Busโ†’AR
Tโ‚ƒI=0, Dโ‚=1 (ADD)2001200โ€”0003101โ€”
Tโ‚„DR โ† M[AR]200120000050003101Mโ†’Busโ†’DR
Tโ‚…AC โ† AC+DR, SCโ†0200120000050008101ALU op

Result: AC = 0003 + 0005 = 0008. E = 0 (no carry). PC = 101 (ready for next instruction).

GATE Tip: The trace table is a gold mine. You'll be asked: "After executing ADD 200, what is the value in AC?" โ€” just trace through Tโ‚€ to Tโ‚… systematically. Write the table on rough paper during the exam. It prevents silly mistakes that cost 2 marks.

8. I/O and Interrupt

The CPU is millions of times faster than I/O devices (keyboard, printer). If the CPU waited for every keypress, it would waste 99.99% of its time doing nothing. The solution: interrupts.

๐Ÿ“ก I/O System โ€” Registers and Flags

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚              I/O SYSTEM REGISTERS               โ”‚
  โ”‚                                                 โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
  โ”‚  โ”‚  INPR    โ”‚          โ”‚  OUTR    โ”‚            โ”‚
  โ”‚  โ”‚ (8 bits) โ”‚          โ”‚ (8 bits) โ”‚            โ”‚
  โ”‚  โ”‚ Keyboard โ”‚          โ”‚ Display  โ”‚            โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
  โ”‚       โ”‚                     โ”‚                   โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”            โ”‚
  โ”‚  โ”‚ FGI      โ”‚          โ”‚ FGO      โ”‚            โ”‚
  โ”‚  โ”‚ (1 bit)  โ”‚          โ”‚ (1 bit)  โ”‚            โ”‚
  โ”‚  โ”‚ Input    โ”‚          โ”‚ Output   โ”‚            โ”‚
  โ”‚  โ”‚ Flag     โ”‚          โ”‚ Flag     โ”‚            โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
  โ”‚                                                 โ”‚
  โ”‚  FGI = 1 โ†’ New character ready in INPR         โ”‚
  โ”‚  FGI = 0 โ†’ No new input yet                    โ”‚
  โ”‚  FGO = 1 โ†’ Output device ready for new char    โ”‚
  โ”‚  FGO = 0 โ†’ Device busy, wait                   โ”‚
  โ”‚                                                 โ”‚
  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                  โ”‚
  โ”‚  โ”‚ IEN      โ”‚  Interrupt Enable (1 bit)        โ”‚
  โ”‚  โ”‚ (1 bit)  โ”‚  1 = interrupts allowed          โ”‚
  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  0 = interrupts disabled          โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

FGI (Input Flag): When you press a key, the keyboard controller sets FGI = 1 and loads the ASCII code into INPR. The CPU can then read INPR and clear FGI.

FGO (Output Flag): When the display finishes printing a character, it sets FGO = 1, signalling "I'm ready for the next character." The CPU loads OUTR and clears FGO.

IEN (Interrupt Enable): A master switch. If IEN = 0, the CPU ignores all I/O flags. If IEN = 1, the CPU checks FGI and FGO between instructions.

The Interrupt Cycle

๐Ÿšจ Interrupt Handling โ€” Step by Step

  After EXECUTE phase, before next FETCH:
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  Check: Is (IEN = 1) AND (FGI = 1 OR FGO = 1)?

      NO โ†’ Continue with next Fetch (Tโ‚€)
      YES โ†’ Enter INTERRUPT CYCLE:

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  INTERRUPT CYCLE (happens at Tโ‚€, Tโ‚, Tโ‚‚)       โ”‚
  โ”‚                                                  โ”‚
  โ”‚  Tโ‚€: AR โ† 0, TR โ† PC                           โ”‚
  โ”‚      (Save current PC, set AR to address 0)     โ”‚
  โ”‚                                                  โ”‚
  โ”‚  Tโ‚: M[0] โ† TR, PC โ† 0                         โ”‚
  โ”‚      (Store return address at M[0])              โ”‚
  โ”‚      (Set PC to address 0)                       โ”‚
  โ”‚                                                  โ”‚
  โ”‚  Tโ‚‚: PC โ† PC + 1, IEN โ† 0, SC โ† 0             โ”‚
  โ”‚      (PC now = 1 โ†’ jump to ISR at address 1)    โ”‚
  โ”‚      (Disable interrupts to prevent nesting)     โ”‚
  โ”‚      (Clear SC for next fetch)                   โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  After interrupt cycle:
  โ€ข PC = 1, so next instruction fetched from address 1
  โ€ข Address 1 contains: BUN [ISR address]
  โ€ข ISR (Interrupt Service Routine) handles the I/O
  โ€ข ISR ends with: ION (re-enable interrupts)
  โ€ข                BUN 0 I (indirect: jump to M[0] = return addr)

Analogy โ€” Interrupts = Doorbell while cooking: You're cooking biryani (executing instructions). The doorbell rings (FGI = 1 โ€” input ready). If you've told your family "don't disturb" (IEN = 0), you ignore it. But if IEN = 1, you note your recipe step (save PC), go answer the door (jump to ISR), handle the visitor, then return to cooking from where you left off (restore PC).

Students forget that IEN is cleared during the interrupt cycle. This is crucial โ€” it prevents a second interrupt from interrupting the ISR (no nested interrupts in Mano's basic model). The ISR must explicitly re-enable interrupts with ION before returning.
Section D

Learn by Doing โ€” 3-Tier Lab Structure

๐ŸŸข Tier 1 โ€” GUIDED: Trace an ADD Instruction on Paper

โฑ๏ธ 45โ€“60 minutesBeginnerZero prior knowledge assumed

Step 1: Set Up the Initial State

Draw this table on paper (or in a spreadsheet):

RegisterInitial Value
PC050 (hex)
AC000A (hex) = 10 in decimal
M[050]1080 (hex) โ†’ ADD 080 direct
M[080]0014 (hex) = 20 in decimal

Step 2: Decode the Instruction Manually

M[050] = 1080โ‚โ‚† = 0001 0000 1000 0000โ‚‚

Bit 15 (I) = 0 โ†’ Direct addressing

Bits 14โ€“12 (Opcode) = 001 โ†’ ADD

Bits 11โ€“0 (Address) = 000010000000 = 080โ‚โ‚†

Step 3: Trace Through Each Timing Signal

Fill in this trace table row by row:

TimeOperationARIRDRACPC
Tโ‚€AR โ† PC050โ€”โ€”000A050
Tโ‚IR โ† M[AR], PC++0501080โ€”000A051
Tโ‚‚Decode, AR โ† 0800801080โ€”000A051
Tโ‚ƒI=0, nothing extra0801080โ€”000A051
Tโ‚„DR โ† M[080]08010800014000A051
Tโ‚…AC โ† AC+DR08010800014001E051

โœ… AC = 000A + 0014 = 001E (30 decimal). PC = 051 (next instruction).

Step 4: Now Try LDA 080

Change M[050] to 2080โ‚โ‚† (LDA 080). Reset AC to 000A. Trace it yourself. The answer should be AC = 0014.

Self-check: Try tracing STA 080 with AC = 00FF. What changes in memory after execution?

๐ŸŸก Tier 2 โ€” SEMI-GUIDED: Build a CPU Simulator in Python

โฑ๏ธ 90โ€“120 minutesIntermediateBasic Python required

Your Mission:

Build a Python program that simulates Mano's Basic Computer. It should:

  1. Store a small program in a simulated 4096-word memory array
  2. Implement the fetch-decode-execute cycle
  3. Support at least: LDA, STA, ADD, AND, BUN, HLT
  4. Print the trace table after each instruction

Skeleton Code (fill the gaps):

Python
# Mano's Basic Computer Simulator โ€” Skeleton
memory = [0] * 4096   # 4K ร— 16-bit words
PC = 0; AC = 0; DR = 0; AR = 0; IR = 0; E = 0
running = True

# Load a test program
memory[0] = 0x2004   # LDA 004 (load M[004] into AC)
memory[1] = 0x1005   # ADD 005 (add M[005] to AC)
memory[2] = 0x3006   # STA 006 (store AC to M[006])
memory[3] = 0x7001   # HLT
memory[4] = 25        # Data: 25
memory[5] = 37        # Data: 37
memory[6] = 0         # Result location

while running:
    # T0: AR โ† PC
    AR = PC
    # T1: IR โ† M[AR], PC++
    IR = memory[AR]
    PC = (PC + 1) & 0xFFF
    # T2: Decode
    I = (IR >> 15) & 1
    opcode = (IR >> 12) & 7
    addr = IR & 0xFFF
    AR = addr

    # TODO: Handle indirect addressing (if I==1 and opcode!=7)
    # TODO: Implement each opcode
    # TODO: Print trace table row

print(f"Result at M[006]: {memory[6]}")
# Expected: 62 (25 + 37)
Stretch Goal: Add BSA (subroutine call) and BUN (unconditional jump) support. Write a program that adds three numbers using a subroutine.

๐Ÿ”ด Tier 3 โ€” OPEN CHALLENGE: Visual CPU Simulator in HTML/JS

โฑ๏ธ 3โ€“5 hoursAdvancedNo instructions โ€” real-world mini-project

The Brief:

Build an interactive web-based CPU simulator for Mano's Basic Computer. Features:

  1. Visual register display (PC, AR, IR, AC, DR, TR) with live values
  2. Memory table showing all loaded words
  3. "Step" button โ€” advances one timing signal at a time (Tโ‚€, Tโ‚, ...)
  4. "Run" button โ€” executes until HLT
  5. Common bus animation showing data flow between registers
  6. Instruction decode panel showing opcode, I-bit, and address in real-time
  7. Support all 25 Mano instructions

Deliverable: A single HTML file with embedded CSS/JS. Host it on GitHub Pages for your portfolio.

CPU simulators are portfolio gold. Embedded systems companies in India (Qualcomm, Samsung R&D, TI India) actively look for candidates who demonstrate understanding of computer organisation through projects. A visual CPU simulator on your GitHub will make you stand out in VLSI and embedded job interviews.
Section E

Practice Problems โ€” Diagrams, Numericals, Industry & GATE

Diagram Questions (3)

D1

Draw the complete common bus system of Mano's Basic Computer showing all 7 registers, MUX, bus, and selection lines Sโ‚‚Sโ‚Sโ‚€. Label each register with its bit-width.

ApplyIntermediate
Refer to the ASCII diagram in Section C.3. Key points: (1) 16-bit bus, (2) 7 inputs to MUX including Memory, (3) Sโ‚‚Sโ‚Sโ‚€ select lines from control unit, (4) AR and PC are 12-bit (zero-extended on bus), (5) INPR and OUTR are NOT on the common bus (they connect through AC).
D2

Draw the block diagram of a hardwired control unit showing: Instruction Register, opcode decoder, sequence counter, timing decoder, and control logic gates. Show how Dโ‚€โ€“Dโ‚‡ and Tโ‚€โ€“Tโ‚โ‚… signals are generated.

ApplyAdvanced
Key blocks: IR(14โ€“12) โ†’ 3ร—8 Decoder โ†’ Dโ‚€โ€“Dโ‚‡. SC(4-bit) โ†’ 4ร—16 Decoder โ†’ Tโ‚€โ€“Tโ‚โ‚…. Control logic takes Dโ‚€โ€“Dโ‚‡, Tโ‚€โ€“Tโ‚โ‚…, I bit, and condition flags as inputs. Outputs are control signals for every register (Load, Clear, Increment), bus select lines, and memory Read/Write.
D3

Draw the flowchart for the complete interrupt cycle showing the condition check (IEN, FGI, FGO), the three micro-operations at Tโ‚€, Tโ‚, Tโ‚‚, and the return mechanism.

ApplyIntermediate
Flowchart starts with decision diamond: "IEN=1 AND (FGI=1 OR FGO=1)?". If NO โ†’ proceed to Tโ‚€ of next fetch. If YES โ†’ Tโ‚€: ARโ†0, TRโ†PC. Tโ‚: M[0]โ†TR, PCโ†0. Tโ‚‚: PCโ†PC+1, IENโ†0, SCโ†0. Then normal fetch begins from PC=1.

Numerical Questions (6)

N1

The instruction at address 100โ‚โ‚† is 0x9200. What operation does it perform? Is it direct or indirect? What is the effective address?

ApplyBeginner
0x9200 = 1001 0010 0000 0000โ‚‚. I=1 (indirect). Opcode=001 (ADD). Address=0x200. Since I=1, effective address = M[0x200]. This is an indirect ADD: AC โ† AC + M[M[0x200]].
N2

Trace the execution of AND 0x050 (direct) with AC = 0xFF0F and M[050] = 0x0F0F. Show all timing signals Tโ‚€ through Tโ‚… and the final value of AC.

ApplyIntermediate
Tโ‚€: ARโ†PC. Tโ‚: IRโ†M[AR], PC++. Tโ‚‚: Decode AND, ARโ†050. Tโ‚ƒ: Dโ‚€=1, I=0. Tโ‚„: DRโ†M[050]=0x0F0F. Tโ‚…: AC โ† 0xFF0F AND 0x0F0F = 0x0F0F. Only bits that are 1 in BOTH operands survive.
N3

If PC = 300โ‚โ‚† and the instruction at 300 is BSA 400 (direct), what values are in PC, M[400], and where does execution continue after BSA completes?

AnalyzeIntermediate
After fetch, PC = 301. BSA execution: Tโ‚„: M[400] โ† PC = 301 (return address saved), AR โ† 401. Tโ‚…: PC โ† AR = 401. So M[400] = 0x0301, PC = 0x401. Execution continues from address 401 (first instruction of subroutine).
N4

An ISZ instruction targets address 0x100. M[100] currently holds 0xFFFF. After ISZ executes, what is M[100]? Does the CPU skip the next instruction?

ApplyIntermediate
ISZ: DR โ† M[100] = 0xFFFF. DR โ† DR+1 = 0x0000 (overflow wraps to zero). M[100] โ† 0x0000. Since DR = 0, YES, PC โ† PC+1 (skip next instruction). ISZ is typically used for loop counting: start with negative count, increment each iteration, skip when it reaches zero.
N5

Calculate the total number of control signals needed for the common bus system. Consider: 7 register load signals, 3 bus select lines, memory read/write, ALU operations, and register clear/increment signals.

AnalyzeAdvanced
Load signals: AR, PC, DR, AC, IR, TR, OUTR = 7. Clear signals: AC, E, SC = 3. Increment: PC, AC, DR, AR = 4. Bus select: Sโ‚‚, Sโ‚, Sโ‚€ = 3. Memory: Read, Write = 2. ALU: AND, ADD, complement, shift = 4. IEN: set, clear = 2. Misc: INP, OUT = 2. Total โ‰ˆ 27+ control signals.
N6

How many clock cycles does each instruction type take (including fetch)? Calculate the total cycles for a program: LDA, ADD, ADD, STA, HLT.

ApplyIntermediate
Fetch = 3 cycles (Tโ‚€โ€“Tโ‚‚). LDA: 3+3 = 6 cycles. ADD: 3+3 = 6 cycles. STA: 3+1 = 4 cycles (Tโ‚„ only). HLT: 3+1 = 4 cycles (register-ref, Tโ‚ƒ only). Total: 6+6+6+4+4 = 26 clock cycles. Note: indirect adds 1 extra cycle (Tโ‚ƒ).

Industry Application Questions (3)

I1

ARM Cortex-M0 (used in Indian smart meters): The ARM Cortex-M0 has a 3-stage pipeline (Fetch-Decode-Execute). Compare this with Mano's sequential instruction cycle. How does pipelining improve throughput? What hazards can occur?

AnalyzeAdvanced
Mano's computer: one instruction at a time. ARM pipeline: while Instruction 1 executes, Instruction 2 decodes, and Instruction 3 fetches โ€” 3ร— throughput improvement (ideally). Hazards: Data hazard (instruction needs result of previous), Control hazard (branch changes PC, invalidating prefetched instructions), Structural hazard (two stages need same resource). Indian smart meters by EESL use Cortex-M0 for billing calculations.
I2

ISRO's onboard computers: ISRO's satellite processors need radiation-hardened designs. Why might ISRO prefer a simpler architecture (like Mano's basic computer scaled up) over complex modern CPUs for space applications?

EvaluateAdvanced
Simpler architectures are more reliable: fewer transistors = fewer points of failure. Radiation can flip bits; simpler logic is easier to protect with redundancy (Triple Modular Redundancy). Hardwired control is preferred over microprogrammed (fewer memory elements that can be corrupted). ISRO's SPARC-based processors in Chandrayaan-3 use a RISC architecture with hardwired control โ€” conceptually similar to Mano's approach but scaled up.
I3

Intel microcode updates: In 2018, Intel released microcode patches for the Spectre/Meltdown vulnerabilities. Explain how this was possible using the microprogrammed control concept. Could this be done if Intel used purely hardwired control?

EvaluateAdvanced
Intel x86 CPUs use microprogrammed control with updateable microcode stored in on-chip ROM that can be patched via BIOS/OS updates. The microcode update changed how speculative execution branches are handled. With purely hardwired control, this would be IMPOSSIBLE โ€” the only fix would be a physical chip replacement (recall millions of CPUs!). This is the strongest argument for microprogrammed control in complex processors.

GATE-Style Questions (5)

G1

GATE CSE In Mano's basic computer, the instruction at address 010 (hex) is 0xF400. What operation is performed?

  1. Store AC to memory at address 400
  2. Output AC(0โ€“7) to OUTR
  3. Branch to address 400 unconditionally
  4. Input character from INPR to AC
RememberGATE 2-mark
โœ… Answer: (B). 0xF400 = 1111 0100 0000 0000. I=1, Opcode=111, so this is an I/O instruction. Bit 10 = 1 โ†’ OUT instruction. OUT transfers AC(0โ€“7) to the output register OUTR.
G2

GATE CSE The common bus system of Mano's basic computer uses a multiplexer with selection lines Sโ‚‚Sโ‚Sโ‚€ = 100. Which register is placed on the bus?

  1. DR
  2. PC
  3. AC
  4. IR
RememberGATE 1-mark
โœ… Answer: (C) AC. Encoding: 001=AR, 010=PC, 011=DR, 100=AC, 101=IR, 110=TR, 111=Memory.
G3

GATE CSE During the interrupt cycle of Mano's basic computer, the return address is stored at memory location:

  1. 0
  2. 1
  3. The address specified in the current instruction
  4. The stack pointer location
UnderstandGATE 1-mark
โœ… Answer: (A) 0. During the interrupt cycle, M[0] โ† PC (return address stored at address 0). The ISR entry point is at address 1. There is no stack in Mano's basic computer.
G4

GATE CSE How many timing signals are needed to execute the BSA instruction (direct addressing) after fetch-decode?

  1. 1
  2. 2
  3. 3
  4. 4
ApplyGATE 2-mark
โœ… Answer: (B) 2. BSA uses Tโ‚„ and Tโ‚…. Tโ‚„: M[AR]โ†PC, ARโ†AR+1. Tโ‚…: PCโ†AR, SCโ†0. Fetch-decode takes Tโ‚€โ€“Tโ‚‚ (3 signals), but the question asks only about execution after decode.
G5

GATE CSE In a microprogrammed control unit, if the control memory has 128 words and each word is 20 bits, what is the total size of the control memory in bits?

  1. 2560 bits
  2. 2048 bits
  3. 1280 bits
  4. 5120 bits
ApplyGATE 1-mark
โœ… Answer: (A) 2560 bits. 128 words ร— 20 bits/word = 2560 bits. Control memory size = number of micro-instructions ร— micro-instruction word length.
Section F

MCQ Assessment Bank โ€” 30 Questions (Bloom's Mapped)

Remember / Identify (Q1โ€“Q6)

Q1

The bit-width of the Program Counter (PC) in Mano's Basic Computer is:

  1. 8 bits
  2. 12 bits
  3. 16 bits
  4. 32 bits
Remember
โœ… Answer: (B) 12 bits โ€” PC holds memory addresses, and the address space is 2ยนยฒ = 4096 words.
Q2

The opcode for the LDA instruction in Mano's Basic Computer is:

  1. 000
  2. 001
  3. 010
  4. 011
Remember
โœ… Answer: (C) 010 โ€” LDA (Load to Accumulator) has opcode 2 (010 in binary).
Q3

How many memory-reference instructions are in Mano's Basic Computer?

  1. 5
  2. 6
  3. 7
  4. 12
Remember
โœ… Answer: (C) 7 โ€” AND, ADD, LDA, STA, BUN, BSA, ISZ (opcodes 000 to 110).
Q4

The Accumulator (AC) in Mano's Basic Computer is:

  1. 8 bits wide
  2. 12 bits wide
  3. 16 bits wide
  4. 32 bits wide
Remember
โœ… Answer: (C) 16 bits โ€” AC matches the word size of the computer (16 bits).
Q5

The I-bit in Mano's instruction format indicates:

  1. Interrupt enable
  2. Immediate operand
  3. Indirect addressing
  4. Input flag
Remember
โœ… Answer: (C) Indirect addressing โ€” When I=1 and opcode โ‰  111, the address field points to a location containing the effective address.
Q6

Which register holds the instruction currently being executed?

  1. PC
  2. AR
  3. IR
  4. DR
Remember
โœ… Answer: (C) IR (Instruction Register) โ€” It holds the 16-bit instruction fetched from memory during Tโ‚.

Understand / Explain (Q7โ€“Q12)

Q7

Why is the common bus system preferred over point-to-point connections between registers?

  1. It is faster
  2. It reduces wiring complexity
  3. It allows multiple simultaneous transfers
  4. It increases register count
Understand
โœ… Answer: (B) โ€” A common bus needs only n connections for n registers (through MUX), while point-to-point needs n(n-1)/2. Trade-off: only one transfer at a time.
Q8

What happens during timing signal Tโ‚ of the instruction cycle?

  1. The opcode is decoded
  2. AR receives PC value
  3. IR receives instruction from memory and PC is incremented
  4. The ALU performs the operation
Understand
โœ… Answer: (C) โ€” Tโ‚: IR โ† M[AR] (instruction fetch from memory) and PC โ† PC + 1 (prepare for next instruction).
Q9

Why does the interrupt cycle store the return address at M[0] instead of using a stack?

  1. Stacks hadn't been invented yet
  2. Mano's basic computer has no stack pointer or stack mechanism
  3. M[0] is faster to access
  4. It allows nested interrupts
Understand
โœ… Answer: (B) โ€” Mano's basic computer is a minimal design with no stack pointer register. Using M[0] is the simplest approach. This means nested interrupts are NOT supported (IEN is cleared).
Q10

The BSA instruction is used for:

  1. Bit shifting
  2. Block data transfer
  3. Subroutine calls
  4. Bus arbitration
Understand
โœ… Answer: (C) โ€” BSA (Branch and Save Address) saves the return address in memory and jumps to the subroutine. It's the equivalent of a CALL instruction in modern processors.
Q11

In hardwired control, what determines the sequence of control signals?

  1. Microcode ROM
  2. Combinational logic gates and timing signals
  3. Software interrupts
  4. Main memory
Understand
โœ… Answer: (B) โ€” Hardwired control uses combinational logic that takes decoded opcode bits (Dโ‚€โ€“Dโ‚‡), timing signals (Tโ‚€โ€“Tโ‚โ‚…), and condition flags as inputs to produce control signals. No ROM involved.
Q12

What is the purpose of the E (carry) flip-flop?

  1. Enable/disable interrupts
  2. Store the overflow/carry bit from AC operations
  3. Error detection flag
  4. End-of-instruction marker
Understand
โœ… Answer: (B) โ€” E stores the carry-out from ADD operations and is used in circular shift operations (CIR, CIL). It extends AC to 17 bits for arithmetic.

Apply / Solve (Q13โ€“Q18)

Q13

If AC = 0x00FF and DR = 0x0F0F, what is the result of AND operation?

  1. 0x000F
  2. 0x0FFF
  3. 0x0F0F
  4. 0x00FF
Apply
โœ… Answer: (A) 0x000F. 0x00FF = 0000 0000 1111 1111. 0x0F0F = 0000 1111 0000 1111. AND = 0000 0000 0000 1111 = 0x000F.
Q14

Sโ‚‚Sโ‚Sโ‚€ = 011 places which register on the common bus?

  1. AR
  2. PC
  3. DR
  4. AC
Apply
โœ… Answer: (C) DR. Encoding: 001=AR, 010=PC, 011=DR, 100=AC, 101=IR, 110=TR, 111=Memory.
Q15

An instruction has hex code 0x7020. What operation does it perform?

  1. INC (increment AC)
  2. CMA (complement AC)
  3. CIR (circular right shift)
  4. ADD
Apply
โœ… Answer: (A) INC. 0x7020 = 0111 0000 0010 0000. I=0, Opcode=111 โ†’ register-reference. Bit 5 = 1 โ†’ INC instruction (increment AC by 1).
Q16

After executing LDA 200 (direct) where M[200] = 0xABCD, what is the value of AC?

  1. 0x0200
  2. 0xABCD
  3. 0x0000
  4. Unchanged
Apply
โœ… Answer: (B) 0xABCD. LDA loads the memory word at the effective address into AC. AC โ† M[200] = 0xABCD.
Q17

How many words of memory can Mano's Basic Computer address?

  1. 256
  2. 1024
  3. 4096
  4. 65536
Apply
โœ… Answer: (C) 4096. The address field is 12 bits: 2ยนยฒ = 4096 words. Each word is 16 bits, so total memory = 4096 ร— 16 = 65,536 bits = 8 KB.
Q18

The micro-operation "AR โ† IR(0โ€“11)" happens during which timing signal?

  1. Tโ‚€
  2. Tโ‚
  3. Tโ‚‚
  4. Tโ‚ƒ
Apply
โœ… Answer: (C) Tโ‚‚. During the decode phase (Tโ‚‚), the address portion of IR (bits 0โ€“11) is transferred to AR to prepare for operand access.

Analyze / Compare (Q19โ€“Q24)

Q19

Which instruction takes the MOST clock cycles to execute (including fetch) in direct addressing mode?

  1. STA
  2. ADD
  3. ISZ
  4. BUN
Analyze
โœ… Answer: (C) ISZ โ€” ISZ uses Tโ‚„, Tโ‚…, Tโ‚† (3 execution cycles) + 3 fetch = 6 total. ADD uses Tโ‚„, Tโ‚… (2) + 3 = 5. STA uses Tโ‚„ (1) + 3 = 4. BUN uses Tโ‚„ (1) + 3 = 4.
Q20

Adding indirect addressing to a memory-reference instruction adds how many extra clock cycles?

  1. 0
  2. 1
  3. 2
  4. 3
Analyze
โœ… Answer: (B) 1. At Tโ‚ƒ, if I=1: AR โ† M[AR] (one memory read to resolve the indirect address). This adds exactly 1 clock cycle.
Q21

Why does Mano's computer use a 3-bit opcode instead of 4-bit?

  1. To save power
  2. To maximize the address field (12 bits) within a 16-bit instruction
  3. Because only 7 instructions exist
  4. Because the ALU is 3 bits wide
Analyze
โœ… Answer: (B) โ€” With a 16-bit instruction word, allocating 1 bit for I and 3 bits for opcode leaves 12 bits for the address (4K addressable words). A 4-bit opcode would reduce the address to 11 bits = 2K words.
Q22

In the common bus system, what prevents two registers from driving the bus simultaneously?

  1. Bus arbiter hardware
  2. The MUX allows only one input to pass through at a time
  3. Registers check bus status before writing
  4. The clock signal prevents collisions
Analyze
โœ… Answer: (B) โ€” The MUX (multiplexer) physically selects only one input based on Sโ‚‚Sโ‚Sโ‚€. Only the selected register's output reaches the bus. Other register outputs are blocked by the MUX.
Q23

Why is IEN cleared to 0 during the interrupt cycle?

  1. To save power
  2. To prevent nested interrupts
  3. Because the I/O device requested it
  4. To reset the CPU
Analyze
โœ… Answer: (B) โ€” Clearing IEN prevents another interrupt from occurring while the current ISR is executing. Mano's basic computer does not support nested interrupts. The ISR must re-enable interrupts with ION before returning.
Q24

What would happen if the sequence counter (SC) is NOT cleared after instruction execution?

  1. The CPU would execute the same instruction twice
  2. Timing signals would continue incrementing, producing incorrect control signals
  3. The bus would be locked
  4. Memory would be corrupted
Analyze
โœ… Answer: (B) โ€” If SC is not cleared, it continues to Tโ‚‡, Tโ‚ˆ... which would activate wrong control signals (meant for different instruction phases), causing unpredictable behavior.

Evaluate & Create (Q25โ€“Q30)

Q25

If you could add ONE more register to Mano's Basic Computer, which would improve performance the most?

  1. A second accumulator (AC2)
  2. A stack pointer (SP)
  3. A base register (BR)
  4. A flag register (FR)
Evaluate
โœ… Answer: (B) โ€” A stack pointer would enable: (1) nested subroutine calls (currently impossible since BSA overwrites return address), (2) nested interrupts, (3) parameter passing. This is why all real CPUs have a stack pointer.
Q26

Which is a valid criticism of Mano's Basic Computer's bus architecture?

  1. The bus is too wide (16 bits is wasteful)
  2. Only one data transfer can occur per clock cycle, creating a bottleneck
  3. The MUX is unnecessary
  4. Registers should connect directly to memory without a bus
Evaluate
โœ… Answer: (B) โ€” The single-bus architecture is a performance bottleneck. Modern CPUs use multiple buses (data bus, address bus, control bus) and even crossbar switches to allow multiple simultaneous transfers.
Q27

A student proposes increasing the opcode field to 5 bits. What is the main disadvantage?

  1. Too many instructions to implement
  2. Address field shrinks to 10 bits = only 1024 addressable words
  3. The I-bit would be eliminated
  4. The clock speed would decrease
Evaluate
โœ… Answer: (B) โ€” With 16-bit instructions: 1(I) + 5(opcode) + 10(address) = 16. Address space drops from 4K to 1K words. Trade-off: more instructions but less addressable memory.
Q28

To implement a SUBTRACT instruction in Mano's computer (without adding new hardware), you would:

  1. Use SUB opcode directly
  2. Complement the operand (CMA), increment (INC), then ADD
  3. Use the E flip-flop to borrow
  4. It's impossible without new hardware
Create
โœ… Answer: (B) โ€” Subtraction using 2's complement: A - B = A + (~B + 1). Load B into AC, CMA (complement), INC (add 1 = 2's complement), then ADD A. This demonstrates Turing completeness โ€” any operation can be composed from existing ones.
Q29

Design a loop that adds numbers at addresses 100โ€“104 using Mano's instructions. How many instructions are needed (minimum)?

  1. 5
  2. 8
  3. 10
  4. 15
Create
โœ… Answer: (C) ~10. You need: CLA (clear AC), ADD 100, ADD 101, ADD 102, ADD 103, ADD 104, STA [result], HLT = 8 for straight-line. With a loop using ISZ: ~10 instructions including counter initialization, indirect addressing, ISZ-based loop control, and BUN. The loop approach is more elegant and scales to any N.
Q30

If you were designing a new instruction "SWAP" that exchanges AC and DR contents, how many timing signals would the execute phase need?

  1. 1
  2. 2
  3. 3
  4. 4
Create
โœ… Answer: (C) 3. You need a temporary register: Tโ‚: TR โ† AC. Tโ‚‚: AC โ† DR. Tโ‚ƒ: DR โ† TR. Each transfer requires one bus cycle (only one transfer per clock on a single bus). With a dual-bus, it could be done in 2 cycles.
Section G

Short Answer Questions (8)

SA1

List all 8 registers of Mano's Basic Computer with their bit-widths and primary functions. (4 marks)

Answer: (1) PC [12-bit] โ€” holds address of next instruction. (2) AR [12-bit] โ€” holds memory address for read/write. (3) IR [16-bit] โ€” holds currently fetched instruction. (4) AC [16-bit] โ€” accumulator for ALU operations. (5) DR [16-bit] โ€” holds operand read from memory. (6) TR [16-bit] โ€” temporary storage during instruction execution. (7) INPR [8-bit] โ€” holds input character from keyboard. (8) OUTR [8-bit] โ€” holds output character for display. Additionally, E is a 1-bit carry flip-flop.
SA2

Explain the 16-bit instruction format of Mano's Basic Computer. What is the role of the I-bit? (4 marks)

Answer: The 16-bit format is: Bit 15 = I (addressing mode), Bits 14โ€“12 = Opcode (3 bits, 8 possible operations), Bits 11โ€“0 = Address (12 bits, 4096 locations). The I-bit: When I=0, the address field directly specifies the operand location (direct addressing). When I=1, the address field points to a memory location that contains the actual operand address (indirect addressing). When opcode=111: I=0 means register-reference instruction, I=1 means I/O instruction.
SA3

Write the RTL micro-operations for the fetch phase (Tโ‚€, Tโ‚, Tโ‚‚). Explain what each accomplishes. (5 marks)

Answer: Tโ‚€: AR โ† PC (transfer PC to AR so memory can be addressed; bus select Sโ‚‚Sโ‚Sโ‚€=010 for PC). Tโ‚: IR โ† M[AR], PC โ† PC+1 (read instruction from memory into IR; simultaneously increment PC to point to next instruction; bus select Sโ‚‚Sโ‚Sโ‚€=111 for memory). Tโ‚‚: Dโ‚€...Dโ‚‡ โ† Decode IR(14โ€“12), AR โ† IR(11โ€“0), I โ† IR(15) (decode the opcode using 3ร—8 decoder producing signals Dโ‚€โ€“Dโ‚‡; load address portion into AR; extract indirect bit). After Tโ‚‚, the control unit knows which instruction to execute and where the operand is.
SA4

What is the purpose of the sequence counter (SC)? What happens when it is cleared? (3 marks)

Answer: The sequence counter is a 4-bit register that generates timing signals Tโ‚€, Tโ‚, Tโ‚‚... through a 4ร—16 decoder. It increments by 1 each clock cycle. When SC is cleared (SC โ† 0), the timing resets to Tโ‚€, starting the fetch phase of the next instruction. SC is cleared at the end of every instruction's execution phase. Without clearing SC, timing signals would continue to Tโ‚‡, Tโ‚ˆ... producing incorrect control signals for subsequent operations.
SA5

How does indirect addressing work in Mano's computer? Give an example with a memory diagram. (4 marks)

Answer: When I=1 and opcode โ‰  111, the address in bits 11โ€“0 doesn't point to the operand directly. Instead, it points to a memory location that contains the actual operand address. Example: Instruction ADD 300 (indirect, I=1). At Tโ‚ƒ: AR โ† M[AR]. If M[300] = 0x0500, then AR becomes 500. At Tโ‚„: DR โ† M[500] (the actual operand). Use case: Implementing pointers, array access, and dynamic memory references. The effective address resolution adds one extra clock cycle.
SA6

Differentiate between memory-reference, register-reference, and I/O instructions. How does the CPU distinguish them? (4 marks)

Answer: (1) Memory-reference: opcode = 000โ€“110, uses 12-bit address to access memory. I-bit selects direct/indirect. (2) Register-reference: opcode = 111, I = 0. The 12-bit field has individual operation bits (only one set at a time). Operations affect AC, E, or PC directly without memory access. (3) I/O instructions: opcode = 111, I = 1. The 12-bit field specifies I/O operations (INP, OUT, SKI, SKO, ION, IOF). The CPU distinguishes by first checking if opcode = 111 (Dโ‚‡ decoder output). If Dโ‚‡ = 1, check I bit: I=0 โ†’ register-reference, I=1 โ†’ I/O.
SA7

Explain the interrupt cycle in Mano's Basic Computer. What are Tโ‚€, Tโ‚, Tโ‚‚ micro-operations? (5 marks)

Answer: The interrupt cycle activates after the execute phase when IEN=1 AND (FGI=1 OR FGO=1). Tโ‚€: AR โ† 0, TR โ† PC (save current PC to TR, set AR to address 0). Tโ‚: M[0] โ† TR, PC โ† 0 (store return address at memory location 0, set PC to 0). Tโ‚‚: PC โ† PC+1, IEN โ† 0, SC โ† 0 (PC becomes 1 โ€” ISR entry point, disable further interrupts, reset timing). After this, normal fetch begins from address 1, which typically contains a BUN instruction to the actual ISR. IEN is cleared to prevent nested interrupts. The ISR must execute ION to re-enable interrupts before returning via BUN 0 I (indirect jump through M[0]).
SA8

What is the role of the MUX selection lines Sโ‚‚Sโ‚Sโ‚€ in the common bus system? List all encodings. (3 marks)

Answer: Sโ‚‚Sโ‚Sโ‚€ are three control signals from the control unit that determine which register or memory outputs its data onto the 16-bit common bus. Only one source drives the bus per clock cycle. Encodings: 000 = None (bus idle), 001 = AR, 010 = PC, 011 = DR, 100 = AC, 101 = IR, 110 = TR, 111 = Memory M[AR]. The receiving register's Load signal must also be activated simultaneously for the transfer to complete.
Section H

Long Answer Questions (3)

๐Ÿ“ LA1: Complete Micro-operations for All Memory-Reference Instructions (10 marks)

Question: Write the RTL micro-operations for all seven memory-reference instructions (AND, ADD, LDA, STA, BUN, BSA, ISZ) of Mano's Basic Computer. Include the fetch phase, indirect address resolution, and execution phase for each. Clearly label timing signals.

Answer:

Common Fetch Phase (all instructions):
Tโ‚€: AR โ† PC
Tโ‚: IR โ† M[AR], PC โ† PC + 1
Tโ‚‚: AR โ† IR(0โ€“11), I โ† IR(15), Decode IR(14โ€“12) โ†’ Dโ‚€โ€“Dโ‚‡

Indirect Resolution (if I=1 and Dโ‚‡'=1):
Tโ‚ƒ: AR โ† M[AR]

AND (Dโ‚€): Tโ‚„: DR โ† M[AR]. Tโ‚…: AC โ† AC โˆง DR, SC โ† 0.
ADD (Dโ‚): Tโ‚„: DR โ† M[AR]. Tโ‚…: AC โ† AC + DR, E โ† Cout, SC โ† 0.
LDA (Dโ‚‚): Tโ‚„: DR โ† M[AR]. Tโ‚…: AC โ† DR, SC โ† 0.
STA (Dโ‚ƒ): Tโ‚„: M[AR] โ† AC, SC โ† 0.
BUN (Dโ‚„): Tโ‚„: PC โ† AR, SC โ† 0.
BSA (Dโ‚…): Tโ‚„: M[AR] โ† PC, AR โ† AR + 1. Tโ‚…: PC โ† AR, SC โ† 0.
ISZ (Dโ‚†): Tโ‚„: DR โ† M[AR]. Tโ‚…: DR โ† DR + 1. Tโ‚†: M[AR] โ† DR, if(DR=0) PC โ† PC+1, SC โ† 0.

Key points: STA and BUN are fastest (1 execution cycle). ISZ is slowest (3 execution cycles). BSA is the subroutine mechanism. All clear SC at the end to restart fetch.

๐Ÿ“ LA2: Hardwired vs Microprogrammed Control โ€” Detailed Comparison (10 marks)

Question: Compare hardwired and microprogrammed control unit designs in detail. Draw block diagrams for both, explain their working principles, and analyze trade-offs in speed, flexibility, cost, and design complexity. Give real-world processor examples for each approach.

Answer:

Hardwired Control: Uses combinational logic circuits (AND, OR, NOT gates) to generate control signals. Inputs: decoded opcode bits (Dโ‚€โ€“Dโ‚‡ from 3ร—8 decoder), timing signals (Tโ‚€โ€“Tโ‚โ‚… from 4ร—16 decoder driven by sequence counter), I bit, and condition flags (E, ACโ‚โ‚…, etc.). Output: control signals for register loads, bus select, memory R/W, ALU operations. Speed: Very fast โ€” signals propagate through gates in nanoseconds. Disadvantage: Complex to design for large instruction sets; any change requires hardware redesign.

Microprogrammed Control: Uses a control memory (ROM) storing micro-instructions. Each machine instruction maps to a sequence of micro-instructions via mapping logic. A Control Address Register (CAR) sequences through the ROM. Each micro-instruction word contains bits that directly activate control signals. Speed: Slower due to ROM access time. Advantage: Flexible โ€” changing behavior only requires updating ROM contents. Intel's microcode updates demonstrate this advantage.

Trade-offs: (1) Speed: Hardwired wins. (2) Flexibility: Microprogrammed wins. (3) Design time: Microprogrammed is faster to design. (4) Cost for simple ISA: Hardwired cheaper. (5) Cost for complex ISA: Microprogrammed cheaper (fewer gates). (6) Bug fixing: Microprogrammed allows patches; hardwired requires new chips.

Examples: Hardwired โ€” ARM Cortex (RISC, simple ISA, speed-critical, used in Snapdragon). Microprogrammed โ€” Intel x86 (CISC, complex ISA, needs microcode patches). Mano's Basic Computer uses hardwired control due to its simple 25-instruction ISA.

๐Ÿ“ LA3: I/O Organization and Interrupt Handling (10 marks)

Question: Explain the complete I/O organization of Mano's Basic Computer. Describe the roles of INPR, OUTR, FGI, FGO, and IEN. Explain programmed I/O (polling) vs interrupt-driven I/O. Trace through a complete interrupt cycle with a numerical example.

Answer:

I/O Registers: INPR (8-bit) โ€” receives character from keyboard. OUTR (8-bit) โ€” sends character to display. FGI (1-bit) โ€” set by keyboard when new character ready, cleared by CPU after reading. FGO (1-bit) โ€” set by display when ready for new character, cleared by CPU after writing. IEN (1-bit) โ€” master interrupt enable; 1=interrupts allowed, 0=disabled.

Programmed I/O (Polling): CPU repeatedly checks FGI/FGO in a loop. Example: "Loop: SKI, BUN Loop, INP" โ€” CPU wastes cycles checking if keyboard has input. Simple but extremely inefficient (CPU is idle 99.99% of the time waiting for slow I/O).

Interrupt-Driven I/O: CPU executes main program normally. When I/O device is ready (FGI=1 or FGO=1) AND IEN=1, an interrupt occurs between instruction cycles. CPU saves context, jumps to ISR, handles I/O, returns. Much more efficient.

Example Trace: CPU executing program at PC=500. Keyboard sends 'A' (ASCII 65 = 0x41). FGI โ† 1. After current instruction's execute phase: Check IEN=1 AND FGI=1 โ†’ YES.
Interrupt Cycle: Tโ‚€: ARโ†0, TRโ†500. Tโ‚: M[0]โ†500, PCโ†0. Tโ‚‚: PCโ†1, IENโ†0, SCโ†0.
Now fetch from PC=1: M[1] = BUN 800 (jump to ISR at 800).
ISR at 800: INP (AC(0โ€“7) โ† INPR = 0x41), STA 900 (store character), ION (re-enable interrupts), BUN 0 I (indirect: PC โ† M[0] = 500, return to main program).

Key: IEN cleared to prevent nested interrupts. ISR must ION before returning.
Section I

Industry Spotlight โ€” A Day in the Life

๐Ÿ‘จโ€๐Ÿ’ป Arun Menon, 29 โ€” CPU Design Engineer at ARM India, Bangalore

Background: B.Tech ECE from NIT Calicut. Fascinated by computer organization in 3rd semester. Did an internship at CDAC Thiruvananthapuram working on India's own microprocessor (VEGA RISC-V). Joined ARM India's CPU design team after campus placement.

A Typical Day:

8:30 AM โ€” Sync with the Cambridge (UK) team on the Cortex-X5 core's bus interconnect design. India handles critical modules of ARM's next-gen CPU.

9:30 AM โ€” Run RTL simulations of the load-store unit in Verilog. The bus arbitration logic he designed last week has a timing violation โ€” needs to optimize the critical path.

11:00 AM โ€” Architecture review meeting. Discuss whether to add a second data bus to reduce the bottleneck for memory-intensive workloads (the same bus trade-off from Mano's computer, but at 3 GHz).

1:00 PM โ€” Lunch at ARM's Bangalore campus. Chat about RISC-V's open ISA and India's push for processor sovereignty (SHAKTI project at IIT Madras).

2:00 PM โ€” Write microarchitecture specification for a new "prefetch" instruction. Define the RTL, timing, and control signals โ€” exactly like what you learn with Mano's instructions, but for a real product.

4:00 PM โ€” Debug a gate-level simulation. A register isn't loading at the right timing signal (Tโ‚‚ instead of Tโ‚ƒ). Classic computer organization bug.

5:30 PM โ€” Study session on formal verification methods. ARM encourages continuous learning.

DetailInfo
Tools Used DailyVerilog/SystemVerilog, Synopsys VCS, ARM Architecture Reference Manual, Python for automation
Entry Salary (2024)โ‚น12โ€“18 LPA + RSUs
Mid-Level (3โ€“5 yrs)โ‚น20โ€“35 LPA
Senior (7+ yrs)โ‚น40โ€“70 LPA
Companies HiringARM, Qualcomm, Samsung R&D, Intel, AMD, NVIDIA, MediaTek, Texas Instruments, Broadcom, ISRO, CDAC, IIT Madras (SHAKTI)
Key SkillsComputer Organization (Mano's + Patterson/Hennessy), Digital Logic, Verilog/VHDL, GATE (for PSU/DRDO path)
Arun's advice to students: "Every concept in Mano's Basic Computer maps to what I do daily at ARM. The bus system, timing signals, control unit โ€” it's the same principles, just scaled up. Master Mano's computer thoroughly, then move to Patterson & Hennessy. If I could give one tip: build a CPU simulator project. It's what got me noticed during my ARM interview."
Section J

Earn With It โ€” CPU Simulator Projects

๐Ÿ’ฐ Your Earning Path After This Chapter

Portfolio Piece: A working CPU simulator (Python or web-based) that implements Mano's Basic Computer with visual register states and step-by-step execution.

Project Ideas That Pay:

โ€ข Visual CPU Simulator (HTML/JS) for educational platforms โ€” โ‚น5,000โ€“โ‚น15,000 per project

โ€ข Verilog implementation of Mano's computer for FPGA โ€” โ‚น10,000โ€“โ‚น25,000 freelance

โ€ข YouTube tutorial series on Computer Organization โ€” Ad revenue + course sales

โ€ข GATE coaching content creation (COA section) โ€” โ‚น3,000โ€“โ‚น8,000 per module

PlatformBest ForTypical Rate
Freelancer.comVerilog/VHDL projects from US/EU universities$50โ€“$200/project (โ‚น4,000โ€“โ‚น16,000)
Chegg / Course HeroCOA assignment solutions (ethically: tutoring)$5โ€“$20/answer
Udemy / SkillshareCPU architecture course creationโ‚น10,000โ€“โ‚น50,000/month passive
GitHub + PortfolioLand interviews at ARM/Qualcomm/Intel Indiaโ‚น12โ€“18 LPA starting salary
GATE CoachingCOA chapter tutoring at local coaching centresโ‚น500โ€“โ‚น1500/hour

โฑ๏ธ Time to First Earning: 3โ€“4 weeks (complete Tier 2 or 3 lab, then list on Freelancer.com or create a YouTube tutorial)

High-Value Project Idea: Build a "Mano's CPU Playground" web app where students can write assembly code, load it into memory, and watch the CPU execute step-by-step with animated bus transfers. Educational tech companies (like Unacademy, PhysicsWallah) pay โ‚น20,000โ€“โ‚น50,000 for such interactive tools. Email them with a demo link.
Section K

Chapter Summary โ€” Quick Reference

๐Ÿง  Key Takeaways

โœ… Instruction Format: 16 bits = I(1) + Opcode(3) + Address(12). I=0 direct, I=1 indirect. Opcode 111 โ†’ register-ref (I=0) or I/O (I=1).

โœ… 8 Registers: PC[12], AR[12], IR[16], AC[16], DR[16], TR[16], INPR[8], OUTR[8]. Plus E (1-bit carry).

โœ… Common Bus: 16-bit shared highway. MUX with Sโ‚‚Sโ‚Sโ‚€ selects source. Only ONE register drives bus per cycle.

โœ… 25 Instructions: 7 memory-reference + 12 register-reference + 6 I/O.

โœ… Fetch-Decode-Execute: Tโ‚€: ARโ†PC. Tโ‚: IRโ†M[AR], PC++. Tโ‚‚: Decode opcode, ARโ†address. Tโ‚ƒ+: Execute.

โœ… Control Unit: Hardwired (fast, inflexible, RISC) vs Microprogrammed (slower, flexible, CISC).

โœ… Memory-Reference: AND/ADD/LDA need Tโ‚„โ€“Tโ‚…. STA/BUN need Tโ‚„ only. BSA needs Tโ‚„โ€“Tโ‚…. ISZ needs Tโ‚„โ€“Tโ‚†.

โœ… Interrupt: IEN AND (FGI OR FGO) triggers interrupt cycle. Return address at M[0], ISR at address 1. IEN cleared during interrupt.

Essential Formulas & Numbers

ParameterValueWhy
Word size16 bitsInstruction and data width
Address space4096 words (4K)12-bit address field: 2ยนยฒ = 4096
Total memory4K ร— 16 bits = 8 KB4096 words ร— 16 bits/word
Opcodes8 (3-bit field)2ยณ = 8, of which 7 are memory-ref
Total instructions257 + 12 + 6
MUX inputs7 + 1 (none)AR, PC, DR, AC, IR, TR, Memory + idle
Fetch cycles3 (Tโ‚€โ€“Tโ‚‚)Same for ALL instructions
Fastest instruction4 cycles (STA, BUN, register-ref)3 fetch + 1 execute
Slowest instruction7 cycles (ISZ indirect)3 fetch + 1 indirect + 3 execute
Section L

Earning Checkpoint โ€” Are You Ready to Earn?

SkillTool/MethodPortfolio EvidenceEarning Ready?
Instruction Format DecodingManual / Paperโ€”โœ… Yes โ€” GATE prep tutoring
Trace Table ExecutionPaper / SpreadsheetCompleted trace for all 7 instructionsโœ… Yes โ€” COA tutoring at โ‚น500โ€“โ‚น1500/hr
CPU Simulator (Python)PythonWorking simulator on GitHubโœ… Yes โ€” Freelance projects โ‚น5Kโ€“โ‚น15K
Visual CPU Simulator (Web)HTML/CSS/JSLive demo on GitHub Pagesโœ… Yes โ€” EdTech projects โ‚น20Kโ€“โ‚น50K
Verilog/VHDL ImplementationVerilog, FPGASynthesizable code + simulation waveformsโœ… Yes โ€” โ‚น10Kโ€“โ‚น25K freelance
Control Unit DesignConceptual + DiagramsHardwired vs Micro comparison documentโœ… Yes โ€” GATE content creation
Interrupt HandlingConceptualโ€”โฌœ Need hands-on with real ยตController
Minimum Viable Earning Setup after this chapter: A GitHub profile with a working CPU simulator (Python or web-based) + understanding of Mano's architecture = you can tutor GATE COA for โ‚น500โ€“โ‚น1500/hour, take Verilog freelance projects for โ‚น5,000โ€“โ‚น25,000, or create educational content for passive income. ARM/Qualcomm India interviews directly test these concepts.

โœ… Unit 3 complete. You now understand how a computer is organized from the ground up!

[QR: Link to EduArtha video tutorial โ€” Computer Organization & Mano's Basic Computer]