Skip to content

Add a copy method to FpBinary data type object #28

@cdboschen

Description

@cdboschen

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions