Machine using just One Instruction
You must have heard about RISC(Reduced Instruction Set Computing) and CISC(Complex Instruction Set Computing). But what is this OISC ?
OISC is One Instruction Set Computing, where means a whole machine works on only one instruction. (technically, only one OpCode).
Okay, if you feel totally lost here [totally new to Micro-processors], then here I try to explain concepts about instruction sets:
Reduced instruction set computing, or RISC is a CPU design strategy based on the insight that simplified (as opposed to complex) instructions can provide higher performance if this simplicity enables much faster execution of each instruction. A computer based on this strategy is a reduced instruction set computer (also RISC).
Example : ARM architecture (this is used in Apple iPads) , AMD x29 (this was what AMD developed previously, now discontinued)
A complex instruction set computer (CISC) is a computer where single instructions can execute several low-level operations (such as a load from memory, an arithmetic operation, and a memory store) and/or are capable of multi-step operations or addressing modes within single instructions. The term was retroactively coined in contrast to reduced instruction set computer (RISC).
Example : x86 architecture. (Intel processors like Pentium are based on this architecture)
So, what actually are these instructions? These are the only things that a microprocessor can understand. Based on the instruction the execution is done.
Coming back to the OISC :
Common choices for the single instruction are:
- Subtract and branch if less than or equal to zero
- Subtract and branch if negative
- Reverse subtract and skip if borrow
- Move (used as part of a transport triggered architecture)
The subleq instruction ("SUbtract and Branch if Less than or EQual to zero") subtracts the contents at address a from the contents at address b, stores the result at address b, and then, if the result is not positive, transfers control to address c (if the result is positive, execution proceeds to the next instruction in sequence)
Pseudocode:
subleq a, b, c
The above instruction means
Mem[b] = Mem[b] - Mem[a]
; if (Mem[b] ≤ 0) goto c
I could understand the use of this single instruction only after going through an addition example.
For example, take a look at the following pseudo code – addition of two numbers using the one instruction:
Addition is done by repeated subtraction, without any conditional branching; e.g., the following instructions result in the content at location a being added to the content at location b:
ADD a, b == subleq a, Z
subleq Z, b
subleq Z, Z
The first instruction:
1st instruction: Z= Z – a => Z becomes (-a).
2nd instruction: b = b – Z = b – (-a) = b+a.
The addition is over.
3rd instruction: Z = Z – Z
The 3rd instruction is to restore the zero value to Z.
Interesting right?
Interested in even more? Yes there is a lot more which even I am going through. Infact there are even Zero instruction set computer (ZISC) and No instruction set computer (NISC) which, frankly, I never knew! Anyways more examples and info about OISC here.
I felt the topic interesting and more over easy to learn (also it helped me getting a quick revision of my microprocessor concepts) and so shared it here.
No comments:
Post a Comment