Overview
A program is a set of instructions, which are followed by the machine so as to generate a desired output. This means that writing a computer program is giving instructions to a processor, so as to delegate a particular job to the hardware of the computer system. Every instruction is a command given to the computer hardware to perform a specific job. Computer hardware is a digital system (collection of functional switches) and hence every instruction must be converted into the form of 0's and 1's (where a symbol 0 represents open switch and a symbol 1 represents closed switch). As an example, let us assume that we want the computer system to perform the addition of two numbers say 15 and 25. The instruction to perform addition of two numbers could be written in the machine language as shown below:
10000011 00001111 00011001
In this case, the first eight bits represent the code informing the hardware that the addition of the two numbers is to be performed. This is called as an opcode (operational code) of the instruction. Different instructions would have different opcodes and their purpose is to convey the meaning of the instruction to the internal hardware circuitry. In this case, we have assumed an arbitrary opcode of ADD instruction as 10000011. Different processors have different decoders and internal designs, hence the length and format of the opcode will certainly differ from processor to processor. Some processors have eight bit opcodes (e.g., intel 8085), some have 16 bit opcodes (e.g., intel 8086). Today's generation processors have 32 bit/64 bit opcodes or even 128 bit opcodes. We need not look into the hardware configurations and designs at this stage, but the key point to understand is that every instruction has an opcode and in this case, we just assume an arbitrary opcode of 8 bits as 10000011, which represents ADD operation. A different combination of 8 bits, say 11001010, may represent subtraction and so on. In theory, the variety of instructions any processor can offer is indirectly dependent on the length of its opcode. A processor with an opcode length of 8 bits can just offer 28 = 256 distinct instructions whereas a processor with an opcode length of 16 bits can offer 216 = 65536 distinct instructions.
Review the options below to login to check your access.
Log in with your Cambridge Aspire website account to check access.
If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.