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)
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.
Learning Outcomes โ Bloom's Taxonomy Mapped (12 Outcomes)
| Bloom's Level | Learning Outcome |
|---|---|
| ๐ต Remember | LO1: List all 8 registers of Mano's Basic Computer with their bit-widths and functions |
| ๐ต Remember | LO2: State the 16-bit instruction format: I(1) + Opcode(3) + Address(12) and recall all 7 memory-reference opcodes |
| ๐ข Understand | LO3: Explain how the common bus system uses MUX selection lines SโSโSโ to route data between registers |
| ๐ข Understand | LO4: Describe the Fetch-Decode-Execute cycle with timing signals Tโ, Tโ, Tโ and their micro-operations |
| ๐ก Apply | LO5: Trace the complete execution of any memory-reference instruction (AND, ADD, LDA, STA, BUN, BSA, ISZ) through all timing states |
| ๐ก Apply | LO6: Write RTL (Register Transfer Language) micro-operations for each instruction and timing signal |
| ๐ Analyze | LO7: Compare hardwired vs microprogrammed control units โ speed, flexibility, complexity, and use cases |
| ๐ Analyze | LO8: Analyze the interrupt cycle and determine how IEN, FGI, FGO flags interact to handle I/O |
| ๐ด Evaluate | LO9: Evaluate design trade-offs in bus width, register count, and instruction format for a basic CPU |
| ๐ด Evaluate | LO10: Justify why Mano's 25-instruction architecture is sufficient to demonstrate Turing-completeness |
| ๐ฃ Create | LO11: Design a simple CPU simulator that implements the fetch-decode-execute cycle for Mano's instructions |
| ๐ฃ Create | LO12: Construct timing diagrams and control signal tables for a new custom instruction added to Mano's ISA |
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) | Symbol | Operation | RTL Description |
|---|---|---|---|
| 0x0 (000) | AND | Bitwise AND | AC โ AC โง M[effective address] |
| 0x1 (001) | ADD | Add to AC | AC โ AC + M[effective address], E โ carry |
| 0x2 (010) | LDA | Load to AC | AC โ M[effective address] |
| 0x3 (011) | STA | Store AC | M[effective address] โ AC |
| 0x4 (100) | BUN | Branch Unconditionally | PC โ effective address |
| 0x5 (101) | BSA | Branch and Save Return | M[effective address] โ PC, PC โ effective address + 1 |
| 0x6 (110) | ISZ | Increment and Skip if Zero | M[effective address] โ M[effective address] + 1; if result = 0, PC โ PC + 1 |
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.
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).
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!
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.
| Symbol | Opcode | Description |
|---|---|---|
| AND | 000 | AND memory word to AC |
| ADD | 001 | Add memory word to AC |
| LDA | 010 | Load memory word to AC |
| STA | 011 | Store AC in memory |
| BUN | 100 | Branch unconditionally |
| BSA | 101 | Branch and save return address |
| ISZ | 110 | Increment 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 Code | Symbol | Description |
|---|---|---|
| 7800 | CLA | Clear AC |
| 7400 | CLE | Clear E (carry flip-flop) |
| 7200 | CMA | Complement AC |
| 7100 | CME | Complement E |
| 7080 | CIR | Circular right shift AC and E |
| 7040 | CIL | Circular left shift AC and E |
| 7020 | INC | Increment AC |
| 7010 | SPA | Skip if AC positive (ACโโ = 0) |
| 7008 | SNA | Skip if AC negative (ACโโ = 1) |
| 7004 | SZA | Skip if AC zero |
| 7002 | SZE | Skip if E is zero |
| 7001 | HLT | Halt the computer |
Category 3: I/O Instructions (6 instructions)
Opcode = 111, I = 1. Used for input/output and interrupt control.
| Hex Code | Symbol | Description |
|---|---|---|
| F800 | INP | Input character to AC(0โ7) |
| F400 | OUT | Output character from AC(0โ7) |
| F200 | SKI | Skip if input flag FGI = 1 |
| F100 | SKO | Skip if output flag FGO = 1 |
| F080 | ION | Interrupt enable on (IEN โ 1) |
| F040 | IOF | Interrupt enable off (IEN โ 0) |
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
| Feature | Hardwired | Microprogrammed |
|---|---|---|
| Speed | Faster (direct gate logic) | Slower (ROM lookup each cycle) |
| Flexibility | Inflexible โ redesign gates to modify | Flexible โ just update ROM contents |
| Cost | Expensive for complex ISAs | Cheaper for complex ISAs |
| Design Complexity | High (boolean equations grow exponentially) | Lower (systematic tabular approach) |
| Used In | RISC CPUs (ARM, MIPS) | CISC CPUs (x86, VAX) |
| Bug Fixing | Requires physical redesign | Microcode patch (Intel does this!) |
| Example | Mano's Basic Computer | Intel Pentium, IBM System/360 |
| GATE Questions | Frequently asked | Comparison questions common |
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 โ
โโโโโโโโโโโโโโโ
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โโ
| Time | Micro-operation | AR | IR | DR | AC | PC | Bus |
|---|---|---|---|---|---|---|---|
| Tโ | AR โ PC | 100 | โ | โ | 0003 | 100 | PCโBusโAR |
| Tโ | IR โ M[AR], PC++ | 100 | 1200 | โ | 0003 | 101 | MโBusโIR |
| Tโ | Decode, AR โ IR(0โ11) | 200 | 1200 | โ | 0003 | 101 | IRโBusโAR |
| Tโ | I=0, Dโ=1 (ADD) | 200 | 1200 | โ | 0003 | 101 | โ |
| Tโ | DR โ M[AR] | 200 | 1200 | 0005 | 0003 | 101 | MโBusโDR |
| Tโ | AC โ AC+DR, SCโ0 | 200 | 1200 | 0005 | 0008 | 101 | ALU op |
Result: AC = 0003 + 0005 = 0008. E = 0 (no carry). PC = 101 (ready for next instruction).
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).
Learn by Doing โ 3-Tier Lab Structure
๐ข Tier 1 โ GUIDED: Trace an ADD Instruction on Paper
Step 1: Set Up the Initial State
Draw this table on paper (or in a spreadsheet):
| Register | Initial Value |
|---|---|
| PC | 050 (hex) |
| AC | 000A (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:
| Time | Operation | AR | IR | DR | AC | PC |
|---|---|---|---|---|---|---|
| Tโ | AR โ PC | 050 | โ | โ | 000A | 050 |
| Tโ | IR โ M[AR], PC++ | 050 | 1080 | โ | 000A | 051 |
| Tโ | Decode, AR โ 080 | 080 | 1080 | โ | 000A | 051 |
| Tโ | I=0, nothing extra | 080 | 1080 | โ | 000A | 051 |
| Tโ | DR โ M[080] | 080 | 1080 | 0014 | 000A | 051 |
| Tโ | AC โ AC+DR | 080 | 1080 | 0014 | 001E | 051 |
โ 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.
๐ก Tier 2 โ SEMI-GUIDED: Build a CPU Simulator in Python
Your Mission:
Build a Python program that simulates Mano's Basic Computer. It should:
- Store a small program in a simulated 4096-word memory array
- Implement the fetch-decode-execute cycle
- Support at least: LDA, STA, ADD, AND, BUN, HLT
- 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)
๐ด Tier 3 โ OPEN CHALLENGE: Visual CPU Simulator in HTML/JS
The Brief:
Build an interactive web-based CPU simulator for Mano's Basic Computer. Features:
- Visual register display (PC, AR, IR, AC, DR, TR) with live values
- Memory table showing all loaded words
- "Step" button โ advances one timing signal at a time (Tโ, Tโ, ...)
- "Run" button โ executes until HLT
- Common bus animation showing data flow between registers
- Instruction decode panel showing opcode, I-bit, and address in real-time
- Support all 25 Mano instructions
Deliverable: A single HTML file with embedded CSS/JS. Host it on GitHub Pages for your portfolio.
Practice Problems โ Diagrams, Numericals, Industry & GATE
Diagram Questions (3)
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.
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.
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.
Numerical Questions (6)
The instruction at address 100โโ is 0x9200. What operation does it perform? Is it direct or indirect? What is the effective address?
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.
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?
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?
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.
How many clock cycles does each instruction type take (including fetch)? Calculate the total cycles for a program: LDA, ADD, ADD, STA, HLT.
Industry Application Questions (3)
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?
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?
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?
GATE-Style Questions (5)
GATE CSE In Mano's basic computer, the instruction at address 010 (hex) is 0xF400. What operation is performed?
- Store AC to memory at address 400
- Output AC(0โ7) to OUTR
- Branch to address 400 unconditionally
- Input character from INPR to AC
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?
- DR
- PC
- AC
- IR
GATE CSE During the interrupt cycle of Mano's basic computer, the return address is stored at memory location:
- 0
- 1
- The address specified in the current instruction
- The stack pointer location
GATE CSE How many timing signals are needed to execute the BSA instruction (direct addressing) after fetch-decode?
- 1
- 2
- 3
- 4
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?
- 2560 bits
- 2048 bits
- 1280 bits
- 5120 bits
MCQ Assessment Bank โ 30 Questions (Bloom's Mapped)
Remember / Identify (Q1โQ6)
The bit-width of the Program Counter (PC) in Mano's Basic Computer is:
- 8 bits
- 12 bits
- 16 bits
- 32 bits
The opcode for the LDA instruction in Mano's Basic Computer is:
- 000
- 001
- 010
- 011
How many memory-reference instructions are in Mano's Basic Computer?
- 5
- 6
- 7
- 12
The Accumulator (AC) in Mano's Basic Computer is:
- 8 bits wide
- 12 bits wide
- 16 bits wide
- 32 bits wide
The I-bit in Mano's instruction format indicates:
- Interrupt enable
- Immediate operand
- Indirect addressing
- Input flag
Which register holds the instruction currently being executed?
- PC
- AR
- IR
- DR
Understand / Explain (Q7โQ12)
Why is the common bus system preferred over point-to-point connections between registers?
- It is faster
- It reduces wiring complexity
- It allows multiple simultaneous transfers
- It increases register count
What happens during timing signal Tโ of the instruction cycle?
- The opcode is decoded
- AR receives PC value
- IR receives instruction from memory and PC is incremented
- The ALU performs the operation
Why does the interrupt cycle store the return address at M[0] instead of using a stack?
- Stacks hadn't been invented yet
- Mano's basic computer has no stack pointer or stack mechanism
- M[0] is faster to access
- It allows nested interrupts
The BSA instruction is used for:
- Bit shifting
- Block data transfer
- Subroutine calls
- Bus arbitration
In hardwired control, what determines the sequence of control signals?
- Microcode ROM
- Combinational logic gates and timing signals
- Software interrupts
- Main memory
What is the purpose of the E (carry) flip-flop?
- Enable/disable interrupts
- Store the overflow/carry bit from AC operations
- Error detection flag
- End-of-instruction marker
Apply / Solve (Q13โQ18)
If AC = 0x00FF and DR = 0x0F0F, what is the result of AND operation?
- 0x000F
- 0x0FFF
- 0x0F0F
- 0x00FF
SโSโSโ = 011 places which register on the common bus?
- AR
- PC
- DR
- AC
An instruction has hex code 0x7020. What operation does it perform?
- INC (increment AC)
- CMA (complement AC)
- CIR (circular right shift)
- ADD
After executing LDA 200 (direct) where M[200] = 0xABCD, what is the value of AC?
- 0x0200
- 0xABCD
- 0x0000
- Unchanged
How many words of memory can Mano's Basic Computer address?
- 256
- 1024
- 4096
- 65536
The micro-operation "AR โ IR(0โ11)" happens during which timing signal?
- Tโ
- Tโ
- Tโ
- Tโ
Analyze / Compare (Q19โQ24)
Which instruction takes the MOST clock cycles to execute (including fetch) in direct addressing mode?
- STA
- ADD
- ISZ
- BUN
Adding indirect addressing to a memory-reference instruction adds how many extra clock cycles?
- 0
- 1
- 2
- 3
Why does Mano's computer use a 3-bit opcode instead of 4-bit?
- To save power
- To maximize the address field (12 bits) within a 16-bit instruction
- Because only 7 instructions exist
- Because the ALU is 3 bits wide
In the common bus system, what prevents two registers from driving the bus simultaneously?
- Bus arbiter hardware
- The MUX allows only one input to pass through at a time
- Registers check bus status before writing
- The clock signal prevents collisions
Why is IEN cleared to 0 during the interrupt cycle?
- To save power
- To prevent nested interrupts
- Because the I/O device requested it
- To reset the CPU
What would happen if the sequence counter (SC) is NOT cleared after instruction execution?
- The CPU would execute the same instruction twice
- Timing signals would continue incrementing, producing incorrect control signals
- The bus would be locked
- Memory would be corrupted
Evaluate & Create (Q25โQ30)
If you could add ONE more register to Mano's Basic Computer, which would improve performance the most?
- A second accumulator (AC2)
- A stack pointer (SP)
- A base register (BR)
- A flag register (FR)
Which is a valid criticism of Mano's Basic Computer's bus architecture?
- The bus is too wide (16 bits is wasteful)
- Only one data transfer can occur per clock cycle, creating a bottleneck
- The MUX is unnecessary
- Registers should connect directly to memory without a bus
A student proposes increasing the opcode field to 5 bits. What is the main disadvantage?
- Too many instructions to implement
- Address field shrinks to 10 bits = only 1024 addressable words
- The I-bit would be eliminated
- The clock speed would decrease
To implement a SUBTRACT instruction in Mano's computer (without adding new hardware), you would:
- Use SUB opcode directly
- Complement the operand (CMA), increment (INC), then ADD
- Use the E flip-flop to borrow
- It's impossible without new hardware
Design a loop that adds numbers at addresses 100โ104 using Mano's instructions. How many instructions are needed (minimum)?
- 5
- 8
- 10
- 15
If you were designing a new instruction "SWAP" that exchanges AC and DR contents, how many timing signals would the execute phase need?
- 1
- 2
- 3
- 4
Short Answer Questions (8)
List all 8 registers of Mano's Basic Computer with their bit-widths and primary functions. (4 marks)
Explain the 16-bit instruction format of Mano's Basic Computer. What is the role of the I-bit? (4 marks)
Write the RTL micro-operations for the fetch phase (Tโ, Tโ, Tโ). Explain what each accomplishes. (5 marks)
What is the purpose of the sequence counter (SC)? What happens when it is cleared? (3 marks)
How does indirect addressing work in Mano's computer? Give an example with a memory diagram. (4 marks)
Differentiate between memory-reference, register-reference, and I/O instructions. How does the CPU distinguish them? (4 marks)
Explain the interrupt cycle in Mano's Basic Computer. What are Tโ, Tโ, Tโ micro-operations? (5 marks)
What is the role of the MUX selection lines SโSโSโ in the common bus system? List all encodings. (3 marks)
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.
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.
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.
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.
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.
| Detail | Info |
|---|---|
| Tools Used Daily | Verilog/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 Hiring | ARM, Qualcomm, Samsung R&D, Intel, AMD, NVIDIA, MediaTek, Texas Instruments, Broadcom, ISRO, CDAC, IIT Madras (SHAKTI) |
| Key Skills | Computer Organization (Mano's + Patterson/Hennessy), Digital Logic, Verilog/VHDL, GATE (for PSU/DRDO path) |
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
| Platform | Best For | Typical Rate |
|---|---|---|
| Freelancer.com | Verilog/VHDL projects from US/EU universities | $50โ$200/project (โน4,000โโน16,000) |
| Chegg / Course Hero | COA assignment solutions (ethically: tutoring) | $5โ$20/answer |
| Udemy / Skillshare | CPU architecture course creation | โน10,000โโน50,000/month passive |
| GitHub + Portfolio | Land interviews at ARM/Qualcomm/Intel India | โน12โ18 LPA starting salary |
| GATE Coaching | COA 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)
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
| Parameter | Value | Why |
|---|---|---|
| Word size | 16 bits | Instruction and data width |
| Address space | 4096 words (4K) | 12-bit address field: 2ยนยฒ = 4096 |
| Total memory | 4K ร 16 bits = 8 KB | 4096 words ร 16 bits/word |
| Opcodes | 8 (3-bit field) | 2ยณ = 8, of which 7 are memory-ref |
| Total instructions | 25 | 7 + 12 + 6 |
| MUX inputs | 7 + 1 (none) | AR, PC, DR, AC, IR, TR, Memory + idle |
| Fetch cycles | 3 (TโโTโ) | Same for ALL instructions |
| Fastest instruction | 4 cycles (STA, BUN, register-ref) | 3 fetch + 1 execute |
| Slowest instruction | 7 cycles (ISZ indirect) | 3 fetch + 1 indirect + 3 execute |
Earning Checkpoint โ Are You Ready to Earn?
| Skill | Tool/Method | Portfolio Evidence | Earning Ready? |
|---|---|---|---|
| Instruction Format Decoding | Manual / Paper | โ | โ Yes โ GATE prep tutoring |
| Trace Table Execution | Paper / Spreadsheet | Completed trace for all 7 instructions | โ Yes โ COA tutoring at โน500โโน1500/hr |
| CPU Simulator (Python) | Python | Working simulator on GitHub | โ Yes โ Freelance projects โน5Kโโน15K |
| Visual CPU Simulator (Web) | HTML/CSS/JS | Live demo on GitHub Pages | โ Yes โ EdTech projects โน20Kโโน50K |
| Verilog/VHDL Implementation | Verilog, FPGA | Synthesizable code + simulation waveforms | โ Yes โ โน10Kโโน25K freelance |
| Control Unit Design | Conceptual + Diagrams | Hardwired vs Micro comparison document | โ Yes โ GATE content creation |
| Interrupt Handling | Conceptual | โ | โฌ Need hands-on with real ยตController |
โ 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]