2 Register Transfer And Microoperations

Computer Architecture ยท Unit 2 ยท 5 hrs

Register Transfer and Microoperations

Exam-focused notes for Register Transfer and Microoperations (Computer Architecture, CSC213): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.

Register Transfer and Microoperations in short

A computer instruction is carried out as a sequence of small hardware-level actions on the data held in registers. This chapter names those actions, the notation used to write them down, and the arithmetic, logic and shift circuits that implement them.

Register Transfer and Microoperations: notes

Microoperation

A microoperation is an elementary operation performed directly on the data stored in one or more registers, such as add, subtract, shift, load, clear or complement. A machine instruction is executed as a small sequence of microoperations, one or a few per clock cycle, rather than as a single indivisible hardware action.

Register Transfer Language

Register transfer language (RTL) is the symbolic notation used to describe the microoperations carried out on register contents and the transfers of information between registers. Computer registers are denoted by capital letters that suggest their function, for example PC for the program counter and IR for the instruction register, and the individual flip-flops of an $n$-bit register are numbered $0$ to $n-1$. The basic RTL symbols are:

SymbolMeaningExample
Capital letters/numeralsDenotes a register$MAR$
ParenthesesDenotes a part (range) of a register$R2(0\text{-}7)$
Arrow $\leftarrow$Denotes transfer of information$R2 \leftarrow R1$
CommaSeparates two microoperations executed at the same clock edge$R2 \leftarrow R1,\ R1 \leftarrow R2$

Register Transfer

The statement $R2 \leftarrow R1$ means the content of R1 is transferred into R2 without changing R1; it implies a physical path from R1's output to R2's input, and that R2 has parallel-load capability enabled on the next active clock edge, with all microoperations on the same line taking place simultaneously. Rather than wiring every register directly to every other register, a computer connects its registers through a shared common bus, so that any one of several source registers is selected onto the bus and loaded into a destination register. A common bus is built from multiplexers (an $n$-line bus needs one $n$-to-1 MUX per bit, sharing register-select lines across all of them) or from three-state buffers (a buffer outputs its input when its control line is 1, and floats to high impedance when it is 0, so many buffer outputs can share one bus line safely).

Control Function

A control function attaches a condition to a microoperation, so that the transfer happens only when a specified Boolean condition, generated by control logic, is true, much like an if-statement. If register transfer $R2 \leftarrow R1$ should occur only when control signal $P=1$, it is written $P:\ R2 \leftarrow R1$, read "if $P=1$ then $R2 \leftarrow R1$"; when $P=0$, no transfer occurs and the registers keep their existing content.

What this unit covers

  • Microoperation
  • Register Transfer Language
  • Register Transfer
  • Control Function
  • Arithmetic Microoperations: Binary Adder, Binary Adder-subtractor, Binary Incrementer, Arithmetic Circuit
  • Logic Microoperations
  • Hardware Implementation
  • Applications of Logic Microoperations
  • Shift Microoperations: Logical Shift, Circular shift, Arithmetic Shift, Hardware Implementation of Shifter

Shift Microoperations

2081 ยท 5 marks

Explain different types of shift microoperations. [5]

Shift microoperations are used for the transfer of data in a register, and are used in conjunction with arithmetic, logic, and other data processing operations. The content of a register can be shifted to the left or right. --- There are three main types of shift microoperations: --- A logical sh...

Open this answer on its own page โ†’

Arithmetic Microoperations

2080 ยท 5 marks

What is micro operation? Explain different arithmetic microoperations. [5]

Show solved answer

Micro Operation and Arithmetic Micro Operations

What is Micro Operation? (1 mark)

Micro operation is an elementary operation performed on data stored in registers. It is the basic operation executed on the data held in one or more registers during a single clock pulse.

Example: add, subtract, load, store, clear, shift, etc.

In Register Transfer Language (RTL), a micro operation is expressed as:

R1 โ† R1 + R3

This means the contents of R1 and R3 are added and the result is stored back in R1.


Arithmetic Micro Operations (4 marks)

Arithmetic micro operations perform basic arithmetic operations on numeric data stored in registers. The common arithmetic micro operations are:


1. Addition

The contents of two registers are added and the result is stored in a destination register.

RTL notation:

R3 โ† R1 + R2

Example:

R1 = 1010
R2 = 0101
R3 = 1111

2. Subtraction

The contents of one register are subtracted from another. This is typically implemented using 2's complement addition.

RTL notation:

R3 โ† R1 - R2

Which is equivalent to:

R3 โ† R1 + (2's complement of R2)
     = R1 + R2' + 1

Example:

R1 = 1010  (10)
R2 = 0011  (3)
R3 = 0111  (7)

3. Increment

The content of a register is increased by 1.

RTL notation:

R1 โ† R1 + 1

Example:

R1 = 1010  โ†’  R1 = 1011

4. Decrement

The content of a register is decreased by 1.

RTL notation:

R1 โ† R1 - 1

Example:

R1 = 1010  โ†’  R1 = 1001

5. Multiplication

The contents of two registers are multiplied and the result is stored in a destination register.

RTL notation:

R3 โ† R1 * R2

6. Division

The content of one register is divided by another.

RTL notation:

R3 โ† R1 / R2

7. Negation (2's Complement)

The value in a register is negated (sign is changed) using 2's complement.

RTL notation:

R1 โ† R1' + 1

Example:

R1 = 0101 (5)  โ†’  R1 = 1011 (-5 in 2's complement)

Summary Table

OperationRTL NotationDescription
AdditionR3 โ† R1 + R2Sum of two registers
SubtractionR3 โ† R1 - R2Difference of two registers
IncrementR1 โ† R1 + 1Add 1 to register
DecrementR1 โ† R1 - 1Subtract 1 from register
MultiplicationR3 โ† R1 * R2Product of two registers
DivisionR3 โ† R1 / R2Quotient of two registers
NegationR1 โ† R1' + 12's complement of register

Note: The arithmetic circuit for these operations is implemented using full adders, where the output is computed as: D = A + Y + Cin, and the function is selected by control inputs.

Open this answer on its own page โ†’

2079 ยท 5 marks

Explain the binary adder-subtractor circuit with suitable diagram. [5]

Show solved answer

Binary Adder-Subtractor Circuit

Introduction

A binary adder-subtractor is a combinational circuit that can perform both addition and subtraction of binary numbers using a single circuit, controlled by a mode select input.


Working Principle

The circuit uses the concept of 2's complement subtraction:

A - B = A + (2's complement of B) = A + (1's complement of B) + 1

  • When Mode M = 0 โ†’ Circuit performs Addition: A + B
  • When Mode M = 1 โ†’ Circuit performs Subtraction: A - B (i.e., A + B' + 1)

The key component used is the XOR gate:

MBiXOR Output (M โŠ• Bi)
000 (passes B unchanged)
011 (passes B unchanged)
101 (complements B)
110 (complements B)

So when M = 1, each bit of B is complemented (1's complement), and M = 1 is also fed into the carry-in (C0) of the first Full Adder, which adds 1, completing the 2's complement.


Circuit Diagram (4-bit Adder-Subtractor)

        B3      A3    B2      A2    B1      A1    B0      A0
        |       |     |       |     |       |     |       |
       XOR      |    XOR      |    XOR      |    XOR      |
        |  M----+     |  M----+     |  M----+     |  M----+---> C0 (Carry In)
        |       |     |       |     |       |     |       |
       FA  <--C3     FA  <--C2     FA  <--C1     FA  <-- M
        |             |             |             |
        S3            S2            S1            S0

Diagram:

B3 A3    B2 A2    B1 A1    B0 A0
 |  |     |  |     |  |     |  |
 C3 FA   C2 FA   C1 FA   C0 FA  <-- C0 = M
  |        |        |        |
  S3       S2       S1       S0

Each stage consists of a Full Adder (FA) where:

  • One input is Ai
  • Other input is M โŠ• Bi (XOR of mode bit and Bi)
  • Carry ripples from stage to stage
  • Initial carry C0 = M

Operation Summary

Mode (M)OperationExpression
M = 0AdditionS = A + B, C0 = 0
M = 1SubtractionS = A + B' + 1 = A - B, C0 = 1

Overflow Condition

While adding two n-bit binary numbers, the result may be a number with (n+1) bits -- this situation is called overflow.

In the adder-subtractor, overflow can be detected by checking if the final carry out is inconsistent with the sign bits of the operands.


Conclusion

The binary adder-subtractor efficiently combines addition and subtraction in one circuit using XOR gates and Full Adders, with the mode input M controlling the operation. This reduces hardware complexity significantly compared to having separate adder and subtractor circuits.

Open this answer on its own page โ†’

Register Transfer Language

2079 ยท 5 marks

What do you mean by Register Transfer Language? Explain the use of Register Transfer Language control function. [5]

--- Register Transfer Language (RTL) is a symbolic notation used to describe the microoperations and the transfer of data among registers in a digital computer system. - A microoperation is an elementary operation performed on data stored in registers (e.g., add, subtract, load, store, clear, shi...

Open this answer on its own page โ†’

2077 ยท 5 marks

Explain register transfer language with example. [5]

Register Transfer Language (RTL) is a symbolic notation used to describe the micro-operations and data transfers that occur among registers in a digital computer. It provides a concise and formal way to express how data moves between registers and what operations are performed on that data. --- C...

Open this answer on its own page โ†’

Logic Microoperations

2075.1 ยท 6 marks

Explain the logic micro instructions with practical example. [6]

Logic micro-instructions are a category of micro-operations (micro-instructions) that perform bit-wise logical operations on the data stored in registers of a computer. They operate on individual bits of operands using Boolean logic functions such as AND, OR, NOT (complement), XOR, etc. In a micr...

Open this answer on its own page โ†’