adding decoder logic

This commit is contained in:
Arnav Sacheti
2025-10-16 22:35:36 -07:00
parent 2937624ee7
commit 0c66453ba0
19 changed files with 354 additions and 326 deletions

View File

@@ -13,3 +13,9 @@ class SVInt:
return f"{self.value.bit_length()}'h{self.value:x}"
else:
return f"'h{self.value:x}"
def __add__(self, other: "SVInt") -> "SVInt":
if self.width is not None and other.width is not None:
return SVInt(self.value + other.value, max(self.width, other.width))
else:
return SVInt(self.value + other.value, None)