Do machines understand normal arithmetic?
No. Even a simple binary add expression such as "0 + 1" is meaningless to a machine because it is far too high-level; far too abstract. Machine's only understand their own native machine code thus every operation must be converted into the low-level terms it can understand, and this usually means breaking the high-level abstraction down into a sequence of low-level operations.
The main operation of "0 + 1" is the ADD operator, but in order to invoke this operation we must first prepare the CPU registers, which typically means using the MOV operators. When we move an operand into a CPU register we either move its value (if it is within the range of a register) or we move its memory address, thus there are separate MOV operators to cater for each. For a simple ADD operation like this, we would typically move the first operand (0) into an accumulator register and the other into a user-register. We then execute the appropriate ADD operator which places the result in the accumulator. Finally, we execute another MOV operator to move the result back into main memory.
Note that even the ADD operator has several variants depending on whether the operands are integers or real numbers. For mixed-mode arithmetic the process becomes more complex because both operands must be of the same type and precision so at least one has to be converted (if the result requires a higher precision we must convert both to that higher precision). And if the converted operands or the result is too large for a single CPU register, we must break the operation down even further and perform the arithmetic in stages. This is not unlike the way we perform multiplication by multiplying the units, then multiplying the tens, and then the hundreds, and so on, before summing those products together.
But even before any of that can happen we first need to get those values into main memory. Those values might come from the user keyboard, from a user file, or from some other input device (perhaps even another program entirely) but, at some point prior to the ADD operation, we must store them in memory because that's the only way the computer can actually refer to them. And if we also have to present the result to the user, there are a variety of output devices to choose from (print the result on screen, in a file or send the output to a printer) each of which requires another series of low-level operations.
What computer programs are used in doctors offices?
Doctor's offices typically use "Practice Management" software.
portability
What is honors received in high school?
It depends on what you mean by this. Do you mean why do teachers give you honors work? If so then that is so that college recruiters will see that you worked hard during which ever year you did the work.
characteristic of Gray code
What step that converts source file directives to source code program statements.?
A pre-processor will scan your code files for directives and then evaluate the conditions specified by the directive. Then depending on the evaluation of the condition it may include certain program statements and/or ignore others before handing the "modified" source code to the compiler.
An "acronym" (means, "high name"), is a word made out of initials of several others words. Examples might be the best way to describe it:
RAdio
Detection
And
Ranging If you look at the capital letters, they spell, RADAR.
Another one:
Light
Amplification by
Stimulated
Emission of
Radiation or, LASER
Read
Only
Memory or, ROM, as in CD-ROM
and one more:
North
Atlantic
Treaty
Organization or, NATO
Technically, to be an acronym rather than an abbreviation, the resulting word must be pronounceable.
Some call 'ABC', 'CBD', or 'PDF' acronyms. They are really just abbreviations, or 'initialisms'.
Design and develop an algorithm to solve the 4 queens problem?
def queens_collide?(i, j, col, diag_plus, diag_minus) col.include?(j) diag_plus.include?(i + j) diag_minus.include?(i - j) end def place_queens(n, i, j, col, diag_plus, diag_minus) if i.zero? col elsif j.zero? false elsif queens_collide?(i, j, col, diag_plus, diag_minus) place_queens(n, i, j - 1, col, diag_plus, diag_minus) else queen_placed_ok = place_queens( n, i - 1, n, col + [j], diag_plus + [i + j], diag_minus + [i - j] ) if queen_placed_ok queen_placed_ok else place_queens(n, i, j - 1, col, diag_plus, diag_minus) end end end def queens(n) place_queens(n, n, n, [], [], []) end puts queens(4).inspect # >> [3, 1, 4, 2]
What does 'out of memory at line 100' mean?
Generally this will be part of an error message telling you that your environment ran out of memory when it tried to execute the command at the 100th line of your code.
1. Find out the address of the element A(4,5,2) where A is a 3-dimensional array with subscript limits 1≤ i ≤6, 1≤ j ≤7 and 0≤ k ≤4 when A is in row major addressing. Assume base address is 1000 and word size is 2.
Answer:
Array(depth,col,row) means A(4,5,2)
Address= BASE+ ((depthindex*col_size+colindex) * row_size + rowindex) * Element_Size
ADDRESS=1000+((4*7+5)*5+2)*2
(1000+((33*5)+2)*2
(1000+(167*2))
(1000+334)
1334How do you convert Bytes Message to text message in jms.The bytes message is coming form Queue?
public void onMessage(Message message) { BytesMessage byteMessage = (BytesMessage) message;for (i = 0; i < (int)byteMessage.getBodyLength(); i++) { buffer.append((char) byteMessage.readByte()); } String msg = buffer.toString().trim(); System.out.println("Message ==>"+msg); } Enjoy!!! S G Suresh Babu ITC Infotech, Bangalore
How to pass the parm parameter in PL1?
In JCL it would be of the form exec pgm=mypgroam, parms="/B" where the info after the "/" is the parameter strring.
When the system prototyping is most useful?
-when user request are not clear
-when few user involve in the system
-when design are complex and require concrete form
-history communication problem between user and analyst
Difference between simple and symmetrical dda line drawing algorithm?
"Simple DDA" does not require special skills for implementation.
Heap sort program in C language?
#include <stdlib.h>
#include <stdio.h>
#define uint unsigned int
typedef int (*compare_func)(int, int);
void heap_sort(int This[], compare_func func_pointer, uint len)
{
/* heap sort */
uint half;
uint parents;
if (len <= 1)
return;
half = len >> 1;
for (parents = half; parents >= 1; --parents)
{
int tmp;
int level = 0;
uint child;
child = parents;
/* bottom-up downheap */
/* leaf-search for largest child path */
while (child <= half)
{
++level;
child += child;
if ((child < len) &&
((*func_pointer)(This[child], This[child - 1]) > 0))
++child;
}
/* bottom-up-search for rotation point */
tmp = This[parents - 1];
for (;;)
{
if (parents child)
break;
if ((*func_pointer)(tmp, This[child - 1]) <= 0)
break;
child >>= 1;
--level;
}
/* rotate nodes from parents to rotation point */
for (;level > 0; --level)
{
This[(child >> level) - 1] =
This[(child >> (level - 1)) - 1];
}
This[child - 1] = tmp;
} while (--len >= 1);
}
#define ARRAY_SIZE 250000
int my_array[ARRAY_SIZE];
void init()
{
int indx;
for (indx=0; indx < ARRAY_SIZE; ++indx)
{
my_array[indx] = rand();
}
}
int cmpfun(int a, int b)
{
if (a > b)
return 1;
else if (a < b)
return -1;
else
return 0;
}
int main()
{
int indx;
init();
heap_sort(my_array, cmpfun, ARRAY_SIZE);
for (indx=1; indx < ARRAY_SIZE; ++indx)
{
if (my_array[indx - 1] > my_array[indx])
{
printf("bad sort\n");
return(1);
}
}
return(0);
}
What is 'coagulation' process?
it is a reaction inwhich a protein changes fronm a liquid state to a semi-solid state in the presence of heat.
I think you mean Supercomputers not mainframes. If so then yes they do use Super Computers. The super computers are used to handle heavy traffic as well as other tasks such as Google Search or Gmail.
The sum of 25 and 40 is 65. The process of calculating this number is known as addition, which totals two or more numbers together.
What is the difference between flowchart and decision table?
flowsheets means the flowchats will be written inthe sheets.. flowcharts means the charts flowsheets means the flowchats will be written inthe sheets.. flowcharts means the charts