06/25/14 03:37:58 ./toolflow/build/satadd_src_from_analysis_check.v
1
module
Adder_Check
(
in
,
out
,
error
)
;
2
input
[
63
:
0
]
in
;
3
input
[
31
:
0
]
out
;
4
output
error
;
5
6
wire
[
30
:
0
]
a
;
7
wire
[
30
:
0
]
b
;
8
wire
[
30
:
0
]
sum
;
9
wire
sign_a
;
10
wire
sign_b
;
11
wire
sign_sum
;
12
13
assign
a
=
in
[
30
:
0
]
;
14
assign
b
=
in
[
62
:
32
]
;
15
assign
sum
=
out
[
30
:
0
]
;
16
assign
sign_a
=
in
[
31
]
;
17
assign
sign_b
=
in
[
63
]
;
18
assign
sign_sum
=
out
[
31
]
;
19
20
wire
a_or_reduced
;
21
wire
a_eq_zero
;
22
wire
a_lt_zero
;
23
wire
a_gt_zero
;
24
assign
a_or_reduced
=
|
a
;
25
assign
a_eq_zero
=
~
sign_a
&
~
a_or_reduced
;
26
assign
a_lt_zero
=
sign_a
;
27
assign
a_gt_zero
=
~
sign_a
&
a_or_reduced
;
28
29
wire
b_or_reduced
;
30
wire
b_eq_zero
;
31
wire
b_lt_zero
;
32
wire
b_gt_zero
;
33
assign
b_or_reduced
=
|
b
;
34
assign
b_eq_zero
=
~
sign_b
&
~
b_or_reduced
;
35
assign
b_lt_zero
=
sign_b
;
36
assign
b_gt_zero
=
~
sign_b
&
b_or_reduced
;
37
38
wire
sum_or_reduced
;
39
wire
sum_eq_zero
;
40
wire
sum_lt_zero
;
41
wire
sum_gt_zero
;
42
assign
sum_or_reduced
=
|
sum
;
43
assign
sum_eq_zero
=
~
sign_sum
&
~
sum_or_reduced
;
44
assign
sum_lt_zero
=
sign_sum
;
45
assign
sum_gt_zero
=
~
sign_sum
&
sum_or_reduced
;
46
47
wire
implication1
;
48
wire
implication2
;
49
assign
implication1
=
~
((
a_gt_zero
|
a_eq_zero
)
&
(
b_gt_zero
|
b_eq_zero
))
|
(
sum_gt_zero
|
sum_eq_zero
)
;
50
assign
implication2
=
~
((
a_gt_zero
|
a_eq_zero
)
&
b_gt_zero
)
|
(
sum_gt_zero
|
sum_eq_zero
)
;
51
52
wire
all_implications_hold
;
53
assign
all_implications_hold
=
54
implication1
&
55
implication2
;
56
57
assign
error
=
~
all_implications_hold
;
58
59
endmodule
60