Presentation is loading. Please wait.

Presentation is loading. Please wait.

REGISTER TRANSFER LANGUAGE MICROOPERATIONS. TODAY OUTLINES Logic Microoperations Shift Microoperations.

Similar presentations


Presentation on theme: "REGISTER TRANSFER LANGUAGE MICROOPERATIONS. TODAY OUTLINES Logic Microoperations Shift Microoperations."— Presentation transcript:

1 REGISTER TRANSFER LANGUAGE MICROOPERATIONS

2 TODAY OUTLINES Logic Microoperations Shift Microoperations

3 LOGIC MICROOPERATIONS

4 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

5 LOGIC MICROOPERATIONS v OR (SETS Bits) ^ AND (CLEARS Bits)  XOR (Complement Bits, 2 Sources) NOT (Complement Bits, 1 Source) Example:R3R4 v R6 Example:R2DR ^ R1 Example:PCPC  DR Example:R6R1

6 LOGIC MICROOPERATIONS Example: Let R1 = 10101010 and R2 = 11110000 After the operations, R0 becomes:

7 HARDWARE IMPLEMENTATION OF LOGIC MICROOPERATIONS Function table Logic Microoperations B A S S F 1 0 i i i 0 1 2 3 4 X 1 MUX Select 0 0 F = A  B AND 0 1 F = A  B OR 1 0 F = A  B XOR 1 1 F = A’ Complement S 1 S 0 Output  -operation

8 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.

9 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.

10 AND microoperation Example: 10101101 10101011R1(data) 00000000 11111111R2(mask) 00000000 10101011R1  R1 ^ R2 AND operation: ◦ Selectively clear bits of a register ◦ Masking out the bits X 0 = 0 X 1 = X R1 : High-order byte = Clear Low-order byte = Unchanged R1 : High-order byte = Clear Low-order byte = Unchanged

11 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.

12 OR microoperation Example: 10101101 10101011R1(data) 11111111 00000000 R2(mask) 11111111 10101011R1  R1 v R2 OR operation: ◦ Selectively set bits of a register X + 1 = 1 R1: High-order byte = Set to 1’s Low-order byte = Unchanged R1: High-order byte = Set to 1’s Low-order byte = Unchanged X + 0 = X

13 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.

14 XOR microoperation Example: 10101101 10101011R1(data) 11111111 00000000 R2(mask) 01010010 10101011R1  R1  R2 XOR operation: ◦ Selectively complement bits of a register R1: High-order byte = Complemented Low-order byte = Unchanged R1: High-order byte = Complemented Low-order byte = Unchanged X  0 = X X  1 = X

15 SHIFT MICROOPERATIONS

16 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:toward the MSB Right shift:toward the LSB MSB 76543210 LSB

17 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 Shift Microoperations Serial input A right shift operation A left shift operation Serial input LSB MSB

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

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

20 LOGICAL SHIFT Assume the serial input/incoming bit to the shift is a 0. A right shift operation: A left shift operation: Example of Shifts: Shift Microoperations 0 0 TypeSymbolic Source R2After Shift: DesignationDestination R1 Shift Left R1 sl R21001111000111100 Shift Right R1 sr R21110010101110010

21 SHIFT MICROOPERATIONS Example 1: Let R2 = 11001001 After the Shift operation, R1 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.


Download ppt "REGISTER TRANSFER LANGUAGE MICROOPERATIONS. TODAY OUTLINES Logic Microoperations Shift Microoperations."

Similar presentations


Ads by Google