6 Simple Computer Architecture Models

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.

Simple Computer Architecture Models: notes

SAP 1 computer components and block diagram

SAP-1 is a very small 8-bit computer. It has a 4-bit address, so memory holds only 16 bytes. All parts are joined to one 8-bit common W bus.

Components:

  • Program counter (PC): 4-bit. Holds the address of the next instruction. It counts up after each fetch.
  • Input and MAR (memory address register): 4-bit. Holds the address sent to the memory.
  • RAM: 16 words of 8 bits. Holds the program and data.
  • Instruction register (IR): 8-bit. Holds the fetched instruction. Its upper 4 bits go to the controller (opcode), and its lower 4 bits go back to the bus (operand address).
  • Controller-sequencer: makes the 12-bit control word that directs all other parts. A ring counter gives six timing states T1 to T6.
  • Accumulator (A): 8-bit. Holds the working data and the result.
  • Adder-subtractor: adds or subtracts A and B. It uses 2's complement for subtraction.
  • B register: 8-bit. Holds the second operand for the adder-subtractor.
  • Output register: 8-bit. Holds the result for the display.
  • Binary display: shows the contents of the output register in LEDs.

SAP 1 instruction set

SAP-1 has an 8-bit instruction: 4 bits of opcode and 4 bits of address.

MnemonicOpcodeAction
LDA addr0000Load A from the memory location
ADD addr0001Add the memory byte to A
SUB addr0010Subtract the memory byte from A
OUT1110Send A to the output register
HLT1111Stop the computer

Example program with memory contents 9H = 02H, AH = 03H and BH = 01H:

Address  Mnemonic   Machine code
0H       LDA 9H     09H     ; A = 02H
1H       ADD AH     1AH     ; A = 02H + 03H = 05H
2H       SUB BH     2BH     ; A = 05H - 01H = 04H
3H       OUT        E0H     ; output = 04H
4H       HLT        F0H

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 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

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]

FeatureSAP-1SAP-2
Memory16 bytes, 4-bit address64 KB, 16-bit address
RegistersA and B onlyA, B, C and a temporary register
Instruction set5 instructionsMuch larger set with data transfer, arithmetic, logic, jump, call and I/O instructions
ALUAddition and subtractionAddition, subtraction, AND, OR, NOT, increment and decrement
FlagsNoneSign (S) and Zero (Z) flags, so conditional jumps are possible
Input and outputSingle output registerInput ports 1 and 2, output port 3
Program flowStraight line onlyJumps, conditional jumps and subroutine call/return
Program counter4-bit16-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.

Open this answer on its own page →

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]

Note: The reference notes were not available for this topic. The following answer is based on standard computer organization and microprocessor curriculum as taught in TU BSc CSIT. --- (a) Architectural Differences Between SAP-1 and SAP-2 SAP stands for Simple As Possible computer. SAP-1 and SAP-...

Open this answer on its own page →

2079 · 5 marks

What is the difference between SAP-1 and SAP-2? [5]

Note: No specific reference notes were found for this topic. The following answer is based on standard computer architecture curriculum content for TU BSc CSIT, which covers SAP (Simple As Possible) computers as described in Malvino's Digital Computer Electronics. --- Feature SAP-1 SAP-2 --------...

Open this answer on its own page →

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 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

FieldBitsDescription
I (Mode)1Addressing mode: 0 = direct, 1 = indirect
Opcode13Operation code; supports up to $2^{13} = 8192$ operations
Address18Operand 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.

Open this answer on its own page →

2078 · 10 marks

Explain the instruction format of basic computer. Differentiate between RISC and CISC computer.[10]

Note: The reference notes were not available for this topic. The answer below is based on standard computer organization and architecture curriculum as taught in TU BSc CSIT. --- An instruction format defines the layout of bits in a machine instruction. It specifies how the bits are divided into ...

Open this answer on its own page →

2080.1 · 5 marks

Explain the register organization of basic computer. [5]

The basic computer (as described in the classic Morris Mano model) uses a set of registers to hold temporary data, addresses, and control information during program execution. The register organization defines the internal structure of the CPU. --- The basic computer has 8 registers as follows: R...

Open this answer on its own page →

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]

SAP (Simple As Possible) is a simplified educational computer architecture introduced by Albert Paul Malvino to help students understand the fundamental operation of a digital computer, including the fetch, decode, and execute cycle. SAP-1 is the most basic version of this architecture. --- Note:...

Open this answer on its own page →

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 (Simple As Possible - 1) is a basic educational computer designed by Albert Paul Malvino to illustrate the fundamental concepts of computer architecture. It is an 8-bit computer with a simple instruction set, used to understand how a CPU works at the register-transfer level. --- --- - Keeps...

Open this answer on its own page →

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]

Note: The reference notes were not available for this topic. The following answer is based on standard SAP-1 (Simple As Possible 1) computer architecture as described in Malvino & Brown's Digital Computer Electronics, which is the standard textbook used in TU BSc CSIT curriculum. --- (a) Instruct...

Open this answer on its own page →