for...generate question

Discussion in 'VHDL' started by Xin Xiao, Dec 7, 2007.

  1. Xin Xiao

    Xin Xiao Guest

    I have to generate a two-dimension array of semiadders using the for...
    generate sentence (to model a multiplier). But I'm stuck because I've always
    used for...generate to model a simple array of components, not a matrix

    This is the image of my matrix of semiadders:

    S02 S01 S00

    S12 S11 S10

    S00 is connected to the output and S10
    S01 is connected to S10 and S11
    S02 is connected to S11 and S12

    My question is, should I generate each row with "for...generate" sentences?
    Could you post a simple 2x2 matrix example so that I clear my mind?

    Thanks
     
    Xin Xiao, Dec 7, 2007
    #1
    1. Advertising

  2. Xin Xiao schrieb:
    > I have to generate a two-dimension array of semiadders using the for...
    > generate sentence (to model a multiplier). But I'm stuck because I've
    > always used for...generate to model a simple array of components, not a
    > matrix



    Maybe this helps: Every n*m matrix can be written as an array with n*m
    elements (concatenation of every matrix row / column).

    Ralf
     
    Ralf Hildebrandt, Dec 9, 2007
    #2
    1. Advertising

  3. Xin Xiao

    Xin Xiao Guest

    Thanks Ralf, yes, i solved my problem with two anidated --for generate-- and
    some --if generate-- it was simple!

    tnks,

    Xiao

    "Ralf Hildebrandt" <> wrote in message
    news:...
    > Xin Xiao schrieb:
    >> I have to generate a two-dimension array of semiadders using the for...
    >> generate sentence (to model a multiplier). But I'm stuck because I've
    >> always used for...generate to model a simple array of components, not a
    >> matrix

    >
    >
    > Maybe this helps: Every n*m matrix can be written as an array with n*m
    > elements (concatenation of every matrix row / column).
    >
    > Ralf
     
    Xin Xiao, Dec 9, 2007
    #3
    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.

Share This Page