Você está na página 1de 20

Logic Microoperations

Contd

Contd

Contd

Clear operation compares the


words in A and B & produces all 0s
result if two numbers are equal.
1010 A
1010 B
-----0000 Ex-or

Manipulating the bits stored in a


register
Contd

Logic Microoperations

LOGIC CIRCUIT
A variety of logic gates are
inserted for each bit of registers.
Different bitwise logical
operations are selected by select
signals.

Example

Extend the previous logic circuit to accommodate XNOR,


NAND, NOR, and the complement of the second input.

S
2

S
1

S
0

Output

Operation

XY

AND

XY

OR

XOR

XY
A

(X Y)

NAND

(X Y)

NOR

XNOR

(X Y)
B

Complement
A

Complement

More Logic Microoperation


X

0
0
1
1

0
1
0
1

F0 F1 F2
0
0
0
0

0
0
0
1

F3 F4 F5 F6 F7

0
0
1
0

0
0
1
1

0
1
0
0

0
1
0
1

0
1
1
0

F8 F9 F10 F11 F12 F13 F14 F15


0
1
1
1

1
0
0
0

1
0
0
1

1
0
1
0

1
0
1
1

1
1
0
0

1
1
0
1

1
1
1
0

1
1
1
1

TABLE 4-5. Truth Table for 16 Functions of Two Variables

Boolean function Microoperation


F0 = 0
F1 = xy
F2 = xy
F3 = x
F4 = xy
F5 = y
F6 = x y
F7 = x+y

F0
F AB
F AB
FA
F AB
FB
F A B
F AB

Name

Clear
AND
Transfer A
Transfer B
Ex-OR
OR

Boolean function Microoperation


F8 = (x+y) F AB
F9 = (x y) F A B
F10 = y
FB
F11 = x+y F AB
F12 = x
FA
F13 = x+y F AB
F14 = (xy) F AB
F15 = 1
F all 1s

TABLE 4-6. Sixteen Logic Microoperations

Name

NOR
Ex-NOR
Compl-B
Compl-A
NAND
set to all 1s

Shift Microoperations

Contd

Contd

Contd

Contd
Symbolic designation

Description

R shl R
R shr R
R cil R
R cir R
R ashl R
R ashr R

Shift-left register R
Shift-right register R
Circular shift-left register R
Circular shift-right register R
Arithmetic shift-left R
Arithmetic shift-right R

TABLE 4-7. Shift Microoperations

Contd

Contd

Arithmetic Shift Right

Arithmetic Shift Right :

Example 1

0100 (4)
0010 (2)

Example 2

1010 (-6)
1101 (-3)

Arithmetic Shift Left


The operation is same with Logic shift-left
Theonlydifferenceisyouneedtocheck
overflowproblem(CheckBEFOREtheshift)
Carry out
Sign bit

R 2 ashl R 2
LSB

Rn-1

Rn-2
0 insert

Vs=1 : Overflow
Vs=0 : use sign bit

Arithmetic Shift Left

Arithmetic Shift Left :

Example 1

0010 (2)
0100 (4)

Example 2

1110 (-2)
1100 (-4)

Example

example: 011011
SHL
110110
SHR 001101
CiL 110110
CiR 101101
ASHL Overflow
ASHR 001101