This repository was archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathadd8_201.m
More file actions
90 lines (89 loc) · 3.05 KB
/
add8_201.m
File metadata and controls
90 lines (89 loc) · 3.05 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
% This code is a part of EvoApproxLib library (ehw.fit.vutbr.cz/approxlib) distributed under The MIT License.
% When used, please cite the following article(s): V. Mrazek, R. Hrbacek, Z. Vasicek and L. Sekanina, "EvoApprox8b: Library of approximate adders and multipliers for circuit design and benchmarking of approximation methods". Design, Automation & Test in Europe Conference & Exhibition (DATE), 2017, Lausanne, 2017, pp. 258-261. doi: 10.23919/DATE.2017.7926993
% This file contains a circuit from evoapprox8b dataset. Note that a new version of library was already published.
function [ c ] = add8_201( a, b )
% Approximate function add8_201
% Library = EvoApprox8b
% Circuit = add8_201
% Area (180) = 1408
% Delay (180) = 0.850
% Power (180) = 371.90
% Area (45) = 97
% Delay (45) = 0.360
% Power (45) = 29.76
% Nodes = 34
% HD = 185984
% MAE = 4.58594
% MSE = 33.75000
% MRE = 2.42 %
% WCE = 15
% WCRE = 600 %
% EP = 92.4 %
a = uint16(a);
b = uint16(b);
c = 0;
n4 = bitand(bitshift(a, -2), 1, 'uint16');
n6 = bitand(bitshift(a, -3), 1, 'uint16');
n8 = bitand(bitshift(a, -4), 1, 'uint16');
n10 = bitand(bitshift(a, -5), 1, 'uint16');
n12 = bitand(bitshift(a, -6), 1, 'uint16');
n14 = bitand(bitshift(a, -7), 1, 'uint16');
n20 = bitand(bitshift(b, -2), 1, 'uint16');
n22 = bitand(bitshift(b, -3), 1, 'uint16');
n24 = bitand(bitshift(b, -4), 1, 'uint16');
n26 = bitand(bitshift(b, -5), 1, 'uint16');
n28 = bitand(bitshift(b, -6), 1, 'uint16');
n30 = bitand(bitshift(b, -7), 1, 'uint16');
n43 = bitor(n28, n12);
n45 = bitor(n28, n12);
n46 = bitand(n26, n10);
n48 = bitcmp(bitor(n24, bitor(n8, n6)));
n49 = bitcmp(bitor(n24, bitor(n8, n6)));
n51 = n45;
n54 = bitcmp(bitor(n6, bitor(n4, n20)));
n68 = bitand(n8, n24);
n70 = n68;
n72 = bitxor(n24, n8);
n73 = bitand(n24, n8);
n78 = bitxor(n10, n26);
n79 = bitand(n10, n26);
n81 = n79;
n86 = bitxor(n12, n28);
n87 = bitand(n12, n28);
n96 = bitxor(n14, n30);
n97 = bitand(n14, n30);
n105 = bitand(n70, n54);
n134 = bitor(n26, n10);
n136 = n134;
n137 = n134;
n142 = n87;
n152 = n70;
n153 = n70;
n163 = bitand(n43, n46);
n171 = bitand(n51, n136);
n177 = bitcmp(bitor(n49, n105));
n180 = bitor(n142, n163);
n207 = n137;
n226 = bitand(n207, n152);
n245 = bitor(n81, n226);
n254 = bitand(n171, n153);
n272 = bitor(n180, n254);
n344 = bitor(n48, n72);
n345 = bitor(n48, n72);
n348 = n272;
n377 = n96;
n394 = bitxor(n78, n73);
n404 = bitxor(n86, n245);
n412 = bitxor(n377, n348);
n413 = bitand(n377, n348);
n422 = bitor(n97, n413);
c = bitor(c, bitshift(bitand(n20, 1), 0));
c = bitor(c, bitshift(bitand(n345, 1), 1));
c = bitor(c, bitshift(bitand(n344, 1), 2));
c = bitor(c, bitshift(bitand(n22, 1), 3));
c = bitor(c, bitshift(bitand(n177, 1), 4));
c = bitor(c, bitshift(bitand(n394, 1), 5));
c = bitor(c, bitshift(bitand(n404, 1), 6));
c = bitor(c, bitshift(bitand(n412, 1), 7));
c = bitor(c, bitshift(bitand(n422, 1), 8));
end