2023-06-26 00:24:47 +03:00
|
|
|
from bitutilities import *
|
|
|
|
import timeit
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
reg: BasicRegister = BasicRegister(get_memory("memory"))
|
|
|
|
# print(type(reg))
|
|
|
|
|
|
|
|
print("\nRegister:")
|
|
|
|
print(reg)
|
|
|
|
|
|
|
|
print("\nReversed:")
|
|
|
|
reg.reverse()
|
|
|
|
print(reg)
|
|
|
|
|
|
|
|
print("\nShifted left:")
|
|
|
|
print([int(value) for value in reg.left_shift()])
|
|
|
|
print(reg)
|
|
|
|
|
|
|
|
print("\nShifted right:")
|
|
|
|
print([int(value) for value in reg.right_shift()])
|
|
|
|
print(reg)
|
2023-06-26 21:05:45 +03:00
|
|
|
|
|
|
|
reg2: BasicRegister = BasicRegister(get_memory("more memory"))
|
|
|
|
|
|
|
|
reg3: BasicRegister = sum(reg, reg2)
|
|
|
|
|
|
|
|
print(reg3)
|