Presentation is loading. Please wait.

Presentation is loading. Please wait.

Manual Example How to manually convert high-level code into circuit

Similar presentations


Presentation on theme: "Manual Example How to manually convert high-level code into circuit"— Presentation transcript:

1 Manual Example How to manually convert high-level code into circuit
Steps 1) Build FSM for controller 2) Build datapath based on FSM acc = 0; for (i=0; i < 128; i++) acc += a[i];

2 Manual Example Build a FSM (controller) Decompose code into states
acc = 0; for (i=0; i < 128; i++) acc += a[i]; acc=0, i = 0 if (i < 128) load a[i] Done acc += a[i] i++

3 Manual Example Build a datapath Allocate resources for each state + +
acc=0, i = 0 if (i < 128) load a[i] Done i acc a[i] addr 1 128 1 acc += a[i] + + < + i++ acc = 0; for (i=0; i < 128; i++) acc += a[i];

4 Manual Example Build a datapath Determine register inputs + + < +
In from memory acc=0, i = 0 &a if (i < 128) 2x1 2x1 2x1 load a[i] Done i acc a[i] addr 1 128 1 acc += a[i] + < + + i++ acc = 0; for (i=0; i < 128; i++) acc += a[i];

5 Manual Example Build a datapath Add outputs + + + < In from memory
acc=0, i = 0 &a if (i < 128) 2x1 2x1 2x1 load a[i] Done i acc a[i] addr 1 128 1 acc += a[i] + + < + i++ acc = 0; for (i=0; i < 128; i++) acc += a[i]; acc Memory address

6 Manual Example Build a datapath Add control signals + + + <
In from memory acc=0, i = 0 &a if (i < 128) 2x1 2x1 2x1 load a[i] Done i acc a[i] addr 1 128 1 acc += a[i] + + < + i++ acc = 0; for (i=0; i < 128; i++) acc += a[i]; acc Memory address

7 Manual Example Combine controller+datapath Controller + + + <
In from memory Controller &a 2x1 2x1 2x1 i acc a[i] addr 1 128 1 + + < + acc = 0; for (i=0; i < 128; i++) acc += a[i]; Done Memory Read acc Memory address

8 Manual Example Alternatives Use one adder (plus muxes) < +
In from memory &a 2x1 2x1 2x1 i acc a[i] addr 1 128 < MUX MUX + acc Memory address


Download ppt "Manual Example How to manually convert high-level code into circuit"

Similar presentations


Ads by Google