From f86343b967e98b02c5ad06bb2e8c17c8ab3446b2 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Fri, 12 Apr 2024 01:11:45 -0500 Subject: sleeby timez --- booth_multiplier.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'booth_multiplier.py') diff --git a/booth_multiplier.py b/booth_multiplier.py index c17c2f8..dab58d0 100755 --- a/booth_multiplier.py +++ b/booth_multiplier.py @@ -158,5 +158,20 @@ if __name__ == "__main__": plt.gca().set_ylabel("Number of Additions and Subtractions") plt.legend(loc='upper left') plt.savefig('report/performance.pgf') + + iters_booth = [] + iters_mod_booth = [] + for length in lengths: + iters_booth.append(length) + iters_mod_booth.append(int(length / 2)) + + plt.figure() + plt.plot(lengths, lengths, '^--m', label='booths algorithim') + plt.plot(lengths, [int(l/2) for l in lengths], 'v--c', label='modified booths algorithim') + plt.gca().set_xlabel("Operand Length") + plt.gca().set_ylabel("Number of iterations") + plt.legend(loc='upper left') + plt.savefig('report/iterations.pgf') + -- cgit v1.2.3