summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/cpu.ml9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpu/cpu.ml b/cpu/cpu.ml
index 10e7bc4..592f612 100644
--- a/cpu/cpu.ml
+++ b/cpu/cpu.ml
@@ -2,7 +2,14 @@ open Netlist_gen
(* Dumb CPU that just does an 8-bit addition *)
+let sumz n i =
+ let rec res =
+ let aux = reg n in
+ fun () -> fst (Alu.nadder n i (aux res) (value "0")) ()
+ in
+ res
+
let p =
-main_2_2 (fun a b -> Alu.nadder 8 a b (value "0")) 8 8
+ main_1_1 (sumz 8) 8
let () = Netlist_proc.print stdout p