Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
c899a4cb
Commit
c899a4cb
authored
Feb 08, 2023
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with multipliers.
parent
fa585973
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
src/base/wlc/wlc.c
+75
-0
No files found.
src/base/wlc/wlc.c
View file @
c899a4cb
...
...
@@ -705,6 +705,81 @@ Gia_Man_t * Wlc_ManGenProd( int nInputs, int fVerbose )
return
pNew
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Extra_PrintTernary
(
FILE
*
pFile
,
word
*
pFunc
,
word
*
pCare
,
int
nBits
)
{
int
i
;
for
(
i
=
nBits
-
1
;
i
>=
0
;
i
--
)
if
(
Abc_TtGetBit
(
pCare
,
i
)
)
fprintf
(
pFile
,
"%c"
,
'0'
+
Abc_TtGetBit
(
pFunc
,
i
)
);
else
fprintf
(
pFile
,
"-"
);
fprintf
(
pFile
,
"
\n
"
);
}
void
Wlc_AdderTreeGen
(
int
n
)
{
word
Care
[
1
<<
10
]
=
{
0
};
word
Truth
[
8
][
1
<<
10
]
=
{{
0
}};
int
nIns
=
0
,
pIns
[
16
][
2
]
=
{{
0
}};
int
i
,
k
,
x
,
Res
,
Mint
,
nMints
=
1
<<
(
n
*
n
);
assert
(
n
>=
2
&&
n
<=
4
);
for
(
x
=
0
;
x
<
2
*
n
;
x
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
for
(
k
=
0
;
k
<
n
;
k
++
)
if
(
i
+
k
==
x
)
pIns
[
nIns
][
0
]
=
i
,
pIns
[
nIns
][
1
]
=
k
,
nIns
++
;
}
for
(
x
=
0
;
x
<
nIns
;
x
++
)
printf
(
"(%d, %d) "
,
pIns
[
x
][
0
],
pIns
[
x
][
1
]
);
printf
(
"
\n
"
);
for
(
i
=
0
;
i
<
(
1
<<
n
);
i
++
)
for
(
k
=
0
;
k
<
(
1
<<
n
);
k
++
)
{
Mint
=
0
;
for
(
x
=
0
;
x
<
nIns
;
x
++
)
if
(
((
i
>>
pIns
[
x
][
0
])
&
1
)
&&
((
k
>>
pIns
[
x
][
1
])
&
1
)
)
Mint
|=
1
<<
x
;
assert
(
Mint
<
(
1
<<
16
)
);
Abc_TtSetBit
(
Care
,
Mint
);
Res
=
i
*
k
;
for
(
x
=
0
;
x
<
2
*
n
;
x
++
)
if
(
(
Res
>>
x
)
&
1
)
Abc_TtSetBit
(
Truth
[
x
],
Mint
);
}
if
(
n
==
2
)
{
Care
[
0
]
=
Abc_Tt6Stretch
(
Care
[
0
],
n
*
n
);
for
(
i
=
0
;
i
<
2
*
n
;
i
++
)
Truth
[
i
][
0
]
=
Abc_Tt6Stretch
(
Truth
[
i
][
0
],
n
*
n
);
nMints
=
64
;
}
for
(
x
=
0
;
x
<
nMints
;
x
++
)
printf
(
"%d"
,
Abc_TtGetBit
(
Care
,
x
)
);
printf
(
"
\n\n
"
);
for
(
i
=
0
;
i
<
2
*
n
;
i
++
,
printf
(
"
\n
"
)
)
for
(
x
=
0
;
x
<
nMints
;
x
++
)
printf
(
"%d"
,
Abc_TtGetBit
(
Truth
[
i
],
x
)
);
if
(
1
)
{
FILE
*
pFile
=
fopen
(
"tadd.truth"
,
"wb"
);
for
(
i
=
0
;
i
<
2
*
n
;
i
++
)
Extra_PrintTernary
(
pFile
,
Truth
[
i
],
Care
,
nMints
);
fclose
(
pFile
);
}
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment