English 中文(简体)
How to wire two modules in Verilog?
原标题:

I have written two modules DLatch and RSLatch and i want to write verilog code to join those two.

最佳回答

Seriously, you should get yourself a Verilog handbook or search for some online resources.

Anyway, something like this should work:

module dff (
    input Clk,
    input D,
    output Q,
    output Qbar
  );

  wire q_to_s;
  wire qbar_to_r;
  wire clk_bar;

  assign clk_bar = ~Clk;

  D_latch dlatch (
    .D(D),
    .Clk(Clk),
    .Q(q_to_s),
    .Qbar(qbar_to_r)
  );

  RS_latch rslatch (
    .S(q_to_s),
    .R(qbar_to_r),
    .Clk(clk_bar),
    .Qa(Q),
    .Qb(Qbar)
  );

endmodule
问题回答

You might want to look into Emacs AUTOWIRE

You will need to create an outer module, with the ports as shown in your schematic (D, Clk, Q, NQ). Inside this module you instantiate the two submodules DLatch and RSLatch, and wire the ports appropriately. (You will need to declare extra wires for the internal interconnects.)





相关问题
Working with modules in IntelliJ IDEA

As I understand, using modules allows us to control some dependencies. I mean that we can allow one module to interact with another one but not vise versa. We also can make some reusable things and ...

Module import path

I m unable to test-run a cssparser that I d like to use. test.py: from css.parse import parse data = """ em { padding: 2px; margin: 1em; border-width: medium; border-style: ...

Problem modulating action script project

I am refactoring a hugh action script solution in Flash builder (beta 2) using the flex 4 sdk. The project does NOT use the mx framework. What i want to have is: A big MAIN project several small ...

Test modules with Test::Unit

I encountered a problem when trying to test a module with Test::Unit. What I used to do is this: my_module.rb: class MyModule def my_func 5 # return some value end end test_my_module.rb: ...

Drupal section accessible by role

I need to limit access of content on Drupal site based on the Drupal User s Role. http://site.com/managers/intro http://site.com/managers/reviews http://site.com/managers/up-for-raises The ...

How to find where a function was imported from in Python?

I have a Python module with a function in it: == bar.py == def foo(): pass == EOF == And then I import it into the global namespace like so: from bar import * So now the function foo is ...

How to wire two modules in Verilog?

I have written two modules DLatch and RSLatch and i want to write verilog code to join those two.

热门标签