register transfer language (rtl) basic symbols. today’s outline register transfer language ◦...
TRANSCRIPT
REGISTER TRANSFER REGISTER TRANSFER LANGUAGE (RTL)LANGUAGE (RTL)BASIC SYMBOLS
Today’s OutlineToday’s OutlineRegister Transfer Language
◦Type of Registers◦Basic Symbols◦Register Transfer◦Arithmetic Microoperations
HIGH LEVEL LANGUAGEExample : C+, VB, JAVA
ASSEMBLY LANGUAGEExample : uP and uC
OPCODE
MICROCODE
Mircocode (Micro-operations):Operations executed on data stored in registers, performed in one clock cycle
Register Transfer Language (RTL):Symbolic notation used to describe micro-operations
Register Transfer Register Transfer Language (RTL)Language (RTL)
RTL• to represent registers• specify the operations on their contents
RTL• Is an algebraic notation used to define machine level
operations• It is not executed by a computer• It is used to explain how the computer works.
Example:
In 68000 assembly language instruction ADD #3, D2
is define in RTL as [D2] [D2] + 3
Register Transfer LanguageRegister Transfer Language(RTL)(RTL)
Types of RegistersTypes of RegistersAR : Address Registers
◦A register holds an address for memory unit
DR: Data RegistersPC : Program CounterIR : Instruction RegisterRn : n indicates the Register
number◦e.g. R2 is Register 2
Block Diagram of Block Diagram of RegistersRegisters
R
PC(H)
Register
16 bit Register
7
8 bit Register
6 5 4 3 2 1 0
Bit 7 Bit 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Bit 16 Bit 0
PC(L)
8 bit = 1 byte
H = High order byte L = Low order byte
PC(H) = PC(15:8) PC(L) = PC(7:0)
BASIC SYMBOLSBASIC SYMBOLS
R followed by a number is referring to a register:
R2 = second register/register no 2
R2
BASIC SYMBOLSBASIC SYMBOLS M refers to Memory with
addresses in square braces:
Direct Addressing : M[10] = contents of memory address
10
In this example, M[10] refers to 10111011
100000001011101111111111
91011
Address Content
MEMORY
BASIC SYMBOLSBASIC SYMBOLSIn-direct Addressing :M[R3] = content of the memory
address in R3
100000001011101111111111
151617
Address Content
MEMORY
100000000000011000001111
123
Address Content
REGISTER
00001111= 15
Ans : M[R3] refers to 10000000
BASIC SYMBOLSBASIC SYMBOLS
Arrow pointing to the right shows transfer of data :
R4 R3 = Stores the value of R3 into R4
• The word transfer is misleading, since it implies that data is moved from one location to another. In fact, the data is copied from one location to another since it also still resides in register R3=> Contents of the source REG do not change,
Only change the contents of destination REG
Destination Source
BASIC SYMBOLSBASIC SYMBOLS A comma represents simultaneous transfer:
R1 R2, R6 R7
Stores R2 into R1 and at the same time stores R7 into R6.
BASIC SYMBOLSBASIC SYMBOLS A colon indicates the termination of function:
K: R1 R2If K=1, then stores R2 into R1.
K1K2’: R3 R2If K=1 and K2=0, then stores R2
into R3.K: a control signal generated in the control unit, 0 or 1
BASIC SYMBOLSBASIC SYMBOLS
Parenthesis (bracket) indicates part of the register.
R8(1) = bit 1of R8
R8
7 6 5 34 2 1 0
1 0 1 11 0 0 0
Bit Position
Content
MSB LSB
LSB : Least Significant BitMSB : Most Significant Bit
BASIC SYMBOLSBASIC SYMBOLS
Parenthesis indicates part of the register.
R3(7:0) = the least significant byte of R3
Note : 1 byte = 8 bit
R3
7 6 5 34 2 1 0
1 0 1 11 0 0 0
14..915 8
10..1
SummarySummarySymbol Description Example
Square brackets Specifies an address for memory
M[R2]
Capital Letters & Numerals
Denotes a register AR, IR, PC, R2
Parentheses Denotes part of a register
R2(1), R2(7:0), PC(L)
Arrow Denotes Transfer of data R1 R2
Colon Denotes termination of control function
K:
Comma Separates simultaneous transfers
R1 R2, R3 R2
10 minutes break…
ARITHMETIC ARITHMETIC MICROOPERATIONSMICROOPERATIONSThe basic arithmetic
microoperations are◦Addition◦Subtraction◦Increment◦Decrement
The additional arithmetic microoperations are◦Add with carry◦Subtract with borrow◦Transfer/Load◦etc. …
Arithmetic Microoperations
MATHEMATICAL AND LOGICAL MATHEMATICAL AND LOGICAL SYMBOLSSYMBOLS Addition is indicated by the +
sign:
R1 R2+R3Add R2 and R3, stores in R1
R2 R4+R1Add R4 and R1, stores in R2
Example 1 :
Example 2 :
MATHEMATICAL AND LOGICAL MATHEMATICAL AND LOGICAL SYMBOLSSYMBOLSSubtraction is handled not with
the minus sign but with complementing.
1’s complement :
2’s complement :
R5 R3+R4
R5R3+R4+1
Note : Computers use the 2’s complement for negative integer numbers in all arithmetic operations.
+ Addition
- Subtraction
* Multiplication
/ Division
Example: R2 R1+R2
Example: R2 R1+R2’+1
Example: R2 R1*R2
Example: R2 R1/R2
ARITHMETIC ARITHMETIC MICROOPERATIONSMICROOPERATIONS
Summary of Typical Arithmetic Microoperations(Page 547)
Arithmetic Microoperations
ARITHMETIC ARITHMETIC MICROOPERATIONSMICROOPERATIONS
Note : Any register may be specified for source 1, source 2, or destination.
REGISTER TRANSFER REGISTER TRANSFER LANGUAGELANGUAGEREGISTER TRANSFERS
A little bit revision…A little bit revision…
MICROOPERATIONSMICROOPERATIONS
Microoperations - The operations performed on data stored in registers or in memory.
The functions built into registers are examples of microoperations◦Shift◦Load◦Clear◦Increment◦…
Microoperations
MICROOPERATIONSMICROOPERATIONSThe microoperations most often encountered in digital systems are of four types:
Register transfer microoperations◦ Transfer binary data from one REG to another
Arithmetic microoperations◦ Perform arithmetic on data in REG
Logic microoperations◦ Perform bit manipulation on data in REG
Shift microoperations◦ Shift data in REG
Microoperations
REGISTER TRANSFERREGISTER TRANSFER
Copying the contents of one register to another is a register transfer.
A register transfer is indicated as
R2 R1
◦ In this case the contents of register R1 are copied (loaded) into register R2.
◦ A simultaneous transfer of all bits from the source R1 to the destination register R2, during one clock pulse.
◦ Note that this is a non-destructive; i.e. the contents of R1 are not altered by copying (loading) them to R2
Register Transfer
REGISTER TRANSFERREGISTER TRANSFER
A register transfer such as
R3 R5
Implies that the digital system has◦ the data lines from the source register (R5)
to the destination register (R3)◦ Parallel load in the destination register (R3)
All bits are loaded simultaneously on clock pulse (same source)
◦ Control lines to perform the action Control the transfer or clock cycles
Register Transfer
CONDITIONAL REGISTER TRANSFERCONDITIONAL REGISTER TRANSFER
Conditional Statement◦Using control signal to control the
transfer◦Can be symbolized by if-then statement
if (K1 = 1) then (R2 R1)
◦In RTL we can write it as:K1 : R2 R1
The transfer operation be executed only if K1=1
A subscripted letter followed by a colon is a conditional
Register Transfer
K1: control signal
CONDITIONAL REGISTER TRANSFERCONDITIONAL REGISTER TRANSFER
R2R1
K1
CLK
n
K1
CLK
Transfer occurs here
n = no of lines = no of bits
Transfer occurs in parallel
K1 : R2 R1
Register Transfer
Load control input
K1 :R5 R2
CONDITIONAL REGISTER TRANSFERCONDITIONAL REGISTER TRANSFER
Content of R2 will be stored in R5 when condition K1 occurs
R5
R2
K1
Example:
Register Transfer
SIMULTANEOUS OPERATIONSSIMULTANEOUS OPERATIONS
If two or more operations are to occur simultaneously, they are separated with commas
K: R3 R5, AR IR
If the control function K = 1, load the contents of R5 into R3, and at the same time (positive clock edge), load the contents of register IR into register AR
Register Transfer
COMPLEX LOGICAL SYMBOLSCOMPLEX LOGICAL SYMBOLS
Content of R5 will be stored in R4 only IF both condition K1 and condition K2 are true:
K1K2:R4 R5
Register Transfer
If K1=1 and K2=1, then stores R5 into R4
COMPLEX LOGICAL SYMBOLSCOMPLEX LOGICAL SYMBOLS
Content of R5 will be stored in R4 IFeither condition K1 or condition K2 weretrue, a + sign would be used:
(K1+K2) : R4 R5
NOTE: In (K1 + K2), “+” means “OR” In R1 ← R1 + R3, “+” means “plus”
Register Transfer
COMPLEX LOGICAL SYMBOLSCOMPLEX LOGICAL SYMBOLS
If – then – else is implemented with commas and multiple colons.
If K1 true, then stores R4 into R6, else if K2 true, then stores R5 into R6, else store R7 into R6.
K1 : R6 R4, K1K2 : R6 R5, K1K2: R6 R7
Register Transfer
1
O R 2