HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

What are the minimum memory requirments a microprocessors must have to perform any calculation?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
microprocessorsthecalculationwhatmustareanyminimumperformmemory

Problem

Please excuse my ignorance in low level things. A lot of the written below might be very wrong.

As far as I understand (and I might be very wrong), there are two types of memory locations a microprocessor can have: registers and stacks.

My question is what is the most basic set of memory locatiins a microprocessor must have to perform an arithmetic calculation of unlimited complexity, such as : 12 / (11 / (4 - 7) * 31) + 8.

For example one register is obviously not enough. What about three registers? Or one stack? Or a stack and a register? Given e.g. one stack and a register, can the CPU perform any calculation?

The CPU should be able to perform any calculation like in the example shown above.

Solution

unlimited complexity?

That requires unlimited memory, after all - the numbers must be stored somewhere, and the place to store them is always in memory.

So you need 1 memory 'cell' for each number, and another for each operation. You also need a counter to keep track of the next number or operation. Add to that a register to perform the calculation (only 1 is needed as you can use it to store the results in-place. In reality you'll use another register to notify you of errors such as overflow or division by zero).

Or to put it another way: you need sufficient RAM, an accumulator and a program counter. You can get away without the counter if the memory are streamed in sequentially on a specialist computing machine (eg on tape as per Euphoric's comment).

Context

StackExchange Computer Science Q#28740, answer score: 7

Revisions (0)

No revisions yet.