RTL
RTL
RTL
Overview
Register Transfer Language
Register Transfer
Logic Micro-operations
Shift Micro-operations
Basic Definitions
Digital system is a collection of digital hardware modules Modules are registers, counters, arithmetic elements, etc connected via: - data paths routes on which information is moved - control paths routes on which control signals are moved Micro operations (micro-ops) are operations on data stored in registers. The result may be transferred to another register or may replace the previous binary information of the register. Digital modules (often just called registers) are defined by their information contents and the set of micro-ops they perform Register transfer language is a concise and precise means of describing those operations
collection of registers that perform data processing Control unit module is made up of logic that determines the sequence of data processing operations carried out in the data-path
upper case letters, and optionally followed by digits or letters {MAR(Memory Address Register),
PC(Program Counter), IR(Instruction Register), R1(Processor Register)}
Register transfer
operations: the movement of data stored in2registers and the R R1 processing performed on the data.
(transfer of the content of register R1 into
CPU organization in high-level terms RTL expressions are made up of elements which describe the registers being manipulated, and the micro-ops being performed on them Here are the basic components of RTL expressions:
Instruction Representation
Word size is 16 bits 12 bits to represent a memory address 3-bit opcode 1 bit to distinguish between direct and indirect memory addressing
is 0, the value in AD is the actual address of the operand (direct addressing) When I is 1, contains the address of an indirect word, which in turn will contain the actual operand address (indirect addressing)
Register Structure
Common Micro-Ops
There are 4 types of Micro-Ops: Transfer: transfers data from one register to another R0 <- R1
Arithmetic: performs arithmetic on data in registers
R0 <- R1 + R2
Logic/bit manipulation: performs bit (Boolean) operations on
16 : 1 mux
Bus Transfer The content of register C is placed on the bus, and the content of the bus is loaded into register R1 by activating its load control input of the destinationBus Bus C , R1 register.
R1 C
Three-State Bus Buffers A bus system can be constructed with three-state gates instead of multiplexers Tri-State : 0, 1, High-impedance(Open circuit) Buffer
A device designed to be inserted between other devices to match impedance, to prevent mixed interactions, and to supply additional drive or relay capability Buffer types are classified as inverting or noninverting When control input =1 : The outputIfis enabled(output Y = input A) Normal C=1, Output Y = A input A input =0 : The output is disabled(output Y = highWhen control If C=0, Output = High-impedance impedance) Control
input C
Fig. 4-5
The outputs of four buffer are connected together to form a single
bus line(Tri-state buffer No more than one buffer may be in the active state at any given time(2 X 4 Decoder To construct a common bus for 4 register with 4 bit : (register decoderbuffer)
Overview
Register Transfer Language
Register Transfer
Logic Micro-operations
Shift Micro-operations
Memory - RAM
Memory (RAM) can be thought as a sequential circuits containing some number of registers These registers hold the words of memory Each of the r registers is indicated by an address These addresses range from 0 to r-1 Each register (word) can hold n bits of data Assume the RAM contains r = 2k words. It needs the following data input lines 1. n data input lines n 2. n data output lines address lines 3. k address lines k RAM Read 4. A Read control line unit Write 5. A Write control line
n data output lines
Memory Transfer
Memory is usually accessed in computer systems by putting the desired address in a special register, the Memory Address Register (MAR, or AR)
M
AR Memory unit Read Write Data in
Data out
Memory read : A transfer information into DR from the memory word M selected by the address in AR RTL expressions for a write operation, assuming use of a data register:
AR <- address DR <- value M[AR] <- DR Memory Write : A transfer information from R1 into the memory word M selected by the address in AR
A constant
ABUS R1, R2 ABUS time, AR DR M[R] M DR M
M DR
MICROOPERATIONS
Computer system microoperations are of four types: Register transfer microoperations Arithmetic microoperations Logic microoperations
Shift microoperations
Arithmetic MICROOPERATIONS
The basic arithmetic microoperations are
Addition Subtraction Increment Decrement
Binary Adder
Binary Adder
B3 FA
A3 C3
B2 FA
A2 C2
B1 FA
A1 C1
B0 FA
A0 C0
C4
S3
S2
S1
S0
Binary Adder-Subtractor
Binary Adder-Subtractor
B3 A3 B2 A2 B1 A1 B0 A0
FA
C3
FA
C2
FA
C1
FA
C0
C4
S3
S2
S1
S0
The mode input M controls the operations. When M=0 the circuit is an adder and when M=1 the circuit becomes a subtractor. When M=0 we have B 0 = B the circuit performs A plus B. When M=1 we have B 1 =B` and C0=1 . The B inputs are than complemented and a 1 is added through the input carry. So, the operation becomes A plus 2s complement of B.
Binary Incrementer
Binary Incrementer
A3 A2 A1 A0 1
y S
y S
y S
y S
HA
C
HA
C
HA
C
HA
C
C4
S3
S2
S1
S0
Arithmetic Circuits
S1 S0 A0 S1 S0 B0 0 1 2 3 X0 C0 D0
4x1 MUX
Y0
FA C1
C1
A1
S1 S0 B1 0 1 2 3
X1
4x1 MUX
Y1
FA
D1
C2
A2 S1 S0 B2 0 1 2 3
X2
C2
4x1 MUX
Y2
FA
D2
C3
A3 S1 S0 B3 0 1 2 3 0 1
X3
C3 D3
MUX
4x1
Y3
FA
C4 Cout
The basic component of an arithmetic circuit is parallel adder. By controlling data inputs, it is possible to have different operations.
and decrement operations in its ALU (arithmetic-logic unit). Logic micro-ops are like arithmetic, but treat each bit of the register(s) separately
The selective-set operation sets to 1 the bits in register A where there are corresponding 1s in register B. It does not effect bit positions that have 0s in B
A A B
Selective-complement
The selective-complement operation complements bits in A where there are corresponding 1s in B. It does not effect bit positions that have 0s in B
Selective-clear A B A
The selective-clear operation clears to 0 the bits in A only where there are corresponding 1s in B A Selective-mask A B The mask operation is similar to the selective-clear operation except that the bits of A are cleared only where there are corresponding 0s in B
Insert
The insert operation inserts a new value into a group of bits This is done by first masking the bits and then ORing them with the required value
Clear
The clear operation compares the words in A and B and produces an all 0s result if the two numbers are equal
Micro-Ops Shift
Move the information in a register by one bit position Shifts come in three varieties:
Shift Microoperations
There are three types of shifts
Logical shift Circular shift Arithmetic shift
What differentiates them is the information that goes into the serial input A right shift operation
Serial input
Serial input
Logical Shift
In a logical shift the serial input to the shift is a 0. A right logical shift operation:
0
Circular Shift
In a circular shift the serial input is the bit that is shifted out of the other end of the register.
Arithmetic Shift
An arithmetic shift is meant for signed binary numbers (integer) An arithmetic left shift multiplies a signed number by two An arithmetic right shift divides a signed number by two The main distinction of an arithmetic shift is that it must keep the sign of the number the same as it performs the multiplication or division
Arithmetic Shift
An left arithmetic shift operation must be checked for the overflow
0
sign bit
Before the shift, if the leftmost two bits differ, the shift will result in an overflow
S 0 1 A0 A1 A2 A3 S 0 1 MUX H1
MUX
H0
S 0 1 MUX H2
operational unit which consists of various storage registers known as ALU. It performs an operation and the result of the operation is then transferred to a destination register. The ALU is combinational circuit so that the entire register transfer from register to the other register via ALU can be performed in one clock cycle.
Arithmetic Circuit
Select 0 C i+1 1 2 3
4x1 MUX
Logic
Bi A i
Circuit
shr
A
A
i-1 i+1
shl
S3 S2 S1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 X 1 1 X
S0 0 0 1 1 0 0 1 1 0 1 0 1 X X
Cin 0 1 0 1 0 1 0 1 X X X X X X
Operation F=A F=A+ 1 F=A+ B F=A+ B+ 1 F = A + B F = A + B+ 1 F=A- 1 F=A F=A B F=AB F=A B F = A F = shr A F = shl A
Thank you