blob: 2be89e5333f7177fe56e029dcf69930f95da2a15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
module top (
input wire signed x,
output reg [31:0] y
);
wire signed fail = ~x;
always @*
case (x)
1'b0: y = 0;
1'b1: y = 1;
default: y = fail;
endcase
always @*
case (x)
2'sb00: y = 0;
2'sb00: y = fail;
endcase
always @*
case (x)
2'sb00: y = 0;
default: y = fail;
2'sb01: y = 1;
2'sb10: y = 2;
2'sb11: y = 3;
2'sb00: y = fail;
2'sb01: y = fail;
2'sb10: y = fail;
2'sb11: y = fail;
endcase
always @*
case ({x, x})
2'b00: y = 0;
2'b01: y = 1;
2'b10: y = 2;
2'b11: y = 3;
default: y = fail;
2'b00: y = fail;
2'b01: y = fail;
2'b10: y = fail;
2'b11: y = fail;
endcase
endmodule
|