Microprocessor and Computer Architecture · Unit 6
Simple Computer Architecture Models
Exam-focused notes for Simple Computer Architecture Models (Microprocessor and Computer Architecture, BIT151): what the TU syllabus asks and how it has actually been tested, with 9 solved past questions from this unit.
Simple Computer Architecture Models in short
Real processors are large and hard to study. So textbooks use small teaching computers that show all the main ideas: SAP-1 and SAP-2 (Simple As Possible) and the basic computer. This chapter explains their parts, instructions and how an instruction runs.
What this unit covers
- SAP 1 computer components and block diagram
- SAP 1 instruction set
- SAP 1 fetch and execution cycle
- SAP 2 computer features and architecture
- Differences between SAP 1 and SAP 2
- Basic computer instruction format and register organization
SAP 2 computer features and architecture
2082 · 10 marks
Explain the features of SAP2 computer with well labeled block diagram.How is it different compared to SAP1 Computer?[8+2]
Show solved answerHide answer
SAP-2 Computer: Features, Block Diagram, and Comparison with SAP-1
Note: The reference notes did not contain this topic. The following answer is based on standard computer architecture curriculum as taught in TU BSc CSIT (Malvino's "Digital Computer Electronics" textbook content), which is the standard source for SAP computers in this course.
SAP-2 (Simple As Possible - 2) Computer
SAP-2 is an improved version of SAP-1, designed to be more powerful and closer to a real microprocessor. It has an 8-bit architecture with enhanced instruction set, more registers, and bidirectional data bus.
Features of SAP-2 Computer
1. 8-bit Bidirectional Data Bus
- SAP-2 uses a bidirectional bus (unlike unidirectional in SAP-1), allowing data to flow in both directions between components.
2. 64 KB Memory (16-bit Address)
- SAP-2 has a 16-bit Program Counter and can address up to 65,536 (64K) memory locations, a significant improvement over SAP-1's 16-byte memory.
3. More General Purpose Registers
- SAP-2 contains:
- Accumulator (A) - 8-bit
- Register B - 8-bit
- Register C - 8-bit
- B and C can be used for temporary data storage.
4. Input/Output Ports
- SAP-2 has dedicated input ports (Port 1, Port 2) and output ports (Port 3) for I/O operations, making it capable of real I/O communication.
5. Flags Register
- SAP-2 includes a Flags register with:
- Sign Flag (S) - set if result is negative
- Zero Flag (Z) - set if result is zero
- These flags enable conditional jump instructions.
6. Enhanced ALU
- The ALU supports more operations:
- Addition (ADD)
- Subtraction (SUB)
- Logical AND, OR, NOT (logical operations)
- Increment / Decrement
7. Larger Instruction Set
- SAP-2 supports a much richer instruction set including:
- Data transfer:
MOV,MVI,LDA,STA - Arithmetic:
ADD,SUB,INR,DCR - Logical:
ANA,ORA,CMA - Branch:
JMP,JZ,JNZ,JM - I/O:
IN,OUT - Control:
HLT
- Data transfer:
8. Controller/Sequencer
- Uses a more complex control unit with more control words to handle the larger instruction set and more components.
9. Stack Pointer (in some versions)
- Some implementations include a Stack Pointer for subroutine handling.
10. Instruction Register (IR)
- 8-bit IR stores the fetched instruction. The opcode is decoded by the controller.
Well-Labeled Block Diagram of SAP-2
+------------------+
| INPUT PORTS |
| (Port 1, Port 2)|
+--------+---------+
|
+----------------+------------------------------------------+
| 8-BIT BIDIRECTIONAL BUS (W BUS) |
+---+----------+--------+--------+--------+--------+--------+
| | | | | |
+---+---+ +--+---+ +--+--+ +--+--+ +--+--+ +--+--+
| MAR | | PC | | A | | B | | C | | IR |
|(Mem | |(16- | |(Acc)| |Reg B| |Reg C| |(Inst|
|Addr | | bit) | |8-bit| |8-bit| |8-bit| | Reg)|
|Reg) | +--+---+ +--+--+ +--+--+ +--+--+ +--+--+
+---+---+ | | | |
| | +--+--------+--+ |
| | | ALU | |
+---+---+ | | (ADD,SUB,AND, | |
|MEMORY | | | OR, NOT,INC) | |
|(64KB) | | +------+--------+ |
+---+---+ | | |
| | +---+----+ |
| | | FLAGS | |
| | | (S, Z) | |
| | +--------+ |
| | |
| +----+------------------------------------------+
| | CONTROLLER / SEQUENCER |
| | (Control Word, Ring Counter, Decoder) |
| +------------------------------------------------+
|
+---+---------+
| OUTPUT PORT |
| (Port 3) |
+-------------+
Simplified Clean Diagram:
+-----------+ +-----------+ +-----------+
| INPUT | | MEMORY | | OUTPUT |
| PORTS 1,2 | | (64 KB) | | PORT 3 |
+-----+-----+ +-----+-----+ +-----+-----+
| | |
=======+=========================================+======
8-BIT BIDIRECTIONAL W-BUS
=======+====+====+====+====+====+====+====+======
| | | | | | | |
+-+--+ +-+-+ +-+-+ +-+-+ +-+-+ +-+--+
| MAR| | PC| | A | | B | | C | | IR |
+--+-+ +---+ +-+-+ +-+-+ +---+ +--+-+
| | | |
+---+---+ +--+-----+--+ +----+-------------+
|MEMORY | | ALU | | CONTROLLER / |
|(64 KB)| |(ADD, SUB, | | SEQUENCER |
+-------+ | AND, OR, | | (control word, |
| NOT, INC) | | ring counter, |
+-----+-----+ | decoder) |
| +------------------+
+-----+-----+
| FLAGS |
| (S, Z) |
+-----------+
How SAP-2 Differs from SAP-1 [2 Marks]
| Feature | SAP-1 | SAP-2 |
|---|---|---|
| Memory | 16 bytes, 4-bit address | 64 KB, 16-bit address |
| Registers | A and B only | A, B, C and a temporary register |
| Instruction set | 5 instructions | Much larger set with data transfer, arithmetic, logic, jump, call and I/O instructions |
| ALU | Addition and subtraction | Addition, subtraction, AND, OR, NOT, increment and decrement |
| Flags | None | Sign (S) and Zero (Z) flags, so conditional jumps are possible |
| Input and output | Single output register | Input ports 1 and 2, output port 3 |
| Program flow | Straight line only | Jumps, conditional jumps and subroutine call/return |
| Program counter | 4-bit | 16-bit |
Conclusion
SAP-2 keeps the single 8-bit W-bus architecture of SAP-1 but grows in every dimension that matters: 64 KB of memory instead of 16 bytes, more registers, a richer ALU with flags, real input and output ports, and an instruction set large enough to support branching and subroutines. Those additions are what turn SAP-1's straight-line toy machine into something that behaves like a genuine microprocessor such as the 8085.
Differences between SAP 1 and SAP 2
2081 · 10 marks
Explain the architectural difference between SAP 1 and SAP 2 computer?Explain all the addressing modes of 8085 microprocessor with suitable example.[5+5]
Basic computer instruction format and register organization
2079 · 5 marks
What is Instruction Format of basic computer architecture? A computer uses a memory unit with 256K words of 32 bits each. Draw the instruction word format and indicate the number of bits in each part. [5]
Show solved answerHide answer
Instruction Format of Basic Computer Architecture
Definition
An instruction format specifies the layout of bits within an instruction word. It defines how the total bits of the word are partitioned into fields, typically:
- Mode field (I): indicates the addressing mode (direct or indirect).
- Operation code (opcode): specifies the operation to be performed.
- Address field: specifies the memory address of the operand.
In the basic computer (Mano's model), each instruction occupies one memory word, and the format is determined by the memory word size and the number of addressable locations.
Given Data
- Memory size = 256K words
- Word size = 32 bits (so each instruction is 32 bits)
Step 1: Number of Bits for the Address Field
The address field must be large enough to address every word in memory.
$$256K = 256 \times 1024 = 2^8 \times 2^{10} = 2^{18}$$
$$\text{Address bits} = \log_2(2^{18}) = 18 \text{ bits}$$
So 18 bits are required for the address field.
Step 2: Allocate the Remaining Bits
Total word size = 32 bits. Reserve 1 bit for the addressing mode (I), the rest goes to the opcode.
$$\text{Opcode bits} = 32 - 1 - 18 = 13 \text{ bits}$$
Check:
$$1 + 13 + 18 = 32 \text{ bits} \checkmark$$
Instruction Word Format (32 bits)
31 30 18 17 0
+----+----------------+--------------------------+
| I | Opcode | Address |
|1bit| 13 bits | 18 bits |
+----+----------------+--------------------------+
Explanation of Each Field
| Field | Bits | Description |
|---|---|---|
| I (Mode) | 1 | Addressing mode: 0 = direct, 1 = indirect |
| Opcode | 13 | Operation code; supports up to $2^{13} = 8192$ operations |
| Address | 18 | Operand address; addresses up to $2^{18} = 256K$ words |
Key Points
- Address field size ($18$ bits) is fixed by the memory size ($256K = 2^{18}$).
- One bit is used as the mode bit to select direct/indirect addressing.
- The remaining $13$ bits form the opcode.
Final answer: Mode = 1 bit, Opcode = 13 bits, Address = 18 bits, totaling 32 bits.
2078 · 10 marks
Explain the instruction format of basic computer. Differentiate between RISC and CISC computer.[10]
2080.1 · 5 marks
Explain the register organization of basic computer. [5]
SAP 1 computer components and block diagram
2078 · 10 marks
Explain the components of SAP 1 computer with its block diagram. How is it different from SAP 2 computer?[10]
0 · 10 marks
Explain the components of SAP 1 computer with its block diagram. What are different instructions available in SAP 1 computer?[10]
SAP 1 instruction set
2080.1 · 10 marks
What are different instructions available in SAP 1 computer?Explain the fetch and execution cycle of LDA instruction of SAP 1 computer along with timing diagram.[5+5]
Make Unit 6 stick
Practice BIT151 with flashcards & quizzes