Basic Computer Organisation and Design
Basic Computer Organisation and Design
Introduction:
- This chapter introduces a basic computer and outlines how its operation can
be specified using register transfer statements.
- The computer's organization is defined by its internal registers, timing and
control structure, and the set of instructions it uses.
- The basic computer presented in this chapter is relatively small compared to
commercial computers but serves as a simple example for demonstrating the
design process.
Computer Instructions:
- A computer instruction is a binary code that specifies a sequence of
microoperations for the computer.
- Instruction codes, along with data, are stored in memory.
- The computer reads each instruction from memory and places it in a control
register.
- The control unit interprets the binary code of the instruction and executes it
by issuing a sequence of microoperations.
- Each computer has its own unique instruction set, and the ability to store and
execute instructions is the fundamental property of a general-purpose
computer.
In this section, the text discusses the organization of instructions and data in
memory and the format of instruction codes. It also introduces the concepts of
immediate, direct, and indirect addressing modes.
1. **Memory Organization**:
- Memory is divided into two sections: one for instructions and one for data.
- The memory unit used has a capacity of 4096 words, requiring 12 bits to
specify an address (2^12 = 4096).
- Each instruction code is stored in a 16-bit memory word, providing space for
both the operation code (opcode) and the address of an operand.
- The control unit reads a 16-bit instruction from the program portion of
memory and uses the 12-bit address part of the instruction to fetch a 16-bit
operand from the data portion of memory.
2. **Instruction Code Format**:
- Each instruction code has two parts: an opcode and an address.
- Opcode: Specifies one of 16 possible operations using 4 bits.
- Address: Specifies the memory address of an operand using 12 bits.
- The control unit executes the operation based on the operation code.
5. **Indirect Addressing**:
- There are scenarios where the address bits of an instruction code are not
used as an address but represent the actual operand.
- Three addressing modes are introduced: immediate operand, direct
address, and indirect address.
- Immediate Operand: The address bits represent the operand itself.
- Direct Address: The address bits specify the memory location of the
operand.
- Indirect Address: The address bits designate a memory word that contains
the address of the operand.
- A mode bit (I) is used to distinguish between direct (I = 0) and indirect (I = 1)
addressing.
4. **Key Registers**:
- Data Register (DR): Holds the operand read from memory.
- Address Register (AR): Contains the memory address.
- Accumulator (AC): A general-purpose processing register.
- Instruction Register (IR): Holds the instruction code.
- Temporary Register (TR): Used for holding temporary data during
processing.
- Program Counter (PC): Stores the address of the next instruction to be
executed.
- Input Register (INPR) and Output Register (OUTR): Used for input and
output operations, respectively.
5. **Address Handling**:
- AR and PC both have 12 bits since they store memory addresses. The most
significant bits are set to 0 when transferring data to these registers.
- INPR and OUTR deal with 8-bit characters.
8. **Simultaneous Operations**:
- Multiple microoperations can be executed in parallel during the same clock
cycle.
- This efficiency is achieved by placing the content of one register onto the
bus and enabling the load input of another register or executing an operation
in the adder and logic circuit simultaneously.
This section provides a detailed overview of the registers used in a basic
computer and how they are interconnected using a common bus system for
efficient data transfer and processing.
The basic computer introduced in this chapter utilizes three different
instruction code formats, each consisting of 16 bits. These formats are
designed to handle various types of instructions, including memory-reference,
register-reference, and input-output instructions. Here are more detailed
explanations of each of these instruction formats:
**Instruction Recognition:**
- The computer's control unit recognizes the type of instruction based on the
values in specific bit positions within the instruction.
- For memory-reference instructions, the control unit examines the bits in
positions 12 through 15 to determine whether the instruction uses direct or
indirect addressing (based on the I bit).
- If the opcode is "111" (binary) in positions 12 through 14, the control unit
identifies the instruction as either register-reference or input-output based on
the value of the I bit (position 15).
- Register-reference instructions are distinguished by a "0" in bit position 15,
while input-output instructions have a "1" in bit position 15.
- The control unit then interprets the remaining bits according to the specific
instruction format.
**Number of Instructions:**
- Despite having only three bits for the opcode in memory-reference
instructions, the computer supports a total of 25 distinct instructions.
- This is achieved by using the remaining 12 bits in memory-reference
instructions and all 12 bits in register-reference and input-output instructions
for specifying various operations, tests, and I/O operations.
3. Clock pulses are applied to all flip-flops and registers within the computer
system. However, a clock pulse alone does not change the state of a register
unless the register is enabled by a control signal.
4. Control signals, generated by the control unit, determine which registers or
components should respond to the clock pulses at a given time. These control
signals are responsible for directing the flow of data and operations within the
computer.
8. The operation code (bits 12-14) is decoded using a 3-to-8 decoder, resulting
in eight possible decoder outputs (D0 through D7). These outputs correspond
to different operation codes and help determine the instruction's purpose.
9. The sequence counter (SC), a 4-bit counter, counts in binary from 0 to 15. Its
outputs are decoded into 16 timing signals (T0 through T15) that control
various aspects of the computer's operation.
11. The timing diagram illustrates the relationship between control signals and
clock transitions. The sequence counter responds to positive clock transitions.
12. Initially, the sequence counter is cleared to 0, activating the first timing
signal (T0). With each positive clock transition, SC is incremented unless it is
cleared, leading to the sequential activation of timing signals (T0, T1, T2, T3,
T4, and so on).
13. This sequence of timing signals orchestrates the various operations and
microoperations within the computer, ensuring that instructions are executed
in the correct order and at the right times.
3. **Read the Effective Address from Memory (if required):** In some cases,
instructions may have an indirect address. In such instances, the computer
needs to fetch additional data from memory to determine the effective
address for the instruction.
The timing signals T0, T1, and T2 are used to synchronize these operations in
the fetch phase.
During the decode phase (T2), the computer interprets the opcode and sets up
the control signals for the execution phase. This ensures that the instruction is
correctly executed in the subsequent phases of the instruction cycle.
The control unit of the computer is responsible for generating these timing
signals and coordinating the various operations of the instruction cycle. The
details of how these phases are implemented in the control unit and bus
system are important for understanding the internal workings of the
computer.
In the basic computer's instruction cycle, once an instruction is decoded, it is
executed in the "Execute" phase. The execution phase includes various
microoperations depending on the type of instruction. Register-reference
instructions are a specific type of instruction where the operation is performed
on the registers of the computer. Here is an explanation of the execution of
register-reference instructions:
5. **Return to Fetch Phase:** The control unit then returns to the "Fetch"
phase to fetch the next instruction using timing signal T0.
2. **Control Flow:** The control unit then proceeds to determine the type of
instruction by following a flowchart, as shown in Figure 5-9.
3. **Decoder Output D7:** The control unit checks the value of decoder
output D7. If D7 is equal to 1, this indicates that the instruction must be either
a register-reference or an input-output type.
5. **Inspecting Bit I:** The control unit inspects the value of the first bit of the
instruction, which is available in flip-flop I. If D7 is 0 and I is 1, this means that
the instruction is a memory-reference instruction with an indirect address.
6. **Handling Indirect Address:** If the instruction has an indirect address, the
control unit initiates a specific microoperation: AR (Address Register) is loaded
with the effective address from memory, symbolized by the register transfer
statement AR ← M[AR]. Initially, AR holds the address part of the instruction.
Reading the word from memory at the address in AR, and placing it on the
common bus, allows the indirect address (from the 12 least significant bits of
the memory word) to be loaded into AR. This process ensures that the
effective address is properly retrieved.
9. **Return to Fetch Phase:** Control returns to the "Fetch" phase with timing
signal T0 activated, and the process continues to fetch, decode, and execute
the next instruction in the program.
This detailed process ensures that the control unit correctly identifies the type
of instruction and handles it accordingly during the instruction cycle. The
control unit's actions are synchronized with the timing signals and the
sequence counter SC to maintain the proper sequence of instructions.
Certainly! Here are detailed notes on the memory-reference instructions
discussed in the provided passage:
**Memory-Reference Instructions:**
Memory-reference instructions are a type of instructions in a computer
architecture that involve accessing memory. These instructions are specified in
terms of register transfer notation to define their precise function.
- Control Function:
- Uses operation decoder D0 when the instruction's AND operation has a
binary code value of 000.
- Execution:
- Timing signal T4: Operand is transferred from memory to DR.
- Timing signal T5: Result of AND logic operation between DR and AC is
transferred to AC, and SC is cleared.
2. **ADD (D1):**
- Symbolic Description: `AC ← AC + M[AR], E ← Cout`
- Microoperations:
- D1T4: Data read from memory to DR.
- D1T5: Perform addition between AC and DR, store the result in AC,
transfer the carry (Cout) to E, and clear SC.
- Control Function:
- Uses operation decoder D1.
- Execution:
- Timing signal T4: Operand is transferred from memory to DR.
- Timing signal T5: Result of addition between DR and AC is transferred to
AC, Cout is transferred to E, and SC is cleared.
3. **LDA (D2):**
- Symbolic Description: `AC ← M[AR]`
- Microoperations:
- D2T4: Data read from memory to DR.
- D2T5: Transfer the content of DR to AC and clear SC.
- Control Function:
- Uses operation decoder D2.
- Execution:
- Timing signal T4: Operand is transferred from memory to DR.
- Timing signal T5: Content of DR is transferred to AC, and SC is cleared.
4. **STA (D3):**
- Symbolic Description: `M[AR] ← AC`
- Microoperations:
- D3T4: Transfer the content of AC to memory at the effective address (AR)
and clear SC.
- Control Function:
- Uses operation decoder D3.
- Execution:
- Timing signal T4: Content of AC is written to memory at the effective
address (AR), and SC is cleared.
These instructions involve precise sequences of microoperations to execute
and manipulate data between the memory and registers in the computer
architecture. The control functions and microoperations are determined by the
specific operation decoder output associated with each instruction.
Certainly! The passage you provided describes the organization and execution
of memory-reference instructions in a computer architecture. Let's break down
the key points step by step:
**Sequence of Microoperations:**
- To execute these memory-reference instructions, a sequence of
microoperations is required. Microoperations are fundamental operations that
manipulate data within the computer's registers.
- The reason for using a sequence of microoperations is that data stored in
memory cannot be directly processed. Instead, it must be read from memory
and transferred to a register where it can be manipulated using logic circuits.
- The passage provides detailed explanations for each instruction, including the
microoperations involved in their execution. These microoperations are
performed during specific timing signals.
- For example, for the "AND" instruction (D0), it specifies two microoperations
during timing signals T4 and T5 to read data from memory, perform the AND
operation, and update the accumulator (AC) register.
- The control functions that determine which microoperations to execute are
based on the decoded output signal (Di) associated with each instruction. For
instance, the control function for the "AND" instruction uses operation
decoder D0.
- Each instruction follows a specific sequence of microoperations, which are
coordinated by the control logic based on the instruction's decoded output.
**Flowchart:**
- The passage mentions the existence of a flowchart that summarizes all the
microoperations. Unfortunately, the flowchart is not provided in the text, but it
would likely illustrate the sequence of microoperations and how they are
controlled and coordinated during the execution of memory-reference
instructions.
2. **Microprogrammed Control:**
- Microprogramming is an alternative method for designing the control unit
of a digital computer.
- It involves using microinstructions to systematically control sequences of
microoperations.
- CPUs with microprogrammed control include Intel 8080, Motorola 68000,
and many CISC (Complex Instruction Set Computer) CPUs.