###### tags: `hdl` `test` `thu`
{%hackmd theme-dark %}
# HDL-MIDTERM
## EX01
```verilog!
module test1_tb;
reg [4:0] A, B;
reg [3:0] C;
reg [4:0] A1, B1;
reg [3:0] C1;
//blocking cmp1 (A, B, C);
//nonblocking cmp2 (A1, B1, C1);
// setup data
initial begin
A = 16; B = 25; C = 12;
A1 = 16; B1 = 25; C1 = 12;
#5 A = B; B = C; C = A;
#10 A1<=B1; B1<= C1; C1<= A1;
#15 $finish;
end
// output
initial begin
$display ("\t\tTIME\tA\tB\tC\t|\tA1\tB1\tC1");
$display ("\t\t------------------------------------------------------------");
$monitor ("%t\t%d\t%d\t%d\t|\t%d\t%d\t%d\n", $time, A, B, C, A1, B1, C1);
end
endmodule
```

## EX02
### a. Gate level


### b. Behavioral modeling


## EX03
### a. Dataflow modeling


### b. Behavioral modeling


## EX04
### a. Dataflow


### b. Behavioral modeling

