EE3755             Homework 5  Due: TBA

///

Estimated time to finish:

Know how to use the program : ….??

Prob.0: 1Mins.

Prob.1 : 10Mins.

Prob.2 : 10Min.

Total : 21 Mins..

When you submit the Hw., Please write down how much time did you spend for each problem.

(No penalty for spending too little or too much time. Just want to know how much you spent.)

How to submit: Hard copy during the class.

Prob0. Use the Synthesis program, Draw the figure for the module.

module slice_es(eo,a,b,ei);

input a, b, ei;

output eo;

wire aneb, aeqb;

xor x1(aneb,a,b);

not n1(aeqb,aneb);

and a1(eo,aeqb,ei);

endmodule

 

Prob1. Use the Synthesis program, Draw the figure for the module “compare”.( the figure maybe different(from the one at the class) when you are using “bgx_shell -gui”)

module compare(gt, lt, a, b);

   input a, b;

   output gt, lt;

   wire [2:0] a, b;

   reg        gt, lt;

   integer    i;

 

   always @( a or b ) begin

      gt = 0; lt = 0;

      for(i=2; i>=0; i=i-1)

        if( !gt && !lt ) begin

           if( a[i] < b[i] ) lt = 1;

           if( a[i] > b[i] ) gt = 1;

        end

   end

 

endmodule // compare

 

Prob2. Use the Synthesis program, Draw the figure for the module.( the figure maybe different(from the one at the class) when you are using “bgx_shell -gui”)

 

module cond_form_1_example2(x,y,a,b,c);

   input a,b,c;

   output x,y;

   wire [7:0] b, c;

   reg [8:0]  x, y;

 

   always @( a or b or c ) begin

      if( a ) begin

         x = b + c;

         y = b - c;

      end else begin

         x = b - c;

      end

   end

endmodule