Lec 3 RTL
Lec 3 RTL
DCS114/SSS114
DSE114/CSE114
LECTURE 3
BY
Mr. Bagaiga Richard
Email: [email protected]
1
Introduction
3
The internal hardware organization of a digital computer is best defined by specifying
1. The set of registers it contains and their function.
2. 2. The sequence of micro operations performed on the binary information stored in
the registers.
3. 3. The control that initiates the sequence of micro operations
5
Registers are denoted by capital letters and are sometimes followed by numerals, e.g.,
■ MAR – Memory Address Register (holds addresses for the memory unit)
■ PC – Program Counter (holds the next instruction’s address)
■ IR – Instruction Register (holds the instruction being executed)
■ R1 – Register 1 (a CPU register)
We can indicate individual bits by placing them in parentheses, e.g., PC(8-15), R2(5),
etc.
6
■ The most common way to represent a register is by a rectangular box with the name of the
register inside,The individual bits can be distinguished as in (b).
■ The numbering of bits in a 16-bit register can be marked on top of the box as shown in (c). A
16-bit register is partitioned into two parts in (d). Bits 0 through 7 are assigned the symbol L
(for low byte) and bits 8 through 15 are assigned the symbol H (for high byte). The name of the
16-bit register is PC. The symbol PC (0−7) or PC(L) refers to the low-order byte and PC(8−15) or
PC(H) to the high-order byte.
Register Transfer micro-operations
■ Register Transfer R2 ← R1
■ Simultaneous Transfer R2← R1, R1 ← R2
Normally, we want the transfer to occur only under a predefined control condition using the
if then statement :
We are calling these control functions
8
Basic Symbols For Register Transfer
9
Memory Transfer
There are two primary operations involving memory:
■ Read – transferring data from memory
■ Write – transferring data into memory
to indicate in Register Transfer Language that we are moving data from a memory
address to the data register, we write:
Read: DR ← M[AR]
To indicate in RTL that we are moving data from Register 1 to a memory location,
we write:
Write: M[AR] ← R1
10
Arithmetic Micro-Operations
■ Some of the basic micro-operations are addition, subtraction, increment and
decrement.
In an add micro-operation The above statement instructs the data or contents of
register R1 to be added to data or content of register R2 and the sum should be
transferred to register R3.
R1 + R2 → R3
13
Applications of logic micro operations
From the truth table we note that the bits of A after the operation are obtained from the
logic-OR operation of bits in B and previous values of A. therefore, the OR micro
operation can be used to selectively set bits of a register
Selective -complement
The selective-complement operation complements bits in A where there are corresponding
1’s in B. It does not affect bit positions that have 0’s in B. For example:
Again the two leftmost bits of B are 1’s, so the corresponding bits of A are complemented.
This example again can serve as a truth table from which one can deduce that the
selective-complement operation is just an exclusive-OR micro operation. Therefore, the
exclusive-OR micro operation can be used to selectively complement bits of a register
Selective -clear
■ The selective-clear operation clears to 0 the bits in A only where there are corresponding
1’s in B. or example
■ Again the two leftmost bits of B are 1’s, so the corresponding bits of A are cleared to 0.
One can deduce that the Boolean operation performed on the individual bits is AB’. The
corresponding logic micro operation is A ← A ∧ B’
Shift Micro-operations
Shift micro-operations are used for serial transfer of data and are used in conjunction with
arithmetic and logic operations.
The register contents can be shifted to the left or to the right.
There are three types of shift operations:
■ Logical shifts
A logical shift is one that transfers 0 through the serial input. We will adopt the symbols shl and shr
for logical shift-left and shift-right micro-operations Arithmetic shifts multiplies (or divides) a signed
number by 2.
■ Circular shifts
(also known as a rotate operation) circulates the bits of the register around the two ends without
loss of information. This is accomplished by connecting the serial output of the shift register to its
serial input. We will use the symbols cil and cir for the circular shift left and right, respectively.
19
■ An arithmetic shift
is a micro operation that shifts a signed binary number to the left or right. An arithmetic shift-
left multiplies a signed binary number by 2.
An arithmetic shift-right divides the number by 2. Arithmetic shifts must leave the
sign bit unchanged because the sign of the number remains the same when it is
multiplied
The arithmetic shift-left inserts a 0 into R0, and shifts all other bits to the left.
Shift Micro-operations