Sample Questions

Digital

Verilog

                        a) always @(posedge clk)
                                       a = b;

                            always @(posedge clk)
                                       b = a;
                            What is the problem with this module and how can it be overcome ?

                        b) always @(b)
                                    a  =  #1 b;
                            always @(b)
                                     #1 a = b;
                            whats the value of a at 5 ns if  b is a sequence  ?

                        1--always @(posedge clk)
                                        a  =  1;
                        2--always @(posedge clk)
                                   #0 a = 1;

VHDL

Synthesis    (Try in VHDL too)

                      always @(posedge clk )
                      begin : block1
                                    a <= in ;
                                    b <= a ;
                      end

                      always @(posedge clk )
                      begin : block2
                                    a = in ;
                                    b = a ;
                      end

                     always @(a or b)
                     case({a,b})
                     0    :     out  = 0;
                     1    :     out  = 0;
                     2    :     out  = 0;
                     3    :     out  = 1;
                     endcase                    out  =  a + b +  c +d;
                   out =  (a+b) + (c+d);

Simulation


Ur suggestions are always welcome :
 [email protected]