From b0b2eb6ff181ae84d7a83807f47c3cec25451969 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Fri, 12 Apr 2024 15:41:55 -0500 Subject: need to re-read and spellcheck --- sudocode | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sudocode (limited to 'sudocode') diff --git a/sudocode b/sudocode new file mode 100644 index 0000000..455d885 --- /dev/null +++ b/sudocode @@ -0,0 +1,35 @@ +Booth: + result = multiplier << 1 + loop (operand length) times: + if last two bits are 01: + result(upper half) += multiplicand + if last two bits are 10: + result(upper half) += twos_comp(multiplicand) + remove extra bits from result + arithmatic shift result right + result >> 1 + +Modified booth: + multiplicand(MSB) = multiplicand(second MSB) + result = multiplier << 1 + loop (operand length / 2) times: + if last two bits are 001 or 010: + result(upper half) += multiplicand + if last two bits are 011: + result(upper half) += multiplicand * 2 + if last two bits are 100: + result(upper half) += twos_comp(multiplicand) * 2 + if last two bits are 101 or 110: + result(upper half) += twos_comp(multiplicand) + remove extra bits from result + arithmatic shift result right twice + result >> 1 + result(second MSB) = result(MSB) + result(MSB) = 0 + + + + + + + -- cgit v1.2.3