A computer needs an orderly sequence in which one thing happens after another. The timing and control unit supplies that order, and the instruction set describes everything the computer can be told to do.

Instruction Types

The basic computer has three kinds of instruction. A memory-reference instruction has an opcode from 000 to 110 and works on a word in memory. A register-reference instruction has the opcode 111 with I = 0, and operates on the registers only. An input-output instruction has the opcode 111 with I = 1 and transfers data to or from a device. Table 3.2 gives the three kinds.

Table 3.2: Types of instructions in the basic computer

Opcode I Type of instruction
000 to 110 0 or 1 Memory-reference
111 0 Register-reference
111 1 Input-output

Register-Reference Instructions

Register-reference instructions are coded by one bit set in the lower twelve bits. Examples are CLA (clear AC), CMA (complement AC), INC (increment AC), CIR and CIL (circulate right and left), and HLT (halt). For example CLA has the hexadecimal code 7800 and HLT has 7001.

The bit positions are fixed, so the control unit needs no extra decoding to recognise them. Bit 0 is HLT, bit 1 is SZE, bit 2 is SZA, bit 3 is SNA, bit 4 is SPA, bit 5 is INC, bit 6 is CIL, bit 7 is CIR, bit 8 is CME, bit 9 is CMA, bit 10 is CLE and bit 11 is CLA. Since only one bit is set in an instruction, twelve register-reference instructions can be coded in the lower twelve bits.

Timing and Control

The control unit produces timing signals with a sequence counter (SC), a 4-bit counter. A decoder converts the count into the timing signals T0 to T15, and only one is active at a time. The counter is cleared at the end of each instruction so that a new one begins at T0. The opcode, after decoding, gives the signals D0 to D7. The control functions are the combination of the timing signals and the decoded instruction, for example D3T4.

Definition: Control unit. The part of the processor that generates the timing and control signals which direct the transfer of data and the operations needed to execute each instruction.

Example 3.2: Forming a control function

Problem: The instruction STA has opcode 011. State the timing and decoder signals that control it.

Solution:

  1. The opcode 011 is the decimal value 3, so the decoder output D3 is active.
  2. STA needs one step to store the accumulator after the address has been prepared, and this occurs at T4.
  3. The control function is therefore D3T4.

Result: STA is controlled by the signal D3T4.

Common mistakes

  • Treating all opcodes of 111 as register-reference. The mode bit I must be checked.
  • Forgetting to clear the sequence counter after the last step of an instruction.
  • Believing that several timing signals are active at the same time.

Key takeaways

  • Opcode 111 with I = 0 is register-reference; with I = 1 it is input-output.
  • The sequence counter and decoder produce the signals T0 to T15.
  • The decoded opcode produces D0 to D7.
  • Control functions combine D signals with T signals.

Practice questions

  1. What is the code type of CMA?
  2. What does the sequence counter do?
  3. Which signal controls the first step of STA?

Answers to the practice questions

  1. Register-reference.
  2. It counts the timing steps, and a decoder converts the count into the signals T0 to T15.
  3. D3T4.

Sources

  • Official BCA syllabus Computer Architecture, course code 25BCA401DS02, Unit III