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
One of the facilities that the use of macros provides is the formation of libraries, which are sets of macros which can be included in a program from a different file. The formatio

They are used to reduce or enlarge the content of the counters. DEC INC DEC INSTRUCTION Idea: To diminish the operator. Syntax: DEC destiny This action subtracts 1 from the destiny

What is a Structure?

Program and Programming Language : A Program is defined as a collection of statements/ instructions that enable the computer to solve a problem. The process of writing a prog

Computers can be used for better and more efficient management and organisation of laboratories. A computer like the human brain receives information, stores and processes it and t

Objectives When you have completed all the work in this unit you should be able to: List the basic components of a personal computer system, 1. describe the use of comput

The following data set describes whether a given coordinate is on land owned by XX government. (x,y) | Class ------------------------ (1.5,6) | owned (2,5) | owned (3,4) | owned (

QUESTION (a) Being just employed as junior forensic examiner at SAI computer forensic Ltd, your supervisor told you, ‘hey Moona Tambi, we have received a hard disk for examinat

You may have seen, as, that many programs can be run so that they give you with some basic information concerning how they should be run. Python permits you to do this with -h: $ p

My son has a project assignment he has problem with. The only thing is, it is due in 20 mins. can someone be able to help him? if so, how much is the fee?