need help to design a VHDL code from an algorithm

Discussion in 'VHDL' started by lokesh kumar, Jul 7, 2013.

  1. lokesh kumar

    lokesh kumar Guest

    Hi,

    I am new to VHDL. I need to design a VHDL code from an algorithm. Can anyone please help me out with it? I am not getting the idea how to implement it..

    I want to implement a 163 bit multiplier. So in this case m= 163, w = 32 and
    s= [m/w] = 6 (Because my aim is to design for 63 bit. So for I can take 5, 32 bits and one 3 bit at MSB. Hence the value of S is 6 in total)

    Here is the algorithm below:

    INPUT: A= (As-1, As-2..., A1, A0) and B= (Bs-1, Bs-2,..., B1, B0)
    OUTPUT: Z=A.B=(Z2s_1, Z2s-2,..., Z1, Z0)
    (U,V) <- (0, 0)
    For i from 0 to s-1 do
    For j from 0 to s-1 do
    (U,V) <- (U,V) + Aj .Bi-j
    end for
    Zi <- V
    V <- U, U <- 0
    end for
    for i from s to 2s-2 do
    for j from i – s+1 to s-1 do
    (U,V) <- (U,V) + Aj . Bi-j
    end for
    Zi <- V
    V <- U, U <- 0
    end for
    Z2s-1 <- V
    return Z = ( Z2s-1, Z2s-2, …, Z1, Z0)
    ---------------------------------------------------------------------------


    Variables used:
    m = Key length or length of finite field vector (163,233,283, 409, 571)
    w = Digit size (32)
    s = Number of Digits = [m/w]
    i, j = Indexes

    A(t), B(t), Z(t) = A finite field element in polynomial basis representation;
    A(t) = (am_1, . . . ,a1,a0), where ai is binary, and similarly for B(t)and Z(t)
    C(t) = Result of A(t) x B(t); has length 2m- 1
    P(t) = Irreducible polynomial
    A = (As_1, . . . , A1, A0) Each Ai is a binary vector of size w and similarly for B and Z
    U, V = Binary vectors of size w; (U, V) is the concatenation of the two vectors
    T0, . . . , T3 = Temporary binary vectors of size w


    Really hope someone will help me out. Many thanks!
    lokesh kumar, Jul 7, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ZackS
    Replies:
    5
    Views:
    6,773
    Just an Illusion
    Jul 9, 2004
  2. Ahmed Moustafa
    Replies:
    0
    Views:
    742
    Ahmed Moustafa
    Nov 15, 2003
  3. SpamProof
    Replies:
    3
    Views:
    632
    SpamProof
    Dec 1, 2003
  4. Bapaiah Katepalli
    Replies:
    1
    Views:
    1,471
    Mike Treseler
    Jun 23, 2006
  5. afd
    Replies:
    1
    Views:
    8,234
    Colin Paul Gloster
    Mar 23, 2007
Loading...

Share This Page