Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

how to combine two modules into one?

hi guys

i'm trying to combine two modules into one main module.

that will connect both of them and create signals to go to one of them

(like c in module 2 in the example)

in the first the inputs and outputs should be connected to the second module, and the same in the second module in which has inputs not from the first one.

for example:

module 1:

input a;//from module 2

output b;//to module 2

module 2

input b;//from module 1

output a;//to module 1

input c;

i tried to do it in different ways but i get errors all the time..

what's the right way or syntax to do it?

thanx

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you use VHDL, searh for Component and port map.

    You can also try to use a schematic, you create a bloc of your modules and you link theme with cables...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i'm using verilog.

    i know the schematic but my problem is that i don't know how to write the connections right.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    i'm using verilog.

    i know the schematic but my problem is that i don't know how to write the connections right.

    --- Quote End ---

    Hi,

    I have a small Ouartus Project attached.

    Kind regards

    GPK
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    well..

    that's exactly what i needed and a lot more

    thank you very much for your help