Beruflich Dokumente
Kultur Dokumente
MICROOPERATION
R f(R,R)
REGISTER TRANSFER
Designation of a register
a register
Portion of a register
A bit of a register
R2R1
A simultaneous transfer of all bits from the source to the
destination register, during one clock pulse
P : R2R1
A binary condition (p=1) which determines when the transfer is
to occur
If (p=1) then (R2R1)
HARDWARE IMPLEMENTATION OF
CONTROLLED TRANSFERS
Implementation of controlled transfer
P: R2R1
Block diagram
Timing diagram
Represent
Show
The outputs of four registers, R0, R1, R2, and R3, are
connected through 4-to-1-line multiplexers to the
inputs of a fifth registers, R5. Each register is eight
bits long. The required transfers are dictated by four
timing variables T0 through T3 as follows:
T0: R5R0
T1: R5R1
T2: R5R2
T3: R5R3
The timing variables are mutually exclusive, which
means that only one variable is equal to 1 at any given
time, while the other three are equal to 0. Draw a block
diagram showing the hardware implementation of the
register transfers. Include the connections necessary
from the four timing variables to the selection inputs of
the multiplexers and to the load inputs of register R5.
Register C
Register B
Register A
3 2 1 0
3 2 1 0
3 2 1 0
3 2 1 0
D3 D2 D1 D0
C3 C2 C1 C0
B3 B2 B1 B0
A3 A2 A1 A0
D3 C3 B3 A3
3 2 1 0
MUX3
S0
S1
D2 C2 B2 A2
D1 C1 B1 A1
D0 C0 B0 A0
3 2 1 0
3 2 1 0
3 2 1 0
MUX2
S0
S1
MUX1
S0
S1
MUX0
S0
S1
a.
b.
c.
We
THREE-STATE BUS
BUFFERS
Control input C
Normal input A
Output B
Three-State Buffer
THREE-STATE BUS
BUFFERS
C=1
Buffer
A
C=0
Open Circuit
A
THREE-STATE BUS
BUFFERS
Select
Enable
S1
S0
E
0
1
24
Decoder 2
A0
B0
C0
Bus line with three-state
buffer (replaces MUX0 in
the previous diagram)
D0
MEMORY TRANSFER
Memory read : Transfer from memory
Memory write : Transfer to memory
Data being read or wrote is called a memory
word (called M)
It is necessary to specify the address of M when
writing /reading memory
This is done by enclosing the address in square
brackets following the letter M
Example: M[0016] : the memory contents at
address 0x0016
MEMORY TRANSFER
Assume that the address of a memory unit is
stored in a register called the Address Register
AR
Lets represent a Data Register with DR, then:
Read: DR M[AR]
Write: M[AR] DR
MEMORY TRANSFER
AR
x0C
x0E
x10
x12
x14
x16
x18
x12
R1
100
R1M[AR]
19
34
45
66
0
13
22
RAM
R1
100
R1
66
23
a.
b.
c.
MICROOPERATIONS
transfer microoperations
Arithmetic microoperations (on numeric data stored
in the registers)
Logic microoperations (bit manipulations on nonnumeric data)
Shift microoperations
ARITHMETIC
MICROOPERATIONS
The basic arithmetic microoperations are:
addition, subtraction, increment, decrement, and
shift
Addition Microoperation:
R3 R1+R2
Subtraction Microoperation:
1s complement
R3 R1-R2 or :
R3 R1+R2+1
ARITHMETIC
MICROOPERATIONS
Ones Complement Microoperation:
R2 R2
Twos Complement Microoperation:
R2 R2+1
Increment Microoperation:
R2 R2+1
Decrement Microoperation:
R2 R2-1
Full Adder
x y
0 0
0 0
0 1
0 1
1 0
1 0
1 1
1 1
x
y
cn-1
x
0
0
1
1
cn-1 cn
0
0
1
0
0
0
1
1
0
0
1
1
0
1
1
1
y
0
1
0
1
c
0
0
0
1
s
0
1
1
0
1
0
0
1
s
0
1
1
0
c = xy
s = xy + xy
=x y
0 0
0 1 c
n-1
1 1
0 1
cn
x
y
0
1
0
1
1
0 c
n-1
1
0
cn = xy + xcn-1+ ycn-1
= xy + (x y)cn-1
cn
s = xycn-1+xycn-1+xycn-1+xycn-1
= x y cn-1 = (x y) cn-1
c
s
ARITHMETIC
MICROOPERATIONS
BINARY ADDER
B3
FA
C4
B2
A3
S3
C3
B1
A2
FA
S2
C2
B0
A1
FA
S1
C1
A0
FA
S0
C0
ARITHMETIC
MICROOPERATIONS
B
A
B
A
B
B
A
BINARY
ADDERSUBTRACTOR
3
FA
C4
S3
M=0 Addition
M=1 Subtraction
C3
FA
S2
C2
FA
C1
S1
4-bit adder-subtractor
A0
FA
S0
C0
ARITHMETIC
MICROOPERATIONS
BINARY
INCREMENTER
A
A
A
A
3
HA
C
C4
S3
HA
C
S
S2
HA
C
S
S1
1
y
HA
S
S0
ARITHMETIC CIRCUIT
A 1 = A + 2s complement of 1 = A + 1111
ARITHMETIC
MICROOPERATIONS
ARITHMETIC CIRCUIT
A3
A2
A1
A0
1 0 B3 B3 S1 S0
1 0 B2 B2 S1 S0
1 0 B1 B1 S1 S0
1 0 B0 B0 S1 S0
3 2 1 0 S1 S0
3 2 1 0 S1 S0
3 2 1 0 S1 S0
3 2 1 0 S1 S0
41 MUX
41 MUX
41 MUX
41 MUX
Y3
Cout
FA
D3
X3
C3
Y2
FA
D2
X2
C2
Y1
FA
X1
C1
D1
Y0
FA
D0
X0
Cin
ARITHMETIC CIRCUIT
This circuit performs seven distinct arithmetic
operations and the basic component of it is the
parallel adder
The output of the binary adder is calculated from
the following arithmetic sum:
D = A + Y + Cin
LOGIC MICROOPERATION
OR
AND
NOT
XOR
Other logic operation
LOGIC MICROOPERATIONS
OR Microoperation
Symbol: , +
Gate:
OR
LOGIC MICROOPERATIONS
AND Microoperation
Symbol:
Gate:
LOGIC MICROOPERATIONS
Complement (NOT) Microoperation
Symbol:
Gate:
LOGIC MICROOPERATIONS
XOR (Exclusive-OR) Microoperation
Symbol:
Gate:
OTHER LOGIC
MICROOPERATIONS
Selective-set Operation
Used to force selected bits of a register into logic1 by using the OR operation
Example: 01002 10002 = 11002
In a processor register
OTHER LOGIC
MICROOPERATIONS
Selective-complement (toggling)
Operation
Used to force selected bits of a register to
be complemented by using the XOR
operation
Example:
In a processor register
OTHER LOGIC
MICROOPERATIONS
Step1:
Insert Operation
R1 = 1001 1010
OTHER LOGIC
MICROOPERATIONS
NAND Microoperation
Symbols: and
Gate:
OTHER LOGIC
MICROOPERATIONS
NOR Microoperation
Symbols: and
Gate:
OTHER LOGIC
MICROOPERATIONS
LOGIC MICROOPERATIONS
HARDWARE
TheIMPLEMENTATION
hardware implementation of logic
LOGIC MICROOPERATIONS
HARDWARE
IMPLEMENTATION
S
41
MUX
Ai
Bi
S0
0
1
Ei
S1
S0
Output
Operatio
n
E =A B
XOR
E =A B
OR
E =A B
AND
E=A
Complem
ent
2
3
LOGIC MICROOPERATIONS
SHIFT MICROOPERATIONS
Used
SHIFT MICROOPERATIONS
Serial Input
rn-1
r2
r1
r0
r2
r1
r0
Serial Output
Shift Right
Determines
the shift
type
Serial Output
r3
rn-1
r3
Serial Input
Shift Left
SHIFT MICROOPERATIONS:
LOGICAL SHIFTS
Transfers 0 through the serial input
Logical Shift Right: R1shr R1
The same
The same
rn-1
r3
r2
r1
r0
The same
The same
rn-1
r3
r2
r1
r0
ARITHMETIC SHIFTS
Shifts
right
An arithmetic shift-left multiplies a signed
binary number by 2: ashl (00100): 01000
An arithmetic shift-right divides the
number by 2
ashr (00100) : 00010
An overflow may occur in arithmetic shiftleft, and occurs when the sign bit is
changed (sign reversal)
ARITHMETIC SHIFTS
rn-1
r3
r2
Sign
Bit
rn-1
r3
Sign
Bit
r2
r1
r1
r0
r0
ARITHMETIC SHIFTS
Rn-1
Rn-2
Vs=
1 overflow
0 no overflow
SHIFT MICROOPERATIONS
Example:
Assume
Arithmetic
R1=11001110, then:
SHIFT MICROOPERATIONS
HARDWARE
IMPLEMENTATION
A possible
choice for a shift unit would be a
SHIFT MICROOPERATIONS
HARDWARE
IMPLEMENTATION
Serial Input IR
Serial Input IL
A3A2 A1 A0
Select
MUX
MUX
MUX
MUX
H3
H2
H1
H0
Ci
One stage of
arithmetic
circuit (Fig.A)
One stage
of ALU
Di
Select
Ci+1
Bi
Ai
Ai+1
Ai-1
One stage of
logic circuit
(Fig.B)
Ei
shr
shl
0
1
2
3
41
MUX
Fi
ARITHMETIC
MICROOPERATIONS
ARITHMETIC CIRCUIT
A3
A2
A1
A0
1 0 B3 B3 S1 S0
1 0 B2 B2 S1 S0
1 0 B1 B1 S1 S0
1 0 B0 B0 S1 S0
3 2 1 0 S1 S0
3 2 1 0 S1 S0
3 2 1 0 S1 S0
3 2 1 0 S1 S0
41 MUX
41 MUX
41 MUX
41 MUX
Y3
Cout
FA
D3
X3
C3
Y2
FA
D2
X2
C2
Y1
FA
X1
C1
D1
Y0
FA
D0
X0
Cin
LOGIC MICROOPERATIONS
HARDWARE
IMPLEMENTATION
S
41
MUX
Ai
Bi
S0
0
1
Ei
S1
S0
Output
Operatio
n
E =A B
XOR
E =A B
OR
E =A B
AND
E=A
Complem
ent
2
3