Commit e7464560 authored by Rémi's avatar Rémi
Browse files

Update get full adders

parent b233a7a0
name = "AdderGraphs"
uuid = "818587fb-0c22-4279-a2b9-8b16b5360b71"
version = "0.2.8"
version = "0.2.9"
......@@ -86,6 +86,7 @@ export set_errors_computed!
export are_full_adders_computed
export set_full_adders_computed!
export get_origin
export get_total_nb_full_adders
export get_addernode_by_value
export read_addergraph
export write_addergraph
......@@ -106,6 +107,8 @@ export get_input_shifts
export are_negative_inputs
export get_adder_msb_in
export get_adder_lsb_in
export get_nb_full_adders
export set_nb_full_adders!
export produce_addernode
......
......@@ -67,6 +67,10 @@ function get_origin(addergraph::AdderGraph)
return addergraph.origin
end
function get_total_nb_full_adders(addergraph::AdderGraph)
return sum(get_nb_full_adders(addernode) for addernode in get_nodes(addergraph))
end
function get_addernode_by_value(addergraph::AdderGraph, value::Int)
if get_value(get_origin(addergraph)) == value
return get_origin(addergraph)
......
......@@ -126,6 +126,16 @@ end
function get_nb_full_adders(addernode::AdderNode)
return addernode.nb_full_adders
end
function set_nb_full_adders!(addernode::AdderNode, nb_full_adders::Int)
addernode.nb_full_adders = nb_full_adders
return addernode
end
# Generation
function produce_addernode(input_adders::Vector{AdderNode}, shifts::Vector{Int}, sign_switch::Vector{Bool})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment