fpbinary icon indicating copy to clipboard operation
fpbinary copied to clipboard

Add a copy method to FpBinary data type object

Open cdboschen opened this issue 4 months ago • 0 comments

This is not a bug but an enhancement request. FpBinary objects are mutable but I often use them in component structures where the value of one node in a system moves to another node (basically a register)

node_output = node_input

But if I want to maintain the state of my system at any given time, the above assignment is really creating an alias to the same node and if the input can be changed by another combinatorial operation, the output changes even if I didn't want to emulate a clock edge in my modelled digital system. So what I do now is use the copy module:

import copy as cp

node_output = cp.copy(node_input)

Other mutable data types such as lists and numpy arrays have a copy method. The request is to add a similar method to the FpBinary data type object, using the same conventions as done in my_list.copy() and my_array.copy().

cdboschen avatar Jul 24 '25 14:07 cdboschen