1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Multisim/verilog question

  1. Mar 9, 2013 #1
    I just started learing verilog and i have 2 problems.
    First one, i cant find an useful documentation on internet which might help me to solve my homework.
    Second one, its the homework :D.
    I have to make a program in verilog which calculates the difference between 2 numbers of 16 bits.
    The problem is that i dont know how to test my design, i did try to put a=305, b=540 but when i run it (simulate-add to wave-run ) i dont see the binary signal, it shows me somthing green with this text inside 16`h0000. Can you tell me the right way to initiate the variables???
    My code:
    Code (Text):
    module Difft;
      reg [15:0]a;
      reg [15:0]b;
      wire [15:0]c;
      initial begin
        #2 a=70;
      Diff DUT(.a(a),.b(b),.c(c));
    Code (Text):

    module Diff(input [15:0]a,input [15:0]b,output [15:0] c);
      assign c=a-b;
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted