Ez Computerहिन्दीOpen app

Advanced Add-on 1 — Computer Organisation, CPU and Memory

Preview Part L: Advanced Add-on · Chapter 49 · 27 min read · 42 practice questions

After this chapter you will be able to

  • trace the contents of PC, MAR, MDR, IR and AC at every step of an instruction
  • solve address-bus, word-size, chip-count and page-table problems with the working shown
  • identify instruction formats and addressing modes from a given instruction
  • explain interrupt types, priority methods and the three I/O transfer methods
  • separate look-alike facts on control units, Flynn’s classes, endianness, memory types and motherboard parts

📌 MUST KNOW - This is extra, harder material that adds to the main book. Read Chapters 1, 3, 4, 5 and 6 first. The main chapters answer most exam questions; this part is for the hardest ones, so do not start here.

Chapters 4, 5 and 6 give the basic units, the register list, the bus and the memory types. Chapters 40 and 46 cover cache mapping, IPC, Amdahl’s Law and the pipeline. This chapter adds only what a harder paper asks on top of them.

49.1 Registers: What Each Holds at Every Step

A Mains question asks which register holds what at a given moment. Take a one-address (accumulator) machine.

Address Instruction / data Meaning
200 LDA 500 AC ← M[500]
201 ADD 501 AC ← AC + M[501]
202 STA 502 M[502] ← AC
500 7 Data
501 5 Data

Trace of ADD 501 (LDA has already run, so AC = 7 and PC = 201).

Step Micro-operation PC MAR MDR IR AC
Fetch 1 MAR ← PC 201 201 old old 7
Fetch 2 MDR ← M[MAR]; PC ← PC + 1 202 201 ADD 501 old 7
Fetch 3 IR ← MDR 202 201 ADD 501 ADD 501 7
Decode CU reads opcode ADD; MAR ← address part of IR 202 501 ADD 501 ADD 501 7
Execute 1 MDR ← M[MAR] 202 501 5 ADD 501 7
Execute 2 AC ← AC + MDR 202 501 5 ADD 501 12

Match the register with what it holds

Register Holds
PC (8086: IP) Address of the next instruction
IR Opcode and address field of the current instruction
MAR Address sent out on the address bus
MDR / MBR Word just read from, or about to be written to, memory
AC One operand before an ALU operation and the result after it
SP Address of the top of the stack
Index register A value added to an address field (array position)
Base register Starting address of a program or data block

★ EXAM POINT - MAR connects to the address bus; MDR connects to the data bus. MAR is loaded only from the CPU side, so it is one-way like the address bus. MDR is two-way like the data bus.

49.2 Flags, Stack and Segment Registers

Status flags are bits set by the ALU; control flags are set by the programmer.

Flag Set to 1 when
Carry (CY / CF) An unsigned result goes out of the top bit
Zero (Z) The result is 0
Sign (S) The top bit of the result is 1 (negative in signed form)
Parity (P) The result has an even number of 1s
Auxiliary carry (AC / AF) A carry passes from bit 3 to bit 4 (used for BCD)
Overflow (OF) A signed result is too large for the register

Worked example: two 8-bit additions

  1. 9CH + 64H = 1001 1100 + 0110 0100 = 1 0000 0000. The register keeps 00H. CY = 1, Z = 1, S = 0, P = 1 (zero 1s is even), AC = 1 (C + 4 = 16 carries out of bit 3). Signed view: −100 + 100 = 0, so OF = 0.
  2. 50H + 50H = 0101 0000 + 0101 0000 = 1010 0000 (A0H). CY = 0, Z = 0, S = 1, P = 1 (two 1s), AC = 0. Signed view: +80 + +80 = +160, beyond +127, so OF = 1.

⚠ COMMON CONFUSION - Carry is for unsigned numbers; overflow is for signed numbers. Example 1 sets carry without overflow; example 2 sets overflow without carry.

Stack pointer. In the 8085 and x86 the stack grows downward. An 8085 PUSH stores two bytes: SP = 2400H → PUSH B → SP = 23FEH. CALL and every interrupt push the PC onto the stack.

Segment registers (8086): CS, DS, SS, ES. Physical address (20-bit) = segment × 10H + offset.

What the full chapter covers

The full chapter has these sections:

  1. 49.1 Registers: What Each Holds at Every Step
  2. 49.2 Flags, Stack and Segment Registers
  3. 49.3 Bus Widths and Addressable-Memory Maths
  4. 49.4 Instruction Formats: 3, 2, 1 and 0 Address
  5. 49.5 Addressing Modes with One Worked Table
  6. 49.6 Interrupts in Depth
  7. 49.7 I/O Transfer: Programmed, Interrupt-Driven and DMA
  8. 49.8 Control Unit Design and Architecture Classes
  9. 49.9 Memory Organisation and Chip Maths
  10. 49.10 Virtual Memory from the Hardware Side
  11. 49.11 Memory-Type Traps and Cell Structures
  12. 49.12 Performance Terms and Unit Traps
  13. 49.13 Motherboard Facts Examiners Ask
  14. 49.14 Statement Traps
  15. Chapter Quick Revision
  16. Most Important Terms
  17. Common Confusions
  18. Rapid Recall

Sample questions from this chapter

1. MIPS rating of a 2 GHz CPU with an average CPI of 1.7?

  1. About 1,176
  2. About 850
  3. About 2,000
  4. About 3,400
Show answer

Answer: A. About 1,176

MIPS = 2,000 MHz ÷ 1.7 ≈ 1,176.

2. Addressing mode needing two memory reads to reach the operand?

  1. Direct
  2. Immediate
  3. Register indirect
  4. Indirect
Show answer

Answer: D. Indirect

Indirect mode first reads the operand's address from memory, then reads the operand: two reads.

3. Capacity of a DRAM chip with 11 multiplexed address pins and 1 data pin?

  1. 1 Mbit
  2. 4 Mbit
  3. 22 Mbit
  4. 2 Mbit
Show answer

Answer: B. 4 Mbit

11 multiplexed pins give 11 row + 11 column = 22 address bits: 2²² × 1 = 4 Mbit.

4. Byte order used as the TCP/IP network byte order?

  1. Little-endian
  2. Big-endian
  3. Host order
  4. Bi-endian
Show answer

Answer: B. Big-endian

TCP/IP sends multi-byte fields most significant byte first, which is big-endian.

5. Number of 2K × 4 chips needed for a 16K × 8 memory?

  1. 8
  2. 4
  3. 16
  4. 32
Show answer

Answer: C. 16

(16K × 8) ÷ (2K × 4) = 128K ÷ 8K = 16 chips.