|
|
@ -101,7 +101,6 @@ for i in range( len(data) ): |
|
|
|
dec_val, dec_oldval = bintodec(val), bintodec(oldval) |
|
|
|
dec_val, dec_oldval = bintodec(val), bintodec(oldval) |
|
|
|
|
|
|
|
|
|
|
|
mem[address] = dec_val |
|
|
|
mem[address] = dec_val |
|
|
|
membin[address] = val |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# apply mask to address |
|
|
|
# apply mask to address |
|
|
|
address = dectobin(int(address)) |
|
|
|
address = dectobin(int(address)) |
|
|
@ -119,7 +118,7 @@ memsum, memsum2 = 0, 0 |
|
|
|
for addr, val in mem.items(): |
|
|
|
for addr, val in mem.items(): |
|
|
|
memsum += val |
|
|
|
memsum += val |
|
|
|
|
|
|
|
|
|
|
|
for addr, val in mem.items(): |
|
|
|
for addr, val in mem2.items(): |
|
|
|
memsum2 += val |
|
|
|
memsum2 += val |
|
|
|
|
|
|
|
|
|
|
|
print("Part1:", memsum) |
|
|
|
print("Part1:", memsum) |
|
|
|