Just some testing.
This commit is contained in:
parent
d2df4bbf28
commit
544031efbb
37
main.py
37
main.py
|
@ -1,28 +1,31 @@
|
|||
from bitutilities import *
|
||||
import bitutilities as bu
|
||||
import timeit
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
reg: BasicRegister = BasicRegister(get_memory("memory"))
|
||||
# print(type(reg))
|
||||
reg: bu.BasicRegister = bu.BasicRegister(bu.get_memory("memory"))
|
||||
|
||||
print("\nRegister:")
|
||||
print()
|
||||
print("Register 1:")
|
||||
print(reg)
|
||||
|
||||
print("\nReversed:")
|
||||
reg.reverse()
|
||||
print(reg)
|
||||
print()
|
||||
reg2: bu.BasicRegister = bu.BasicRegister(bu.get_memory("more memory"))
|
||||
|
||||
print("\nShifted left:")
|
||||
print([int(value) for value in reg.left_shift()])
|
||||
print(reg)
|
||||
print()
|
||||
print("Register 2:")
|
||||
print(reg2)
|
||||
|
||||
print("\nShifted right:")
|
||||
print([int(value) for value in reg.right_shift()])
|
||||
print(reg)
|
||||
|
||||
reg2: BasicRegister = BasicRegister(get_memory("more memory"))
|
||||
|
||||
reg3: BasicRegister = binary_sum(reg, reg2)
|
||||
print()
|
||||
reg3: bu.BasicRegister = bu.binary_sum(reg, reg2)
|
||||
|
||||
print()
|
||||
print("Sum:")
|
||||
print(reg3)
|
||||
|
||||
carry_sum_test: tuple[bu.BasicRegister, int] = bu.binary_sum(reg, reg2, True)
|
||||
|
||||
print()
|
||||
print("Sum & carry:")
|
||||
# print(type(carry_sum_test))
|
||||
print(carry_sum_test)
|
||||
|
|
Loading…
Reference in New Issue