uncrocks
Newbie level 6
I'm building a simple 4 function calculator out of basic logic circuits and SRAM (if it's best?).
For addition and subtraction I'll do 8-bits, so 8-bits plus overflow out, these circuits aren't the problem.
For Multiplication I have a circuit the does basic 4-bit x 4-bit multiplication, but I was thinking to reduce size I would do the following:
start with three numbers:
index
multiplicand
multiplier
then while index is less than or equal to multiplier, add multiplicand to itself, add 1 to index.
I figured I could accomplish this using SRAM to store the running sum and the index.
For division:
index
dividend
divisor
subtract divisor from dividend, add 1 to index, store in SRAM, repeat until running difference is less than dividend, then you're left with result (index) and a remainder.
The problem is, I have no idea how to accomplish any of this using SRAM. If anyone has any ideas they would be greatly appreciated.
If there's an easier way to do this than I am that would also be appreciated!
For addition and subtraction I'll do 8-bits, so 8-bits plus overflow out, these circuits aren't the problem.
For Multiplication I have a circuit the does basic 4-bit x 4-bit multiplication, but I was thinking to reduce size I would do the following:
start with three numbers:
index
multiplicand
multiplier
then while index is less than or equal to multiplier, add multiplicand to itself, add 1 to index.
I figured I could accomplish this using SRAM to store the running sum and the index.
For division:
index
dividend
divisor
subtract divisor from dividend, add 1 to index, store in SRAM, repeat until running difference is less than dividend, then you're left with result (index) and a remainder.
The problem is, I have no idea how to accomplish any of this using SRAM. If anyone has any ideas they would be greatly appreciated.
If there's an easier way to do this than I am that would also be appreciated!