Digital_components.Componentmodule type S = sig ... endt is mostly abstract, but we expose is as a constructor so that the type checker knows that t is injective.
val sexp_of_t :
( 'i -> Sexplib0.Sexp.t ) ->
( 'o -> Sexplib0.Sexp.t ) ->
( 'i, 'o ) t ->
Sexplib0.Sexp.tval sexp_of_input : ( 'i, _ ) t -> 'i -> Digital_components__.Import.Sexp.tval sexp_of_output : ( _, 'o ) t -> 'o -> Digital_components__.Import.Sexp.tval output : ( 'i, 'o ) t -> 'i -> 'ooutput returns the output based on an input and its current state, but does not update the state. A component is called "combinational" if output t i ignores t. A component is called "sequential" if output t i uses t. A sequential component is called a "moore machine" if it ignores i and a "mealy machine" if it uses i.
val update_state : ( 'i, _ ) t -> 'i -> Digital_components__Import.Unit.tupdate_state updates t's state based on an input and its current state
val run_with_inputs :
( 'i, 'o ) t ->
'i Digital_components__Import.List.t ->
('i * 'o) Digital_components__Import.List.trun_with_inputs t is runs length is steps with t, on each step calling update_state and then output, pairing the input of that step with the output.
module Next_input : sig ... endval run_until_finished :
?show_steps:Digital_components__Import.Bool.t ->
( 'i, 'o ) t ->
first_input:'i ->
next_input:( 'o -> 'i Next_input.t ) ->
Digital_components__Import.Unit.tmodule Combinational : sig ... endval create_combinational : ( 'i, 'o ) Combinational.t -> ( 'i, 'o ) tval and_ :
( Digital_components__Import.Bool.t * Digital_components__Import.Bool.t,
Digital_components__Import.Bool.t )
tval or_ :
( Digital_components__Import.Bool.t * Digital_components__Import.Bool.t,
Digital_components__Import.Bool.t )
tval not_ :
( Digital_components__Import.Bool.t, Digital_components__Import.Bool.t ) tval flip_flop :
Digital_components__Import.Unit.t ->
( Digital_components__Import.Bool.t, Digital_components__Import.Bool.t ) tmodule Flip_flop_with_load_enable : sig ... endmodule Flip_flop_with_load_enable_and_reset : sig ... end