diff options
author | FreeArtMan <dos21h@gmail.com> | 2018-10-15 21:22:42 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2018-10-15 21:22:42 +0100 |
commit | 4a111c26d5d1030669975700558799932b2d86bd (patch) | |
tree | a91d6eb650c51c588d1699b7a7c1d8296b47bfc0 /cpu8/cpu_xor/cpu_xor.hpp | |
parent | 0b7dea3a6db1faf4abee5b3e724aeb03a15843f3 (diff) | |
download | cpu8-4a111c26d5d1030669975700558799932b2d86bd.tar.gz cpu8-4a111c26d5d1030669975700558799932b2d86bd.zip |
Add CPU XOR
Diffstat (limited to 'cpu8/cpu_xor/cpu_xor.hpp')
-rw-r--r-- | cpu8/cpu_xor/cpu_xor.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cpu8/cpu_xor/cpu_xor.hpp b/cpu8/cpu_xor/cpu_xor.hpp new file mode 100644 index 0000000..855125c --- /dev/null +++ b/cpu8/cpu_xor/cpu_xor.hpp @@ -0,0 +1,25 @@ +#ifndef __SYSC_CPU_XOR_HPP +#define __SYSC_CPU_XOR_HPP + +#include "systemc.h" + +SC_MODULE (cpu_xor) +{ + sc_in <bool> in_a; + sc_in <bool> in_b; + sc_out <bool> out_c; + + void do_xor() + { + out_c.write( (in_a.read()^in_b.read()) ); + } + + SC_CTOR(cpu_xor) + { + SC_METHOD(do_xor); + sensitive << in_a << in_b; + } + +}; + +#endif
\ No newline at end of file |