SV_datapath and Control
SV_datapath and Control
&
Arithmetic Hardware
1
W H AT I S D ATA - PAT H ?
H Y P O T H E T I C A L D ATA - PAT H D E S I G N
C O N T R O L U N I T F O R H Y P O T H E T I C A L D ATA - PAT H
INSTRUCTION FOR HYPOTHETICAL PROCESSOR
ADDITION & SUBTRACTION
M U LT I P L I C AT I O N
DIVISION
ALU
CONTROL DESIGN
HARD-WIRED CONTROL
MICROPROGRAMED CONTROL
R1
R2
A
RJ
Control
CLK @ 1 @ 2 DATA
R/W’
Register Bank
R1
MUX O
R2 uO
tU
T
r
R
e
ALU G
gI
iS
sT
tE
er
R
MUX
RJ
CLK @ 1 @ 2 DATA
R/W’ CLK
Control
Signals m1 m0
ALU
CONT
DATAPATH AND CONTROL UNIT
5
Control Signals are R/, @1, @2, m1, m2, OP, CLK
The above string of Signals are called CONTROL WORD
Operation to be performed : R3 = R1 + R2
Clock Control Signal Activation
1 R/ = READ; @1 = @R1, @2 = @R2; m1 = m2 = RB;
OP = ADD;
2 OUT REG = R1 + R2 (STATUS);
R/ = WRITE; @1 = R3;
A MODIFICATION OF
VON-NEUMANN
MACHINE
S I M P L E AS P O S S I B L E
A RC H I T E C T U RE
SAP
( S O U R C E : D I G I TA L C O M P U T E R E L E C T R O N I C S
BY
A . P. M A LV I N O ( P H I )
L’ CLK E E S L’ L’
A U U B O
A
CLK CLK
CONTROL UNIT
Description of the hypothetical instructions
16
CONTROL UNIT
Simple As Possible (SAP) Architecture -4
17
CONTROL WORD:
T4 1A3H M ,I
LDA
T5 2C3H ,A
T6 3E3H ---
T4 1A3H M ,I
ADD
T5 2E1H ,B
T6 3C7H A , U , EU
CONTROL UNIT
Simple As Possible (SAP) Architecture -6
19
CONTROL UNIT
Control Unit
The purpose of Control Unit is to issue CONTROL
SIGNALS to the Data Path for execution of the instruction.
Instruction
Register
10
S S C1 = (Is XR>=0)
0 1
C0 = (Is XR > = YR)
0d/ C1 C0
0d 11 10/1 10 0 0
1 d
0 1
1 0
S S 1 1
0d/10/11 3 0d 2
11
PRESENT Next S+- Inputs are c1c0 Subtract Swap Select Load Load
STATE XY XR YR
0d 10 11
Begin S0 S3 S1 S2 0 0 1 1 1
Swap S1 S2 S2 S2 0 1 0 1 1
Sub S2 S3 S1 s2 1 0 0 1 0
End S3 S3 S3 S3 0 0 0 0 0
Table 2: State table drawn with the help of the state diagram of the fig. 2
Select XY
MUX SWAP
SUBTRACT
XR YR Load YR
Load XR
SUBTRACT COMPARE
(XR >= YR)
(XR > 0)
STATE Assigned
States Once the States are assigned: -
Decide the type of Flip-flops will
S0 00
be used for implementation of
S1 01
the states (or it may be given by
S2 10
the user)
S3 11 Derive the next state using the
excitation required for each flip-
Table 3: State –
assignment table flop, i.e., formulate the excitation
table for the given flip-flops
For RS Flip-flop
provided
For JK Flip-flop
For T Flip-flop
For D Flip-flop
DoD1 DoD1
00 01 11 10 00 01 11 10
CoC1 CoC1
00 1 0 1 1 00 1 1 1 1
01 1 0 1 1 01 1 1 1 1
11 0 0 1 0 11 1 1 1 1
10 1 0 1 1 10 1 0 1 1
10
S S
0 1 =
0d/
0d 11 10/ 10
11
SWAP = D1
SUB = D2
0d/10/11
S S SELECTXY = D0
3 0d 2
11
LOAD XR = D0 + D1 + D2
LOAD YR = D0 + D1
Address Control
Logic Memory
Microinstruction
Decoder
Register
Instruction
Register
T4 1A3H M ,I
LDA
T5 2C3H ,A
T6 3E3H ---
T4 1A3H M ,I
ADD
T5 2E1H ,B
T6 3C7H A , U , EU
CONTROL UNIT
Simple As Possible (SAP) Architecture -6
38
CONTROL UNIT
SAMPLE INTUITIVE DESIGN OF
SAP – 1
ARCHITECTURE
03 T4 1A3H M ,I
LDA
04 T5 2C3H ,A
05 T6 3E3H ---
06 T4 1A3H M ,I
ADD
07 T5 2E1H ,B
08 T6 3C7H A , U , EU
09 T4 1A3H M ,I
SUB
0A T5 2E1H ,B
0B T6 3C7H A , SU , EU
0C T4 3F2H EA , O
OUT
0D T5 3E3H ---
0E T6 3E3H ---
Control Unit
Addition
Parallel Adders
A3 B 3 A2 B 2 A1 B 1 A0 B 0
Cout
S3 S2 S1 S0
Generate signal: gi = xi y i
Propagate signal: pi = xi y i
Carry recurrence
ci+1 = gi + cipi
A= -
If an-1 is zero then the number is positive.
If an-1 is one then the resulting number
2 is negative and
obtained by subtraction as shown in 2 above.
Multiplier x
(j)
Doublewidth partial product p
Shift
Multiplicand a
0
k xj
0 1
Mux
xj a k
Adder
cout
k
Fig. 9.4 Hardware realization of the sequential multiplication algorithm with
additions and right shifts.
DATAPATH AND CONTROL UNIT
72
Bs
Complementer and
Parallel Adder
As Qs
E Register A Register Q Qn
In both the cases results are stored in A, and after the
addition or subtraction operation, A, Q, Q-1 are right
shifted.
The shifting is the arithmetic right shift operation where
the left most bit namely, An-1 is not only shifted into An-2
but also remains in An-1.
This is to preserve the sign of the number in A and Q. The
result of the multiplication will appear in the A and Q.
B= 10001 A= 0111000000
B’+1 =01111 01110 A<B, hence shift B to left
011100 A>B, subtract B and Q=1
Add - 01111
- 010110 A>B, subtract B and Q=11
- - 01111
448/17 - - 001010 A<B, hence shift B left and Q=110
Quotient= 26 - - -010100 A>B, subtract B and Q=1101
Remainder = 6
- - - 001111
- - - 0000110 Remainder < B; Q=11010
No, decrement
Is = 0
Complementer and
parallel Adder
Yes, STOP
Qn =E
E A Register Q Register