English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

a simple instruction in asembly language such as "add 4 and 5" may look like 00111101001 in machine language . How computer realize which is "add" instruction and which are numbers in the set of above binary nombers ?

2006-07-28 22:57:54 · 3 answers · asked by Shamiul_islam 1 in Computers & Internet Software

someone have answered that two numbers of th instruction is stored in different resister and passed through adder circuit to calculate summation . but what's happen when numbers are to be subtracted , multiplied or divide . doe simple calculator also calculate in the same way ? does calculator also contain resister

2006-07-28 23:52:22 · update #1

3 answers

actually an instruction like add 4 and 5 would translate into something like
MVI R1, 4
MVI R2, 5
ADD R1, R2
in assembly
It would then be translated into its sequence of opcodes as
00111100
00111101
01111100
now assume that the electronic circuit of your processor looks at high bits as a high voltage of say 5V and the low bits as 0 V
so as soon as the 1st instruction is read (00111100), into memory the relevant electronic voltages are generated and 4 gets stored in Register R1. Similarly 5 gets stored in register R2. The last instruction selects the adder circuit and passes the contents of the two registers to it as input which then outputs the sum which then gets stored in one register as well

I obviously did a lot of simplification here for you. Read up some computer architecture and you will get a cleared picture maybe. But I hope I put you on the right track!

2006-07-28 23:08:26 · answer #1 · answered by Neil 5 · 0 0

Think of it as two registers:
101010101011010
010101010101001
the computer recognizes the operand, say, Add.
This is done through truth tables (i.e., symbolic logic) comparing column by column and putting the result into a third register. Different logics will result in different operations (add, subtract, etc.).

2006-07-29 09:03:28 · answer #2 · answered by williamh772 5 · 0 0

i assembly things are either in registers or given immidiately.either case a 2 or 3 byte refers to the instruction.memory has a directory of codes which matches to yr input and finds out what kind of instuction it is..

2006-07-28 23:05:07 · answer #3 · answered by karishma 3 · 0 0

fedest.com, questions and answers