3 ms·
The definitions are not strict, and there is often significant overlap between the categorization types (esp. as follow-on additions are added to the initial de
by pwg 9y ago
The definitions are not strict, and there is often significant overlap between the categorization types (esp. as follow-on additions are added to the initial designs).
But generally, things fall out this way:
1) register based
Has a pool of registers, and the registers are general purpose (meaning they can be used as source or destination for most any computation operation the CPU can perform).
2) accumulator based
Has a "dignified" register (the accumulator) and most computations only happen in/out of the accumulator. Other registers exist for more specialized purposes to facilitate feeding data into and out of the accumulator. Many DSP architectures are very highly "accumulator based". General purpose CPU's, less so unless you go back in time to late 70's or early 80's architectures.
3) stack based
Has no registers (or very few) other than a stack pointer. All temporary data is stored on the stack, and all computation instructions involve computing with data items at the top of the stack and returning the result to the top of the stack. An example of such an architecture was the HP3000 system from the 70's (https://en.wikipedia.org/wiki/HP_3000#Use_of_stack_instead_of_registers https://en.wikipedia.org/wiki/HP_3000#Use_of_stack_instead_o...).
- bogomipz 9y agoThanks for the detailed explanations. I had a few questions about what you wrote: >"Has a "dignified" register (the accumulator) and most computations only happen in/out of the accumulator." I was curious about your use of the word dignified in quotes. Are you just conveying its importance or with this or something else? >"Many DSP architectures are very highly "accumulator based". " Is there something about DSP and their workloads that make accumulator based architectures a good fit? >"All temporary data is stored on the stack, and all computation instructions involve computing with data items at the top of the stack " So are computation limited to the top two positions of the stack then? As in the operands can be obtain by two pop operations and not arbitrary positions in the stack?
- pwg 9y ago> I was curious about your use of the word dignified in quotes. Are you just conveying its importance or with this or something else? Just conveying its importance. Since in a pure accumulator based architecture the accumulator is the only register into which computations can be performed, it often is quite important. > Is there something about DSP and their workloads that make accumulator based architectures a good fit? They often do a lot of operations that involve accumulating running totals of long strings of numbers, so the math operations they typically process lend themselves to a predisposition to being designed in this fashion. Beyond that I am unsure of any other reasons beyond guessing at possibilities. > So are computation limited to the top two positions of the stack then? Typically the number of stack top elements that are retrieved depend on the instruction being executed. So an add that consumes two inputs would take in the top two stack elements, and return a single sum. But an 'increment' (really just an add where one input is a constant) would only consume one stack element. There is no reason (other than the additional design complexity) that a three or four or five operand input instruction could not be designed, and it would consume its designed number of stack top positions. > and not arbitrary positions in the stack? Generally, no, in stack based systems one usually can not address arbitrary positions in the stack. However, there are always exceptions, and many systems have a "roll" operation that rotates the top X stack positions one place (a few provide a way to roll X stack top positions by Y steps), which provides a way to get at data below the top of the stack without loosing the current data that is at the top. With that said, there is probably at least one architecture that allows for specifically addressing particular stack positions without popping/rolling.
- bogomipz 9y agoThanks for the great explanations and insights, I really appreciate it. Cheers.
- deleted 9y ago[deleted]