Fundamental Computer Architectures


Three popular architectures:

Following are the most common computer architectures, all of which use the stored program concept

1)Stack machine
2) Accumulator machine
3) Load/Store machine

Stack machine architecture


A stack machine implements a stack with registers. The operands of the ALU are always the top two registers of the stack and the result from ALU is stored in the top register of the stack. EX: JVM and HP's RPN calculators

Advantage:

Very short instructions since the operands are implicit. The destination and source address of the operands need not be specified in the instruction. This was of importance at the time when memories were expensive. Now in Java it is important to transfer the class files on the n/w

Example:
y=y +10
y' =&y
[y']= *&y= y

Operation:

Push [y'] (Push the contents of memory location rep. by y' to top of the stack)
Push 10 (Push 10 to top of the stack)
Add (Addition is performed with the contents of top two locations of the stack and the result is stored on top of stack)
Pop y' (Result is popped from top of the stack and stored in memory location represented by y' )

Accumulator Machine Architecture


An accumulator machine has a special register, called accumulator, whose contents are combined with another operand as input to the ALU with the result of the operation replacing the contents of accumulator. Ex: To Add two numbers which are in Memory Place a number into accumulator Execute add instruction ( Because other operand is directly given as an input to the ALU) Store the contents of accumulator back into memory

Example:
y=y +10
y' =&y
[y']= *&y= y

Operation:
Load [y'] (Load the contents of memory location represented by y' into accumulator)
Add 10 (Execute the Add instruction and store the result in Accumulator)
Store y' (Store the result in memory location represented by y' )

Load/Store Machine


In this Register file (group of registers) is used which provide faster access but are expensive. Group of registers are used to store the frequently accessed variables and memory is used to store the program and data The machines loads and stores the registers from memory ALU instructions Operate with registers, not with main memory for need of operands Instructions are short and have three operands and are of the format Ex: Add src1,src2,dest
Example:
y=y +10
y' =&y
[y']= *&y= y

Operation:

Load r0,[y'] (Load the contents of memory location represented by y' in r0)
Load r1,10 (Load 10 in r1)
Add r0,r1,r2 (Add the contents of r0 and r1 and store the result in r2)
Store r2,y' (Store the contents of r2 in memory location represented by y')
r0,r1,r2 are the registers

Example machine instruction

y=y +10
y' =&y
[y']= *&y= y



Control Unit << Previous
Next>> Operating system


Support us generously: contact@lessons2all.com

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus








Footer1