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.
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]
Arithmetic Microoperations
2080 ยท 5 marks
What is micro operation? Explain different arithmetic microoperations. [5]
Show solved answerHide 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
| Operation | RTL Notation | Description |
|---|---|---|
| Addition | R3 โ R1 + R2 | Sum of two registers |
| Subtraction | R3 โ R1 - R2 | Difference of two registers |
| Increment | R1 โ R1 + 1 | Add 1 to register |
| Decrement | R1 โ R1 - 1 | Subtract 1 from register |
| Multiplication | R3 โ R1 * R2 | Product of two registers |
| Division | R3 โ R1 / R2 | Quotient of two registers |
| Negation | R1 โ R1' + 1 | 2'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.
2079 ยท 5 marks
Explain the binary adder-subtractor circuit with suitable diagram. [5]
Show solved answerHide 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:
| M | Bi | XOR Output (M โ Bi) |
|---|---|---|
| 0 | 0 | 0 (passes B unchanged) |
| 0 | 1 | 1 (passes B unchanged) |
| 1 | 0 | 1 (complements B) |
| 1 | 1 | 0 (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) | Operation | Expression |
|---|---|---|
| M = 0 | Addition | S = A + B, C0 = 0 |
| M = 1 | Subtraction | S = 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.
Register Transfer Language
2079 ยท 5 marks
What do you mean by Register Transfer Language? Explain the use of Register Transfer Language control function. [5]
2077 ยท 5 marks
Explain register transfer language with example. [5]
Logic Microoperations
2075.1 ยท 6 marks
Explain the logic micro instructions with practical example. [6]
Make Unit 2 stick
Practice CSC213 with flashcards & quizzes