


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!



Input two numbers. Output the product of the two numbers.
S (^) Selector 1 0
Shifter
S 2 S 1
IL IR
0
M ALU
A B S 1 S 0
2
3
"0"
4
5
6
19
Input
1 S 0
"0"
Bus A Bus B
Result Bus
8xm register RAA file REA REB
RAB
WA WE
16- 15
11
12- 8- 7
Output
Clk
M S 1 S 0 ALU operstions 0 0 0 Complement A 0 0 1 AND 0 1 0 XOR 0 1 1 OR 1 0 0 Decrement A 1 0 1 Add 1 1 0 Subtract 1 1 1 Increment A ALU operations
S 2 S 1 S 0 Shift operstions 0 0 0 Pass 0 0 1 Pass 0 1 0 Not used 0 1 1 Not used 1 0 0 Shift left 1 0 1 Rotate left 1 1 0 Shift right 1 1 1 Rotate right Shift operations
Answer
Algorithm 1 sum = 0 2 input x 3 input y while y <> 0 4 sum = sum + x 5 y = y - 1 6 output sum
Control words
19 18-15 14-11 10-7 6-4 3-1 0 Control words IE^ Write^
Read A
Read B
ALU operation
Shifter operation OE^ Comment 1 0 010 1 000 1 000 1 010 000 0 x xor x = 0 2 1 001 1 ××× 0 ××× (^0) ××× ××× 0 input x 3 1 000 1 (^) ××× 0 ××× 0 ××× ××× 0 input y 4 0 010 1 010 1 001 1 101 000 0 sum+= x 5 0 000 1 000 1 ××× × 100 000 0 decrement A (^6 0) ××× 0 010 1 010 1 001 000 1 sum and sum <=> pass
State diagram
S 0
S 1
S 2
S 3
S 4
S 5
S 6
input x
input y
sum = 0
start = 0
start = 1
y = 0
y <> 0 sum = sum + x
y = y - 1
output sum
y = 0
y <> 0
etc…
FSM Schematic
Clk
D 0
Q' 0
Q 0
Clk
D 1
Q' 1
Q 1
Clk
D 2
Q' 2
Q 2
Start
Clk
( y <>0)
IE
etc.