DigitalCircuitsLab 1corrected

Document Sample
DigitalCircuitsLab 1corrected Powered By Docstoc
					Lab 1:

Number 1 :

             Function F:
module number1_F(a, b, c, F);

input a;

input b;

input c;

output F;

assign F = (~b)&c | a;

endmodule
             Function G:
module number1_G(x, y, z, G);
input x;
input y;
input z;
output G;
     assign G = x&(~y) | (~x)&z | y&(~z);
endmodule


Number 2:

             Function H:
 module number2_H(v, w, x, y, z, H);
 input v;
 input w;
 input x;
 input y;
 input z;
 output H;
      reg H;

      always @ (v or w or x or y or z or H)
      begin
      if ((y^z)==0)
            assign H = ((~v)|w)&x;
     if (y!=z)
           assign H = (v^w)|(~x);
     end
 endmodule
             Function G:
 module number2_G(x, y, z, G);
 input x;
 input y;
 input z;
 output G;
           assign G = (~x)&z | (~x)&y | y&z;
 endmodule


Number 3:

module number3(s, r, d0, d1, o, f0, f1);

input s;

input r;

input d0;

input d1;

output o;

output f0;

output f1;

              assign o = (~r)&s&(~d0) | (~r)&s&(~d1);

              assign f0 = (~r)&(~d1)&s;

              assign f1 = (~r)&(~d0)&s;

endmodule

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:3
posted:2/15/2012
language:
pages:2