












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













machine with datapath
conversion
7: y = y -x 8: x = x - y
x!=y
5: !(x!=y)
x<y !(x<y)
3: x = x_i
4: y = y_i
!go_i
!(!go_i)
d_o = x
Assignment statement
a = b
next statement
Loop statement
while (cond) {
loop-body-
statements }
next statement
Branch statement
if (c1)
c1 stmts
else if c c2 stmts
else
other stmts
next statement
7: y = y -x 8: x = x - y
x!=y
5: !(x!=y)
x<y !(x<y)
3: x = x_i
4: y = y_i
!go_i
!(!go_i)
d_o = x
y_sel = 1 y_ld = 1
7: x_sel = 1 x_ld = 1
x_neq_y
!x_neq_y
x_lt_y !x_lt_y
d_ld = 1
x_sel = 0 3: x_ld = 1
y_sel = 0 4: y_ld = 1
!go_i
!(!go_i)
go_i
subtractor subtractor 5: x!=y 6: x<y 8: x-y 7: y-x
x_i y_i
d_o
0: x 0: y
9: d
n-bit 2x1 n-bit 2x
x_sel
y_sel x_ld
y_ld
x_neq_y
x_lt_y d_ld
5: x!=y
Splitting into a controller and datapath
y_sel = 1 y_ld = 1
7: x_sel = 1 x_ld = 1
x_neq_y=
x_neq_y=
x_lt_y=1 x_lt_y=
d_ld = 1
x_sel = 0 3: x_ld = 1
y_sel = 0 4: y_ld = 1
!go_i
!(!go_i)
go_i
y_sel
x_sel Combinational logic
State register
go_i
x_neq_y x_lt_y
x_ld y_ld
d_ld
subtractor subtractor 5: x!=y 6: x<y 8: x-y 7: y-x
x_i y_i
d_o
0: x 0: y
9: d
n-bit 2x1 n-bit 2x
x_sel
y_sel x_ld
y_ld
x_neq_y
x_lt_y d_ld
5: x!=y
functionality
8-bit bus
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.
Sende r
data_in(4)
rdy_in (^) rdy_out
data_out(8)
Rece iver
clock
WaitFirst4 RecFirst4Start data_lo=data_in
WaitSecond
rdy_in=
rdy_in=
RecFirst4End
rdy_in=
RecSecond4Start data_hi=data_in
RecSecond4End
rdy_in=0 rdy_in= rdy_in=
rdy_in=
Send8Start data_out=data_hi & data_lo rdy_out=
Send8End rdy_out=
Bridge
rdy_in= Inputs rdy_in: bit; data_in: bit[4]; Outputs rdy_out: bit; data_out:bit[8] Variables data_lo, data_hi: bit[4];
go_i !go_i x = x_i y = y_i
x
9: d_o = x
7: y = y -x 8: x = x - y
x!=y
5: !(x!=y)
x<y !(x<y)
x = x_i
4: y = y_i
!go_i
!(!go_i)
d_o = x