opcode and operands, Basic Computer Science

Opcode and operands:

Let us further assume that our computer can process only two-digit decimal numbers, i.e. there can be a maximum of two operands each of a maximum of two digits. Thus the computer can add or subtract numbers containing a maximum of two digits. A simple instruction can thus be written as a combination of an opcode and its associated operands. Opcode is denoted by its unique binary code. The operands are decimal digits and therefore also need to be converted to binary code system to pass them as operands to the processor. Suppose BCD code is used to represent the operands. Then following are examples of some valid instructions on the processor:

 

791_opecode.png

In the first instruction, the first three bits represent the opcode and the remaining sixteen bits represent the two operands each a two digit decimal number expressed using BCD code. The opcode for addition  as described in the table is 000 and the BCD codes for 9,3,2 and 5 are 1001, 0011, 0010 and 0101 respectively. Thus the instruction 0001001001100100101 represents 93 + 25. Similarly, in the second instruction, first three bits represent the opcode and the  remaining eight bits specify the operand to perform the operation. However, this is the case of a very simple hypothetical computer. Real world processors are much more complex and capable of performing more than 500 machine instructions. Further they can  take their operands in a number ways: directly, from registers, from memory etc. Moreover, modern processors can perform calculations on large numbers. Thus an instruction in a modern CPU could easily comprise  more than 50 bits.      

Posted Date: 10/22/2012 3:43:22 AM | Location : United States







Related Discussions:- opcode and operands, Assignment Help, Ask Question on opcode and operands, Get Answer, Expert's Help, opcode and operands Discussions

Write discussion on opcode and operands
Your posts are moderated
Related Questions
Open Systems Interconnection (OS1): As there are many different protocols for LANs and WANs, communication between two different systems can be difficult. The International St

QUESTION (a) Give the two conditions required by a binary tree of depth d to be an almost complete binary tree. (b) Determine what the following recursive C function compute

Identify three factors to consider in determining the competitive value of information technology. Justify the selected factors. Of the factors selected, determine if each fact

I have assignment in Date mning can you help me

The use of manage files very much facilitates the creation of files and programmer can focus on other aspects of the programming lacking worrying on details which can be handled by

Previous to we can perform writing to the disk it is essential to define the data transfer region using for this end the 1AH function of the 21H interruption. The 1AH function does

History of E-mail: Internet based E-mail system was designed by a Computer engineer - Ray Tomlinson in late 1971 while working with ARPANET. Tomlinson used a file transfer pro

PROGRAMMABLE ROM (PROM): The user can program a PROM after purchase.  Each memory bit element in the PROM contains a nichrome or silicon link that acts as a fuse.  The user can

Moderns: As it was explained earlier, communications channels can operate in either the Analog or digital mode. However, a given circuit can operate only in one mode not both

Microcontroller: A highly integrated microprocessor designed specifically for use in embedded systems. Microcontrollers typically includes an integrated CPU, memory (a small amount