Edit code - EDA Playground
Warning! This exercise has been opened in another tab; autosave has been disabled. Close this tab or refresh to reactivate.

 Languages & Libraries

 Tools & Simulators

 Examples

205


32
 
1
//----------------------------------------------------------------------------------
2
//                      www.verificationguide.com
3
//----------------------------------------------------------------------------------
4
module nonblocking_assignment;
5
  //variables declaration
6
  int a,b;
7
  
8
  initial begin  //initial block will get executed at starting of simulation
9
    $display("-----------------------------------------------------------------");
10
    //initializing a and b
11
    a = 10;
12
    b = 15;
13
    
14
    //displaying initial value of a and b
15
    $display("\tBefore Assignment :: Value of a is %0d",a);
16
    $display("\tBefore Assignment :: Value of b is %0d",b);
17
    
18
    a <= b;
19
    b <= 20;
20
    
21
    $display("\tAfter  Assignment :: Value of a is %0d",a);
22
    $display("\tAfter  Assignment :: Value of b is %0d",b);
23
    $display("-----------------------------------------------------------------");
24
  end
25
26
  final begin  //final block will get executed at end of simulation
27
    $display("-----------------------------------------------------------------");
28
    $display("\tEnd of Simulation :: Value of a is %0d",a);
29
    $display("\tEnd of Simulation :: Value of b is %0d",b);
30
    $display("-----------------------------------------------------------------");
31
  end    
32
endmodule
xxxxxxxxxx
1
 
1
// Code your design here
2
3541 views and 0 likes     
A short description will be helpful for you to remember your playground's details
 
100:0