202608231343
This commit is contained in:
1 parent
de3f2b220b
commit
237dde9c36
2 files changed
+12
-3
No files matched your search
@@ -204,7 +204,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool is_set1 = (str[CELL_SIZE] == '1');
|
||||
bool is_set1 = ((s.bc & 1) == SET1);
|
||||
|
||||
if (enable_debug_output) {
|
||||
std::cout << "SACRIFICE: " << s.sacrifice;
|
||||
|
||||
+11
-2
@@ -2,7 +2,7 @@
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
|
||||
using problem_t = r8veritas<5>;
|
||||
using problem_t = r8veritas<6>;
|
||||
|
||||
problem_t::cell func_copy(problem_t::cell inp) {
|
||||
bool A = inp & 0b1;
|
||||
@@ -50,11 +50,20 @@ problem_t::cell func_half_add(problem_t::cell inp) {
|
||||
return (S << 3) | (Co << 2) | (inp & 0b11);
|
||||
}
|
||||
|
||||
problem_t::cell func_full_add(problem_t::cell inp) {
|
||||
bool A = inp & 0b1;
|
||||
bool B = inp & 0b10;
|
||||
bool C = inp & 0b100;
|
||||
bool S = A ^ B ^ C;
|
||||
bool Co = (A & B) | (A & C) | (B & C);
|
||||
return (Co << 4) | (S << 3) | (inp & 0b111);
|
||||
}
|
||||
|
||||
int main() {
|
||||
problem_t problem;
|
||||
problem.initialize_nicknames();
|
||||
problem.initialize_tp_paths();
|
||||
auto tab1 = problem.generate_truthtable(func_full_add_Co);
|
||||
auto tab1 = problem.generate_truthtable(func_full_add);
|
||||
auto new_tab1 = problem.compress_stat_space(tab1);
|
||||
if (problem.bfs(new_tab1, true)) {
|
||||
auto p = problem.track_path(tab1);
|
||||
|
||||
Reference in new issue
Block a user