Tuesday, August 31, 2010

Improvements to Factor's register allocator

For the last couple of months I've been working on some improvements to Factor's low-level optimizer and code generator. The major new change is that the control flow graph IR is now allowed to define registers that are used in more than one basic block. Previously, all values would be loaded from the data stack at the start of a basic block and stored to the stack at the end. Register allocation in this case is called local register allocation. Now the only time when values have to be saved to the stack is for subroutine calls. The part of the compiler most affected by this is of course the register allocator, because now it needs to do global register allocation.

I will describe the new optimizations in a future blog post and talk about global register allocation here. To help people who are learning Factor or are simply curious about what real Factor code looks like,! I've inserted lots of links from this blog post to our online code repository browser.

Instead of rewriting the register allocator from scratch, I took a more incremental approach, gradually refactoring it to operate on the entire control flow graph instead of a basic block at a time. Generalizing the linear scan algorithm to do this is relatively straightforward, but there are some subtleties. Once again, I used Christian Wimmer's masters thesis as a guide, however this time around I implemented almost the entire algorithm described there, instead of the simplification to the local case.

First, recall some terminology: virtual registers are an abstracti! on of an ideal CPUs register file: there can be arbitrarily many of them, and each one is only ever assigned to once. The register allocator's job is to rewrite the program to use physical registers instead, possibly mapping a number of virtual registers to the same physical register, and inserting spills and reloads if there are insufficient physical registers to store all temporary values used by the program.

Linearization


A local register allocator operates on a basic block, which is a linear list of instructions. For the global case, linear scan still requires a linear list of instructions as input, so the first step is to traverse the CFG in reverse post order and number the instructions.

Building live intervals


Once a linear ordering among all instructions has been stablished, the second step in linear scan register allocation is building live intervals. In the local case, a virtual register is defined in the same basic block as all of its usages. Furthermore, if we assume single assignment, then there will be only a single definition, and it will precede all uses. So the set of instructions where the register is live is a single interval, which begins at the definition and ends at the last use.

In the global case, the situation is more complicated. First of all, because the linearization chosen is essentially arbitrary, and does not reflect the actual control flow in reality, instructions are not necessarily executed in order, so if a register is defined at position A and used ! at position B, it does not mean that the register is live at e! very pos ition between A and B. Indeed, in the global case, the live "interval" of a register may consist of a number of disjoint ranges of instructions.

As an example, consider the following C program:
1: int x = ...;
2: if(...) {
3: ... a bunch of code that does not use x
4: } else {
5: int y = x + 1;
6: ... code that doesn't use x
7: }
8: ... more code that doesn't use x

The value x is live at position 1, and also at position 5. The last usage of x is at line 5, so it is not live at any position after 5, but also, it is not live at position 3 either, since if the true branch is taken, then x is never used at all. We say that x has a lifetime hole at position 3.

Another case where lifetime holes come up is virtual registers with multiple definitions. The very last step in the low level optimizer, right before register allocation, is phi node elimination. Essentially, phi node elimination turns this,
if(informal) {
x1 = "hi";
} else {
x2 = "hello";
}
x = phi(x1,x2);

into the following:
if(informal) {
x1 = "hi";
x = x1;
} else {
x2 = "hello";
x = x2;
}

Now, the value x is not live at the line x2 = "hello";, because it hasn't been defined yet, and the previous definition is not available either. So the lifetime interval for x has a hole at this location.

To represent such complex live interv! als, the live-interval data type now contains a l! ist of l ive ranges. Since basic blocks cannot contain control flow or multiple definitions, there can be at most one live range per basic block per live interval. (The only time multiple definitions come up is as a result of Phi node elimination, and since the input is in SSA form this cannot introduce multiple assignments in the same block).

Information from liveness analysis is used to construct live ranges. A basic block's live range contains the first definition of the register as well as the last use. If the register is in the "live in" set of the basic block, then the range begins at the block's first instruction, and if the register is in the "live out" set then the range ends at the block's last instruction. Note that even if a basic block has no usages of a register, it may appear in both the live in and live out sets; for example, the ! register might be defined in a predecessor block, and used in a successor block.

Allocating physical registers to live intervals


Once live intervals have been built, the next step is to assign physical registers to them. During this process, live intervals may be split, with register to memory, memory to register and register to register moves inserted in between; a single virtual register may be in different physical registers and memory locations during its lifetime.

In the local case, the allocation algorithm maintains two pieces of state; the "unhandled set", which is a heap of intervals sorted by start position, and an "active set", which is a list of intervals currently assigned to physical registers. The main algorithm removes the smallest element from the unhandled set, and then removes anything from the active set which ends before the new interval begins. The ne! xt step depends on whether or not any physical registers are f! ree. If all physical registers are taken up in the active set, then a decision is made to spill either the new interval, or a member of the active set. Spilling will free up at least one physical register. At this point, a physical register is now free and can be assigned to the new interval, which is then added to the active set. Spilling may split intervals into smaller pieces, and add new elements to the unhandled set, but since the new split intervals are strictly smaller than the original interval, the process eventually terminates. Once the unhandled set is empty, allocation is complete.

The global case is more complicated, primarily due to the presence of lifetime holes in live intervals. A third piece of state is maintained by the allocation pass. This new set, the "inactive set", contains live intervals which have not ended yet, but are currently in a lifetime hole. To illustrate, suppose we have two physical registers, R1 and R2, and three virtual registers, V1, V2, and V3, with the following live intervals:

[Program start ....... Program end]
V1: <======> <=========>
V2: <==============>
V3: <================>
^
|
Current position

Immediately before V3's live interval begins, the active set includes V2, and the inactive set contains V1, since V1 is not finished yet, but the current position is in a lifetime hole. Suppose that V1 was assigned to physical register R1, and V2 was assigned to physical register R2. In the local case, since the active set only includes one element, V1, we coul! d conclude that R2 was free, and that V3 could be assigned to ! R2. Howe ver, this is invalid, since at a later point, V1 becomes active again, and V1 uses R2. Two overlapping live intervals cannot use the same physical register. So global linear scan also has to examine the inactive set in order to see if the new live interval can fit in an inactive interval's lifetime hole. In this case, it cannot, so we have to split V3, and insert a copy instruction in the middle:
      [Program start ....... Program end]
V1: <======> <=========>
V2: <==============>
V3_1: <=========>
V3_2: <====>
^
|
Current position

With V3 split into V3_1 and V3_2, a valid register assignment is possible, with V3_1 stored in R1 and V3_2 stored in R2.

In this case, a register assignment without any spilling is possible. However, sometimes, virtual registers have to be stored to memor! y. This is done by the spilling code which uses a similar algorithm to the local case. The main complication is that in order to free up a physical register for the entire lifetime of the new interval, more than one interval may need to be split; zero or one active intervals, and zero or more inactive intervals.

Assigning physical registers to instructions


After live intervals are split, and physical registers are assigned to live intervals, the assignment pass iterates over all instructions, storing a mapping from virtual registers to physical registers in each instruction. Recall that this cannot be a global mapping, since a virtual register may reside in ! several different physical registers at different locations in! the pro gram.

The algorithm here is essentially unchanged from the local case. Two additions are that at the start and end of each basic block, the assignment pass records which registers are live. This information is used by GC checks. GC checks are performed on basic block boundaries of blocks which allocate memory. Since a register may be defined in one basic block, and used in another, with a GC check in between, GC checks need to store registers which contain pointers to a special location in the call stack and pass a pointer to this location to the GC. Some language implementations use a conservative GC to get around having to do this, but I think recording accurate pointer root information is a superior approach. This liveness information is also used by the resolve pass, coming up next.

The resolve pass


Since linear scan does not take control flow into account, interval splitting will give incorrect results if! implemented naively. Consider the following example program:
x = ...;

if(...) {
...
y = x + 1;
... some code with high register pressure here
} else {
z = x + 2;
}

If the live interval of x was spilled immediately after the line y = x + 1; then the register allocator would rewrite it as follows -- it would be spilled after the last usage before the spill point, and reloaded before the first usage after the spill point:
x = ...;

if(...) {
...
y = x + 1;
spill(x);
... some code with high register pressure here
} else {
reload(x);
z = x + 2;
}

In this case however, the spill and reload locations are in different control flow paths. However, linear scan does not take control flow into account during the main algorithm. Instead, a subsequent resolve pass. The resolve pass looks at every edge in the control flow graph, and compares the physical register and spill slot assignments of all virtual registers which are both live across the edge. If they differ, moves, spills and reloads are inserted on the edge. Conceptually, this pass is simple, but it feels hackish -- it seems that a more elegant register allocator would incorporate this into the previous stages of allocation. However, all formulations of linear scan I've seen so far work this way. The only tricky part about the resolve pass is that the moves have to be performed "in parallel"; for example, suppose we have two virtual registers V1 and V2, and two physical registers R1 and R2. Block A and block B are joined by an edge. At the end of block A, V1 is in R1, and V2 is in R2. At the start of block B, V1 is in R2 and V2 is in R1. Doing the moves in any order would give the wrong result; for correct behavior, the cyc! le has to be broken with a third temporary location. The logic for doing this in the general case is a bit complex; Doug Coleman helped me implement the mapping code.

General observations


While implementing the register allocator improvements, I relied heavily on unit testing as well as an informal "design by contract"; basically, making extensive use of runtime assertions in the code itself. The compiler.cfg.linear-scan vocabulary weighs in at 3828 lines of code; 2484 lines of this are unit tests. This is certainly! a much higher test:code ratio than most other Factor code I'v! e writte n, and some of the tests are not very useful or redundant. However, they represent a log of features and bugs I've implemented, and at the very least, minimize regressions.

When testing the register allocator, I first got it working on x86-64. Here, there are enough registers that spilling almost never occurs, so I could focus on getting the primary logic correct. Then, I hacked the x86-64 backend to only use 4 physical registers, and debugged spilling.

The whole project took a bit longer than I had hoped, but I managed to start implementing a number of additional optimizations in the meantime. When they are more complete I will blog about them.

scan valid interval

Blog Updates for September 2008

Sep 27. In PSA Screening and Early Detection Part 2 we add that the particular PSA Assay can affect the results of a PSA test: Standard PSA tests are usually standardized to the WHO 90:10 standard or standardized to the original Hybritech(R) standard. [PMID: 18801532]. If ones switches among tests using different standards then a significant difference may appear even if there is no real difference in the underlying PSA. The situation with ultrasensitive tests is even worse since there is no real harmonization at all among such tests.


Sep 27. On the Calculators page added: Mortality from Common Diseases. Four charts giving the mortality from vascular disease, cancer, infection, lung disease, accidents and all causes comb! ined given age, sex and smoking status. There are 2 simple charts: one for men and one for women and two more detailed charts again one for men and one for women. The charts are available [here] as supplements to this paper: [PMID: 18544745]. There is further discussion in [PMID: 18544738] [full text].

Sep 26. In PSA Screening and Early Detection - Part 3. Current Environment we add the following: On the other hand, in a 15 year followup of Seattle vs. Connecticut prostate cancer mortality showed no difference even though Seattle had more intensive screening and treatment than Connecticut. [PMI! D: 18795372]. This study focused on men over 65.
Sep 23. On the Calculators page and also on the Radiation risks associated with Prostate Cancer page we add: "Some patients with nonmalignant systemic diseases, like collagen vascular disease (CVD), hypertension, diabetes mellitus, and inflammatory bowel disease (IBD), tolerate radiation therapy poorly. Although the mechanisms of each of these disease processes are different, they share a common microvessel pathology that is potentially exacerbated by radiotherapy." [PMID: 11961197] [Full Text].

Sep 21. On the Calculators page and also on the Radiation risks associated with Prostate Cancer page we add: The radiation dosage calculator will estimate your lifetime radiation exposure in mSv given the types and numbers of exposures. There is a separate post on radiation risks which has more information on this area.

Sep 18. On the Community Resources we added Masschussets Prostate Cancer Coalition: MA +.

Sep 17. On the Calculators page we add: Regarding Gleason Score upgrading, note this 2008 paper! on factors making Gleason Score upgrade more likely here: [PMID: 18207180] which finds that "A total of 134 patients (50%) were upgraded postoperatively to Gleason score 7 or higher. Preoperative prostate specific antigen greater than 5.0 ng/ml (p = 0.036), prostate weight 60 gm or less (p = 0.004) and more cancer volume at biopsy, defined by cancer involving greater than 5% of the biopsy tissue (p = 0.002), greater than 1 biopsy core (p <0.001) or greater than 10% of any core (p = 0.014), were associated with pathological upgrading. Upgraded patients were more likely to have extraprostatic extension and positive surgical margins at radical prostatectomy (p <0.001 and 0.001, respectively". A second 2008 paper [PMID: 18782303] concluded that "Men with a higher PSA level, perineural invasion and high-volume cancer at biopsy are most likely to be upgraded, while men with a large prostate volume and low-volume cancer at biopsy are more likely to be downgraded. ! These findings have implications for men with prostate cancer managed without confirmation by RP of their true GS.". Also [PMID: 18778348] concludes that " risk of upgrading is a function of two opposing contributions: (i) a more aggressive phenotype in smaller prostates and thus increased risk of upgrading; and (ii) more thorough sampling in smaller prostates and thus decreased risk of upgrading. When sampled more thoroughly, the phenotype association dominates and smaller prostates are linked with an increased risk of upgrading. In less thoroughly sampled prostates, these opposing factors nullify, resulting in no association between prostate size and risk of upgrading. These findings help to explain previously published disparate results of the importance of prostate size as a predictor of Gleason upgrading.")

Sep 17. In Test! osterone Metabolism and Prostate Cancer we add: Recently i! t was di scovered that high blood calcium levels increase the risk of fatal prostate cancer; however, this refers to calcium in the prostate cancer cells and not the blood. [PMID: 18768497] [WebMD]. Also see [Urotoday] where hypotheses related to PTH and calcium are discussed.

Sep 16. In NIH Funded Research to be Open Access: Open access to NIH funded research appears to be in danger with bill HR 6845 being introduced to Congress by Congressmen John Conyers of Michigan and Howard Berman of California. This law, if enacted, would overturn the gains that open access has achieved under recently introduced US law (as described in this post below). ! See [link] for more info on this new threat.

Sep 16. In How Healthy Men Can Reduce Their Risk we add: A German company, Diapat, claims to have a urine test which is more accurate than the PSA test with a sensivitiy of 90% (i.e. of 100 patients with prostate cancer it would correctly identify 90) and a specificity of 60% (i.e. of 100 patients without prostate cancer it would correctly categorize 60). It is based on applying mass spectroscopy to the detection of various protein patterns that are present in the initial portion of a urine stream but absent in midstream. The underlying technology is claimed to be applicable not only to prostate cancer but also to cardiovascular disease, identifying 7 chronic renal diseases, early detection of diabetic ren! al failure, bladder cancer and is currently being further inve! stigated for the possibility of using it as a diagnostic for Alzheimer's disease, pancreatic cancer, renal cancer and heart failure. See the Diapat web page, this company video, this [2008 paper - Abstract] [Full Text] and this [list of references].

Sep 14. After Newly Diagnosed added direct links to [surgery check list] and ! [waiting].

Sep 13. In RP vs LRP vs RLRP. Part 3 we add: that disappointment with robotic surgery is discussed in [PMID: 18585849] [Full Text] where the authors found that the likelihood of satisfaction among patients with open surgery was higher than patients with robotic surgery. They hypothesized that the reason was not due to actual outcomes but due to having been oversold on robotic surgery resulting in expectations were too high relative to the likely outcome whereas those who had open surgery had more realistic expectations.

Sep 13. In Biochemical PSA Recurrence we added: In [PMID: 18603352] [Full Text] the authors indicate that of those with biochemical recurrence, "25% progress to distant metastases and 11% die of prostate cancer". This same reference also contains information on predicting biochemical recurrence. Several claculators on the Calculators page also can be used to estimate the risk of biochemical recurrence.

Sep 12. In Advice to the Newly Diagnosed we added: An August 2008 paper found that obesity was associated with PSA failure after surgery and external radiation but not after brachytherapy (seeds) suggesting that brachytherapy may be more advantageous for the obese. See [PMID: 18262732]

Sep 12. In Advice to the Newly Diagnosed we added this reference to a critique of the Merglen paper: [PMID: 18775078] [Full Text].

Sep 10. In How Healthy Men Can Reduce Their Risk we add: Based on recommendations by Stephen Strum (papers) published in: PCRI Insights AUGUST 2008 VOL 11: NO 3, when having your PSA tested you should try to use the same assay at the same lab and always get tested at the same time of day (morning or afternoon, say), restrain from ejaculation in the 48 hours prior to testing avoid any examination of the prostate or athletic activity which exerts pressure on the prostate area such as bicycle riding. (There is some debate on ! the recommendation of avoiding prostatic examination and athle! tic acti vity.) These steps will reduce but not eliminate the random variation that occurs from one PSA test to the next. (A more comprehensive list of factors affecting PSA can be found in the Factors Affecting PSA section of PSA Screening and Early Detection Part 2 and the results of an experiment showing the natural vartiation of PSA is discussed here.)

Sep 6. In the right margin under Links on the Medical/Uro line after Pubmed we add (tags) which links to a list of tags that can be used in Pubmed queries.

Sep 6. In NIH Funded Research to be Open Access: Note that both US Presidential candidates have pledged to double NIH funding (see McCain Obama) and since all NIH funded research is now open access this promises to sharply increase the amount of research that patients have access to.

Sep 1. In Testosterone Metabolism we add

Although this result, i.e. testosterone fuels prostate cancer, is appealing in its simplicity unfortunately there is experimental evidence that seem inconsistent with it. In particular, [PMID: 18692874] found that men with lower levels of testosterone had higher grade, i.e. more aggressive, tumors. If testosterone fuels prostate cancer one would have thought that ! those with the highest testosterone would have the least aggre! ssive tu mors. This suggests that there must be more to the model than just testosterone.

Although removal of T kills most cancer cells, consistent with the model, Friedman points out that this destruction of the cancer cells occurs through calcium influx, i.e. calcium entering, the cells. If calcium is prevented from entering the cancer cells then 70% of the cancer cells survive even in the presence of low T. Thus it seems clear that cancer cells can very well exist without T which again seems contrary to the model. See [PMID: 2235727].

Another result that contradicts the above model is the observation, albeit in a small sample study, that the 15 year survival of prostate cancer patients who had higher DHT at diagnosis tend to survive longer than ones with lower DHT at diagnosis. If DHT were truly the key critical step then one would have expected the reverse. See [PMID: 1846253! 4] [Full Text]

One study found that 65% of patients with androgen independent prostate cancer exhibited high levels of bcl-2. [PMID: 8996359].

We also elaborate on the results of Dambaki who showed that the mAR increase as cancer progresses: Since T interacts with mAR to increase bcl-2 while interacting with iAR to decrease bcl-2, at early stages when there is less mAR the effect of T is anti-cancer but as the ratio of mAR to iAR increases over time the balance tips and the net effect of T becomes pro-cancer.


Sep 1/08. In Pubmed Front Ends we added:

Every paper in Pubmed is assigned a pubmed id which can be used to retrieve the abstract:

15313934[uid]

Papers reporting on research that is funded by the U! S Nation al Institute of Health not only appear in abstract form on Pubmed but their full text also appears in Pubmed Central and a link from the abstract to the full free text is given. (Papers that appear in Pubmed Central have both a Pubmed Id and a Pubmed Central Id. There exists a page that gives one id if you know the other [here].)

prostate volume calculator

SLIET LEET SYLLABUS

SYLLABUS OF SLIET ENTRANCE TEST SET-III
FOR ADMISSION TO DEGREE PROGRAMME, 2010


PATTERN OF SET-III
SLIET Entrance Test SET-III for admission to Degree Programme will consist of two papers each of two hours duration. Paper-I : This paper will have 100 objective type questions of 100 marks from English, General Knowledge, Mental Aptitude, Mathematics, Physics and Chemistry.
Paper-II : This paper will also consist of 100 objective type questions of 100 marks from Basics of Engineering.
Note : In both the papers candidate is required to attempt all the questions. Answers of the objective type questions
are to be filled in the OMR answer sheet given separately. There will not be any negative marking.

SYLLABUS AND MODEL QUESTIONS

PAPER-I

Marks: 100 Time: 2 Hours
GENERAL KNOWLEDGE, MENTAL APTITUDE & ENGLISH
Marks: 25 (25 Questions)
S! yllabus :

The paper will include questions covering the following topics:-
1. General Science
2. Current events of National and International importance
3. History of India
4. Indian Politics and Economy
5. Indian National Movement and also General Mental ability
6. Idioms/Phrases
7. Usage of Tenses

MATHEMATICS
Marks: 25 (25 Questions)
Syllabus :
Algebra : Solution of quadratic equations, relationship between their roots and coefficients. Equations reducible to quadratic equation. Symmetric Functions of roots. Formation of a quadratic equation with given roots. Arithmetic progression, Geometric progression and Arithmetico-Geometric series. Series of natural numbers (∑ n, ∑ n2, ∑ n3). Mathematical induction. Permutations and Combinations. Binomial theorem for any index.
Trigonometry : Trigonometric ratios and their ! relations. Trigonometric Identities. T-ratios of allied angles! . Additi on and Subtraction formulae. Transformation of product into sum or difference and vice-versa. T-ratios of multiple and sub-multiple angles. Heights and distances. Solution of Trigonometric Equations. Solution of Triangles.
Coordinate Geometry : Rectangular Cartesian coordinates. Distance between two points. Section formulae. Locus of a
point. Equation of a straight line in various forms. Angle between two given lines. Condition for two lines to be parallel or
perpendicular. Distance of a point from a line. Line through point of intersection of two given lines. Concurrency of lines.
Equation of a circle in various forms including parametric form. Intersection of a circle with a straight line. Equations of
tangent and normal to a circle. Intersection of two circles. Equations of the parabola, ellipse and hyperbola in the standard
forms & parametric forms.
Calculus : Function, its domain and range. Limit, continuity and! differentiability of a function. Derivative of sum, difference,
product and quotient of two functions. Derivative of algebraic, trigonometric, exponential, logarithmic, hyperbolic and
Inverse trigonometric functions. Chain rule. Derivative of functions expressed in implicit and parametric forms. Logarithmic
differentiation. Maxima & Minima, Rate measure & Error. Equation of tangent and normal. Integration as the inverse
process of differentiation. Integration by parts, by substitution and by partial fractions. Integration of rational and irrational
functions. Definite integral and its application for the determination of area (simple cases). Trapezoidal & Simpson’s Rule
for numerical integration.

CHEMISTRY

Marks: 25 (25 Questions)
Atoms, Molecules and Chemical Arthmatic : Symbols, formulae, oxidation, reduction, oxidation number, balancing of simple chemical equations, mole concept,! empirical formulae and molecular formulae.
Chemical fam! ilies - Periodic Properties: Mendeleev’s and Modern periodic tables, classification of elements into s, p, d and f blocks, periodic properties (ionization potential, electron affinity, atomic and ionic radii, oxidation states).
Atomic Structure, Bonding and Molecular Structure: Bohr’s theory, brief description of hydrogen spectrum, the wave nature of matter, de-Broglie’s theory, Uncertainty principle, Quantum numbers, Pauli’s exclusion principle, Hund’s rule of maximum multiplicity, shapes of orbitals, electronic configuration of atoms upto atomic no. 30. Types of bonding (ionic, covalent and co-ordinate covalent), Lewis structure, VSEPR theory, orbital overlap and molecular shapes, hybridization (sp, sp2 and sp3) and molecular structure, hydrogen bond, metallic bond, Vander Walls forces.

PHYSICS

Marks: 25 (25 Questions)
Description of Motion : Motion in a straight line, uniform motion, speed a! nd velocity, equation of motion in a straight line, position time graph, instantaneous velocity and acceleration, motion in two dimensions, projectile motion, uniform circular motion, torque, angular momentum, conservation of angular momentum, centripetal and centrifugal forces, centre for mass, motion of centre of mass and momentum conservation.
Moment of Inertia: Moment of Inertia (M.I.) of rigid body, radius of gyration, theorem of parallel and perpendicular axes, M.I. of a straight rod, circular ring, circular disc, relation between torque and M.I., kinetic energy, motion of point mass tied string to the wound on a cylinder, motion of cylinder rolling without slipping on an inclined plane.
Kinetic Theory of Gasses: Boyle’s and Charles’s laws, gas equation, gas constant, pressure exerted by gas, kinetic energy of molecules, kinetic interpretation of temperature, derivation of gas laws from kinetic theory of gases. Electromagnetic Waves, Atomic and! Nuclear Physics: Production and properties of e.m. waves, spe! ctrums, nature and velocity of e.m. waves, propagation of radio waves in earth’s atmosphere, photoelectric effect, laws of photoelectric effect, production of x-rays, soft and hard x-rays, uses of x-rays, Radio activity laws, half life and average life for radioactive materials, nuclear fission and fusions.

Objective Type Questions
Fill the choice of the alternative you think to be correct answer in the OMR answer sheet.
Q1. A ball thrown up is caught by the thrower 4s after start. The height to which the ball has risen is
(assuming g =10 m/s2)
(a) 20 m (b) 10m (c) 400m (d) 2m
Q2. What determines the nature of path followed by the particle?
(a) speed (b) velocity (c) acceleration (d) none of these

PAPER-II

BASICS OF ENGINEERING

Marks : 100 (100 Questions) Time : 2 hours
COMPUTER SCIENCE AND ENGINEERING/INFORMATION TECHNOLOGY
Introduct! ion to Computer: Block diagram, basic components, concept of primary and secondary memories,
working of hard disk and magnetic tape, input/output devices; Operating System: Introduction to various
operating systems, single user, multiuser, batch processing, time sharing, real time, multiprogramming and
multiprocessing systems, distributed computing, resources management, memory management ; System
Software: Introduction, system software, application software, compilers, assemblers, loaders, linkers;
Application Development: Algorithms and flowcharts, program writing, debugging and execution, compilation,
interpretation, programming using C language, Object Oriented Programming concepts; Information
Technology: Introduction to IT, Internet and its applications, web browser, E-mail; Data management and
organization: Introduction to databases, architecture and structure of DBMS, data models, introduction to ! data
structure, arrays, linked list, stacks and queues; ! Networki ng: Applications, introduction to OSI and TCP/IP,
Networking topologies/technologies; Latest Technologies: Latest processor and memory configurations and
related technologies.
ELECTRONICS AND COMMUNICATION ENGINEERING
Conductors, semiconductors, insulators, Extrinsic & Intrinsic semiconductors. PN Junction Diode - its VI
characteristics Rectifiers, filters. BJT - various transistor configurations their input/output characteristics. FET, MOSFET their construction & characteristics. Modulation - Need & types of modulation (AM, FM, PM). Radio Receivers - TRF & superheterodyne. Pulse modulation PAM, PWM, PPM. Logic gates - Definition, symbols & truth table of NOR, OR, AND, NAND, EX-OR gates, various Flip Flops (SR, JK, T, D), Registers & counters. Operational Amplifier - Inverting & Non inverting amplifiers, Op Amp as an inverter, scale changer, adder, subtractor, differentiator, integrator.
ELECTRICAL AND INSTRUMENTATION ENG! INEERING
AC fundamentals: single phase, rms value, peak to peak value, average value. RL, RC & RLC circuits, Power & Power factor, power measurement. DC& AC Bridges: Wheatstone bridge, Maxwell’s Bridge, De-Sauty’s Bridge, Owen’s Bridge, Kelvin’s Double Bridge, Hay Bridge. Network Theorems: Thevenin’s, superposition, Norton, maximum power, reciprocity and Tellegen’s theorems. Electromagnetic & Magnetic circuits: Principle of AC & DC machines and Transformers. DC Circuits: Circuit components (resistor, inductor and capacitors) and DC Circuits resonance. Error in measurement system, Galvanometer, PMCC and Moving iron instruments, DC potentiometers, Multimeter, LED/LCD/Segment Displays, CRO, Basic components of instrumentation system, sensor & transducer, resistive, capacitive & inductive transducers. Signal Conditioning: A/D and D/A converters, filtering and impedance matching, operational amplifiers.
MECHANICAL ENGINEERING
Ther! mal Engi neering: Basic concepts, thermodynamic properties: intrinsic and extrinsic, open, closed and
isolated systems, heat and work, specific heat, thermal and thermodynamic equilibrium, Zeroth law and first law of
thermodynamics, internal energy, entropy, enthalpy. Clausius and Kelvin-Plank statement of second law, different
thermodynamic processes like isobaric, isochoric, isothermal. Elements of heat transfer, conduction, convection,
radiation.
Applied Mechanics, Strength of Material and Machine Design: Concept of mechanics and applied mechanics,
laws of forces, moments, friction and laws of motion. Stress & strain, concept of load, tensile, compressive and
shear stress and strains, stress concentration, types of loading, theories of failure, factor of safety, endurance
limit, efficiency of riveted and welded joints, keys and its types, stress in shafts, design of shafts (solid and
hollow).
Fluid Mechanics: Concept of fluid, fluid mechanics and hydraulics, properties of fluid (viscosity, specific weight, specific volume, specific gravity) with their units. Pascal’s law, concept of atmospheric pressure, gauge pressure, absolute pressure, vacuum and differential pressure.
Manufacturing Engineering & Management: Introduction and classification of engineering materials, thermal,
chemical, electrical and mechanical properties of commonly used engineering materials. Purpose of heat
treatment, hardening, case hardening, annealing, normalizing, tempering, heat treatment processes and their
applications. Arc and gas welding processes, patterns, cores, basic foundry processes and powder metallurgy.
Different machining operations, principles of operations, cutting tools and machine tools used to carry out turning,
milling, drilling, shaping & planning operations. Quality control, control charts,! acceptance sampling, TQM.
Plant location, layout and li! ne balan cing. Types of plant layouts. Inventory control, Inventory classification, and
EOQ and ABC analysis.

CHEMICAL ENGINEERING
Chemical Engineering Thermodynamics: Laws of thermodynamics, thermodynamic properties, general thermodynamic relationships. Application for open/closed systems and reversible/irreversible processes. Chemical reaction equilibrium.
Chemical Reaction Engineering: Molecularity and order of reaction, reaction kinetics, different types of ideal reactors and their performance equations.
Heat Transfer: Different modes of heat transfer with governing relationships. Heat transfer equipments and their industrial applications.
Mass Transfer: Mass transfer operations and their applications. Molecular diffusion, eddy diffusion, diffusion in
solids. Concept of distillation, crystallization, drying, absorption, equipment for separation and industrial
application. Unit operations: Sedimentation, size reduction, filtration, mixing and agitation.
Fluid flow: Fluid properties and their relationship to flow. Different type of pumps.
Material and Energy balance: Material and energy balance calculation in processes with recycle/bypass/purge. Chemical Process Industries: Raw material and process description for the manufacturing of ammonia, urea, ammonium phosphate, cement, soda ash, caustic soda, glass, sulphuric acid, hydrochloric acid and nitric acid. Degree of polymerization, types of polymerization, classification of rubbers, vulcanization of rubber. Classification and composition of crude petroleum. Raw material and various additives for paper industry. Raw material for the manufacturing and composition of oils and fats.
Process Instrumentations: Instruments for temperature, pressure, liquid level, flow and pH measurement.
Environmental Engineering and Safety: Different types of liquid, air an! d solid pollutions from industries, effect of chemical polluti! on on ec ology and environment. Pollution control methods. Hazards from wastes, toxic gases, chemicals; symptoms and their remedial action. Fire, noise pollution in industry and their control.

FOOD TECHNOLOGY
Different methods of heat transfer, Fourier’s law, Steady state heat transfer through plain and composite slab,
Cylindrical and spherical surfaces, Natural and forced convection, LMTD and effectiveness of parallel and counter
flow heat exchanger, Radiation heat transfer, Fick’s law of diffusion and basic concepts of convective mass
transfer, Moisture content on dry and wet basis, Equilibrium moisture content, Constant and falling rate phase
calculations, Critical moisture content, Concept of psychrometry and its use, Refrigeration cycles, Load
calculations, Physical properties of fluid, Classification of fluid flow, Continuity equation, Bernoulli’s theorem and its
application, Concept of! Reynold’s number and its determination, Navier-Stokes equation, Flow through parallel plates
and circular pipes, Study and performance of different type of pumps like centrifugal, reciprocating, rotary and
piston displacement pumps, valves and joints, Concept of viscosity, Newtonian and non-Newtonian fluids,
Calculation of energy required in grinding by Ritinger’s law and Bond’s law, Crushing efficiency, Mixing index, Rate of
mixing, Constant rate filtration, constant pressure filtration, Filter cake compressibility, Ultrafilteration and reverse
osmosis, Basic Separation equation, Rate of separation, liquid-Liquid separation, Centrifuge equipment like cream
separator, Bactofuge and clarifiers used in dairy industry, crystallization, Separation based on size, Effectiveness
of screens, Fineness modulas of sample, Raoult’s Law, Relative volatility, Azeotropic and extractive distillation,
Simple (different! ial) distillation, Rectification (Fractionating column) distil! lation. Thermal processing, general methods
for calculation of process time.

mole concept numericals

Math tutoring for low-achieving students

Ronnie Karsenty has written an article entitled Nonprofessional mathematics tutoring for low-achieving students in secondary schools: A case study. This article was published online in Educational Studies in Mathematics last week. The project that is reported in the article is part of a larger project (SHLAV - Hebrew acronym for Improving Mathematics Learning). The research questions in the study are:
  1. Will nonprofessional tutoring be effective, in terms of improving students' achievements in mathematics, and if so, to what extent?
  2. Which factors will be identified by tutors as having the greatest impact on the success or failure of tutoring?
Here is the abstract of the article:
This article discusses the poss! ibility of using nonprofessional tutoring as means for advancing low achievers in secondary school mathematics. In comparison with professional, paraprofessional, and peer tutoring, nonprofessional tutoring may seem less beneficial and, at first glance, inadequate. The described case study shows that nonprofessional tutors may contribute to students' understanding and achievements, and thus, they can serve as an important assisting resource for mathematics teachers, especially in disadvantaged communities. In the study, young adults volunteered to tutor low-achieving students in an urban secondary school. Results showed a considerable mean gain in students' grades. It is suggested that affective factors, as well as the instruction given to tutors by a specialized counselor, have played a major role in maintaining successful tutoring.




math tutoring online

Finding better explanations

Another advantage for individual students taking math tutoring sessions

Recently, one of my students told me:

“I like your lecture style better than my professor’s. You have a much better way of explaining the subject. He just starts doing problems, and that’s it. Last time he was having a hard time explaining how he was using the absolute value to solve a problem. We were all confused about it, nobody was understanding what he was doing.”

Sometimes when you are studying math, and you see a topic for the first time, you struggle to understand it, and you work out examples until you find a way to get it. Then if you are a teacher, and you only have that one way of understanding the ! subject, you go out teaching it that way, and sometimes you confuse all of your students.
Some teachers care a lot about their students understanding their lectures but some other teachers do not care that much. Sometimes they think: “Well, if they don’t get it, though luck.” However, teachers who care about their students understanding the subject, they spend a lot of time thinking up alternative explanations, or better examples, or better ways to illustrate what’s happening.
I remember a few times (years back when I was a teacher) I felt kind of depressed, disappointed, or frustrated at the end of a lecture because I couldn’t find a way for my students to understand what I was trying to explain. Then, afterwards, I would spend hours, days, even weeks sometimes looking for better ways to explain a particular topic, and the next time I taught that course I was able to explain those topics much better.
I noticed w! hen I started private tutoring, that really sped up the proces! s for me , of finding better explanations, because sitting with students one-on-one, and taking the time to go in depth and in detail with them over their doubts and questions, many times I was able to discover exactly how my students in class were looking at specific problems.
That allowed me to discover faster the reasons why they were not understanding a subject, or why some of my explanations were not working. By tutoring individual students, I was able to find a lot faster a lot more alternative ways of explaining subjects when my students in a large class felt the need for those better explanations.
Tutoring individual students has helped me to focus on finding the best way for each student to understand a given subject, rather than focusing only on covering the whole subject fast in front of a big class.

math tutor

as is.


so ive been thinking. ive been listening to a lot of people talking about "freedom". as in freedom in Christ. "freedom freedom freedom freedom". free from this, free from that, free from freeing freed freeople. and i get it. "who the Son sets free is free indeed" john 8:36. okay. true that. but here is where i have found myself wondering with this idea of freedom lately.
Jesus came to set us free. free from what? free from bondage and sickness and brokenness....and ultimately free from an eternity in hell.! and in my opinion it is, obviously, that last freedom that matters most. before Jesus, you were just kind of doomed. there was a million sacrifices and rituals and rules and on and on...so many and so meticulous that no man on earth could accomplish it all. so Jesus comes, which is basically Gods way of saying "follow and believe in this man, and you are free to live forever with me". thats it. the gift of salvation. awesome.
BUT we live in a broken place. and even with Jesus we are fighting to not be broken people. it is because of the sins of our first parents that we cannot experience absolute freedom here on this earth. and that is where i am headed in my thought...i dont think it is possible to experience complete freedom here. freedom in some areas, yes. but if we could be completely free here, what would be the point of heaven? the devil is alive here. he is constantly roaming the earth, and he looks to kill steal and destroy. he waits as a lion to pounce on y! ou, his prey, (job 1:7, john 10:10, 1 peter 5:8). and even wit! h Jesus alive and in our hearts, even with the Holy Spirit coursing through our veins, we are walking around in what was intended to be a holy place, but has become satans playground. its just true. so how does one experience complete freedom in that? its not possible. all that to say....what i think is God intention in us, knowing that we will not truly be free before we hit the heavenlys, is that we dont ever stop fighting, and we dont walk in fear. ive used the analogy of a slave and 2 masters before. i think i will use it again. so you are a slave, God is a master, satan is a master. God says you are free, satan says i dont think so. with God you have a running start towards your freedom, and should you continue running you will always be 2 steps ahead of satan....BUT satan will never stop chasing you. and the faster and harder you run towards God and freedom, the faster and harder he will run to catch you, and atleast grab an ankle to slow you down.
what am i saying? am i ! saying God doesnt work miracles in freeing people? NO. He SO does. what i am saying is that maybe our cry shouldnt be for freedom, but for strength and wisdom to get through what is absolutely inevitable here on this planet. maybe instead of being angry with God for not freeing us, we should be thanking Him for the ability to even wake up and face our day knowing that through Him all things are possible (phillipians 4:13). cause God doesnt give us anything we cant handle, and God can handle everything......

is to as is to analogy

Effect of acceleration on the speed Video Demonstration by ETD and NUS 2009

Effect of acceleration on the speed...
http://library.edumall.sg/cos/o.x?c=/library/reslib&ptid=84&func=prop2&id=47103&full=1

Which ball will reach the end of the track in a shorter time than the other?

Both balls moves with the same initial velocity

Green ball about to accelerate along the curve slope whenas the red ball is still moving the same roughly horizontal track

What did you notice? The green ball is ahead in terms of x direction. Explain possible reason(s) why.

What did you notice here? The green ball is still ahead in terms of x direction while its velocity is lower but still higher than the red ball's.

What did you notice here? The green ball is clearly still ahead in terms of x direction while its velocity is roughtly equal to the red ball's.&nb! sp;
hint: think in terms of the area under the graph of v vs t equal to change in displacement.

Post your answers in the comments!!


http://library.edumall.sg/cos/o.x?c=/library/reslib&uid=&ptid=84&func=prop2&id=47103 

A demonstration to show that acceleration enables an object to reach the end of a slope sooner.Collaboration with NUS Physics Associate Professor Sow Chorng Haur.
Keywords: tracks gentle slope sharp dip accelerate physics area under velocity time graph





There is another video here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=142.0
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=142.msg6114#msg6114
[quote author=lookang link=topic=142.msg6114#msg6114 date=1272589703]
FlexTrackRaces.mov
A video suitable for video analysis found here http://www.cabrillo.edu/~dbrown/tracker/mechanics_videos.zip



[b][color=red]It will be cool to have an Ejs version of the racing balls! For your consideration ;D[/color][/b]
[/quote]

A JDK applet by Fu Kwun Hwang 

graphical method in physics