Ass1 PDF
Ass1 PDF
Assignment-1
1. Design a single purpose processor that outputs Fibonacci numbers up to n places. Start with a
function computing the desired result, translate it into a state diagram and sketch a probable data-
path.
2. Design a circuit that computes matrix multiplication of matrices A and B. Matrix A is 3X2 and
matrix B is 2X3.
3. Consider the same matrix multiplication as in problem 2. Suppose that we have one adder and
one multiplier.
(a) Convert the matrix multiplication algorithm into a finite state machine with data-path and
then segregate the same into data-path architectures and controller state diagram.
(b) Rewrite the matrix multiplication assuming that we have three adders and six multipliers.
(c) If each multiplication takes two cycles to compute and each addition takes one cycle to
compute, how many cycles does it take to complete the matrix multiplication given that there
is:
i) One adder and one multiplier.
ii) Three adders and six multipliers
iii) Nine adders and eighteen multipliers
(d) Plot your results in part (c) in a graph with latency along x-axis and size along y-axis.
Assume the size of a multiplier to be three times the size of an adder.
4. A sequential circuit is to be used to control the operation of a vending machine which dispenses a
Rs. 100/- product. The circuit has three inputs F, W and E and four outputs R and C1, C2 and C3.
The note detector mechanism in the vending machine is synchronized with the same clock as the
sequential circuit that is to be designed. The detector outputs a single 1 to the F, W or E input for
every Rs. 50/-, Rs. 20/- and Rs. 10/- note that the customer inserts respectively. Only one input
will be 1 at a time. When the customer has inserted at least Rs. 100/- in any combination of Rs.
50/- , Rs. 20/- and Rs. 10/- notes, the vending machine must give change and dispense the
product. The note return mechanism gives change by returning notes to the customer. For every 1
output on C1, the return mechanism will return one Rs. 10/- note. Similarly, for every 1 output on
C2, the return mechanism will return one Rs. 20/- note and for every 1 output on C3, the return
mechanism will return one Rs. 50/- note. For a certain change, minimum number of notes is
returned by the return mechanism. The product is dispensed when the circuit outputs a single 1 on
output R. The circuit should reset after dispensing the product. For example, a customer inserts a
Rs. 50/- note and three Rs. 20/- notes. The circuit inputs and outputs could look like this:
INPUTS F=00010000000000000000000000000
W=00000001000000010000000100000
E=00000000000000000000000000000
OUTPUTS R=00000000000000000000000001000
C1=00000000000000000000000010000
C2=00000000000000000000000000000
C3=00000000000000000000000000000
Develop the finite state machine with data-path and then segregate the same into data-path
architectures and controller state diagram.
the problem. Develop the finite state machine with data-path and then segregate the same into
data-path architectures and controller state diagram.
6. Consider the same polynomial as in problem 5. Horner’s rule is used to rewrite the polynomial as
n 1
a x a
i 0
i i n 1 x a n 2 x a1 x a0 . Repeat problem 5 using Horner’s rule. Compare the
time of computation and the amount hardware resource required using the approaches in problem
5 and problem 6.