Académique Documents
Professionnel Documents
Culture Documents
processors
c is equal to 1.
z is 1 if a is equal to 1 and b is
equal to 1 or if b or c is equal to
1, but not both.
Multiplexer
Decoder
Adder
An adder adds two n-bit binary inputs
A and B, generating an n-bit output
sum along with an output carry.
Comparator
A comparator compares two n-bit
binary inputs A and B, generating
outputs that indicate whether A is less
than, equal to, or greater than B.
ALU
Registers
Shift registers
Types of SRs
PISO SR
Counters
CUSTOM SINGLE-PURPOSE
PROCESSOR DESIGN
external
control
inputs
controller
external
data
inputs
datapath
control
inputs
datapath
datapath
control
outputs
external
control
outputs
controller
datapath
next-state
and
control
logic
registers
state
register
functional
units
external
data
outputs
How?
Designer
can
apply
the
all
combinational and sequential logic
design techniques to build data-path
components and controllers.
Designer
has
nearly
all
the
knowledge ,he needs to build a custom
single-purpose processor for a given
program, since a processor consists of
a controller and a data-path.
Here it
describe a technique for
building such a processor.
Solution
black-box view
go_i x_i y_i
d_o
The datapath
Example
Bus bridge that converts 4-bit
bus to 8-bit bus
Start with FSMD
Known as register-transfer
(RT) level
Exercise: complete the design
Sende
r
rdy_in
clock
data_in(4)
Bridge
A single-purpose processor that
converts two 4-bit inputs, arriving one
at a time over data_in along with a
rdy_in pulse, into one 8-bit output on
data_out along with a rdy_out pulse.
rdy_in=0
rdy_out
Rece
iver
data_out(8)
Bridge
rdy_in=1
RecFirst4Start
data_lo=data_in
RecFirst4End
rdy_in=1
WaitFirst4
rdy_in=0
FSMD
Problem Specification
WaitSecond4
rdy_in=0
rdy_in=1
RecSecond4Start
data_hi=data_in
rdy_in=0
Send8Start
data_out=data_hi
& data_lo
rdy_out=1
Send8End
rdy_out=0
rdy_in=1
RecSecond4End
Inputs
rdy_in: bit; data_in: bit[4];
Outputs
rdy_out: bit; data_out:bit[8]
Variables
data_lo, data_hi: bit[4];
44
Problem Specification
Problem Specification
Sende
r
rdy_in
clock
data_in(4)
Bridge
A single-purpose processor that
converts two 4-bit inputs,
arriving one at a time over
data_in along with a rdy_in
pulse, into one 8-bit output on
data_out along with a rdy_out
pulse.
rdy_out
data_out(8)
Rece
iver
Bridge
rdy_in=1
RecFirst4Start
data_lo=data_in
RecFirst4End
rdy_in=1
WaitFirst4
rdy_in=0
rdy_in=0
rdy_in=1
rdy_in=1
FSMD
WaitSecond4
RecSecond4Start
data_hi=data_in
rdy_in=0
Send8Start
data_out=data_hi &
data_lo
rdy_out=1
Send8End
rdy_out=0
RecSecond4End
Inputs
rdy_in: bit; data_in: bit[4];
Outputs
rdy_out: bit; data_out:bit[8]
Variables
data_lo, data_hi: bit[4];
(a) Controller
rdy_in=0
WaitFirst4
rdy_in=0
WaitSecond4
Send8Start
data_out_ld=1
rdy_out=1
rdy_in=1
rdy_in=1
RecFirst4Start
data_lo_ld=1
rdy_in=0
rdy_in=1
RecSecond4Start
data_hi_ld=1
RecFirst4End
rdy_in=1
RecSecond4End
Send8End
rdy_out=0
rdy_in
rdy_out
clk
data_out
data_hi
data_lo
data_out
data_lo_ld
data_out_ld
data_hi_ld
to all
registers
data_in(4)
(b) Datapath
47
number of computations
size of variable
operations used
multiplication
GCD program
50
original program
0:
1:
2:
3:
4:
5:
{
6:
7:
int x, y;
while (1) {
while (!go_i);
x = x_i;
y = y_i;
while (x != y)
optimized program
0: int x, y, r;
1: while (1) {
2: while (!go_i);
// x must be the larger
number
replace the
3: if (x_i >= y_i) {
subtraction
4:
x=x_i;
operation(s)
with
if (x < y)
5:
y=y_i;
modulo
operation
y = y - x;
}
in
order
to
speed
else
6: else {
up
program
8:
x = x - y;
7:
x=y_i;
}
8:
y=x_i;
9: d_o = x;
}
}
9: while (y != 0) {
10:
r = x % y;
11:
x = y;
12:
y = r;
GCD(42, 8) - 9 iterations to
}
complete the loop
13: d_o = x;
x and y values evaluated as follows :
}
(42, 8), (43, 8), (26,8), (18,8), (10,
GCD(42,8) - 3 iterations to complete
8), (2,8), (2,6), (2,4), (2,2).
the loop
x and y values evaluated as follows:
(42, 8), (8,2), (2,0)
merge states
states
states
separate states
states
Scheduling
52
int x, y;
1:
2:
2-J:
1
!
go_
i
!
1
!(!
go_i)
3: x = x_i
4: y = y_i
5
:
6:
x!
=y
!(x!
=y)
x<y !
(x<
7: y = y -x 8: x = x y)
y
6-J:
5-J:
9:
1-J:
d_o =
x
optimized
FSMD
int x, y;
original FSMD
2:
!
go_
go_i
x = x_i
3:
y =i y_i
5:
x<
x>
yx=x7: y =y y 8:
-x
y
9: d_o = x
Multi-functional units
State encoding
State minimization