REGISTER TRANSFER LANGUAGE MICROOPERATIONS TODAY OUTLINES Logic Microoperations

  • Slides: 21
Download presentation
REGISTER TRANSFER LANGUAGE MICROOPERATIONS

REGISTER TRANSFER LANGUAGE MICROOPERATIONS

TODAY OUTLINES • Logic Microoperations • Shift Microoperations

TODAY OUTLINES • Logic Microoperations • Shift Microoperations

LOGIC MICROOPERATIONS

LOGIC MICROOPERATIONS

Logic Microoperations LOGIC MICROOPERATIONS � Specify binary operations on the strings of bits in

Logic Microoperations LOGIC MICROOPERATIONS � Specify binary operations on the strings of bits in registers ◦ Logic microoperations are bit-wise operations, i. e. , they work on the individual bits of data ◦ useful for bit manipulations on binary data ◦ useful for making logical decisions based on the bit value � The ◦ ◦ symbols for the four basic logic operations are: OR ( ), AND ( ), XOR ( ), Complement/NOT

LOGIC MICROOPERATIONS �v OR (SETS Bits) Example: R 3 R 4 v R 6

LOGIC MICROOPERATIONS �v OR (SETS Bits) Example: R 3 R 4 v R 6 � ^ AND (CLEARS Bits) Example: R 2 DR ^ R 1 � XOR (Complement Bits, 2 Sources) Example: � PC PC DR NOT (Complement Bits, 1 Source) Example: R 6 R 1

LOGIC MICROOPERATIONS Example: Let R 1 = 1010 and R 2 = 11110000 After

LOGIC MICROOPERATIONS Example: Let R 1 = 1010 and R 2 = 11110000 After the operations, R 0 becomes:

Logic Microoperations HARDWARE IMPLEMENTATION OF LOGIC MICROOPERATIONS Ai Bi 0 1 4 X 1

Logic Microoperations HARDWARE IMPLEMENTATION OF LOGIC MICROOPERATIONS Ai Bi 0 1 4 X 1 MUX Fi 2 3 Select S 1 S 0 Function table S 1 0 0 1 1 S 0 0 1 Output F=A B F = A B F=A B F = A’ -operation AND OR XOR Complement

APPLICATIONS OF LOGIC MICROOPERATIONS �Logic microoperations can be used to manipulate individual bits or

APPLICATIONS OF LOGIC MICROOPERATIONS �Logic microoperations can be used to manipulate individual bits or a portions of a word in a register �Logic microoperations can change bit values, clear a group of bits, or insert new bit values into a register.

AND microoperation �Used for clearing one or more bits in a register to 0.

AND microoperation �Used for clearing one or more bits in a register to 0. �Boolean equations: ◦X • 0=0 When ANDed with 0, binary variable X produces 0. ◦X • 1=X When ANDed with 1, binary variable X remains unchanged.

AND microoperation X • 0 = 0 Example: X • 1=X 10101101 10101011 R

AND microoperation X • 0 = 0 Example: X • 1=X 10101101 10101011 R 1 (data) 0000 1111 R 2 (mask) 0000 10101011 R 1 ^ R 1 : R 2 High-order byte = Clear Low-order byte = Unchanged AND operation: ◦ Selectively clear bits of a register

OR microoperation �Used to set one or more bits in a register. �Boolean equations:

OR microoperation �Used to set one or more bits in a register. �Boolean equations: ◦X+1=1 When ORed with 1, binary variable X produces a 1. ◦X+0=X When ORed with 0, binary variable X remains unchanged.

OR microoperation Example: X+1=1 X+0=X 10101101 10101011 R 1 (data) 1111 0000 R 2

OR microoperation Example: X+1=1 X+0=X 10101101 10101011 R 1 (data) 1111 0000 R 2 (mask) 1111 10101011 R 1 v R 1: R 2 High-order byte = Set to 1’s Low-order byte = Unchanged OR operation:

XOR microoperation �Used to complement one or more bits in a register. �Boolean equations:

XOR microoperation �Used to complement one or more bits in a register. �Boolean equations: ◦X 1=X When XORed with 1, binary variable X complemented. ◦X 0=X When XORed with 0, binary variable X remains unchanged.

XOR microoperation X 1 = X X 0=X Example: 10101101 10101011 1111 0000 (mask)

XOR microoperation X 1 = X X 0=X Example: 10101101 10101011 1111 0000 (mask) 01010010 10101011 R 1: High-order byte = R 2 R 1 R 2 (data) R 1 Complemented Low-order byte = Unchanged XOR operation:

SHIFT MICROOPERATIONS

SHIFT MICROOPERATIONS

SHIFT MICROOPERATIONS �Shift microoperations are used for: ◦ Lateral movement of data. ◦ Serial

SHIFT MICROOPERATIONS �Shift microoperations are used for: ◦ Lateral movement of data. ◦ Serial transfer of data. ◦ Manipulating the contents of registers in arithmetic, logical, and control operations. �Left shift MSB �Right shift : : toward the LSB toward 7 6 5 4 3 2 1 0

Shift Microoperations SHIFT MICROOPERATIONS � There are three types of shifts ◦ Logical shift

Shift Microoperations 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/incoming bit • A right shift operation LSB Serial input • A left shift operation MSB Serial input

Shift Microoperations SHIFT MICROOPERATIONS • A right shift operation LSB Serial input • A

Shift Microoperations SHIFT MICROOPERATIONS • A right shift operation LSB Serial input • A left shift operation MSB Serial input

SHIFT MICROOPERATIONS In RTL, string of letters are used to specify 1 -bit shift

SHIFT MICROOPERATIONS In RTL, string of letters are used to specify 1 -bit shift operations: ◦ Shift left : sl ◦ Shift right : sr

Shift Microoperations LOGICAL SHIFT � Assume the serial input/incoming bit to the shift is

Shift Microoperations LOGICAL SHIFT � Assume the serial input/incoming bit to the shift is a 0. � A right shift operation: 0 � A left shift operation: � Example of Shifts: 0 Type Symbolic Designation Source R 2 After Shift: Destination R 1 Shift Left R 1 sl R 2 100111100 Shift Right R 1 sr R 2 11100101 01110010

SHIFT MICROOPERATIONS Example 1: Let R 2 = 11001001 After the Shift operation, R

SHIFT MICROOPERATIONS Example 1: Let R 2 = 11001001 After the Shift operation, R 1 becomes: Note: These shifts "zero fill". Sometimes a separate flip-flop is used to provide the data shifted in, or to “catch” the data shifted out.