30 Pages

Lect3a

Course: COMP 3320, Fall 2009
School: Allan Hancock College
Rating:
 
 
 
 
 

Word Count: 1881

Document Preview

Floating COMP3320/COMP6464: Point Numbers Alistair Rendell COMP3320 Lecture 3-0 Copyright c 2008 The Australian National University 3.1 Rational It is extremely important that all scientic programmers have a basic understanding of numerical data representation and error propagation catastropic failure of the Ariane 5 rocket in 1996 and the inability of Patriot missile systems to reach their targets during...

Register Now

Unformatted Document Excerpt

Coursehero >> California >> Allan Hancock College >> COMP 3320

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Floating COMP3320/COMP6464: Point Numbers Alistair Rendell COMP3320 Lecture 3-0 Copyright c 2008 The Australian National University 3.1 Rational It is extremely important that all scientic programmers have a basic understanding of numerical data representation and error propagation catastropic failure of the Ariane 5 rocket in 1996 and the inability of Patriot missile systems to reach their targets during the 1991 Gulf war were both attributed to numerical computing errors Ariane 5 Explosion (1996) - data conversion of too large number (trying to stu a 64-bit number into a 16-bit eld) - problem came to light as Ariane 5 was faster than Ariane 4. Patriot-Scud fails again (1991) Mars Orbiter loss (1999) - due to inaccurate calculation of the time since computer boot time - mixture of miles and meters See http://wwwzenger.informatik.tu-muenchen.de/persons/huckle/bugse.html COMP3320 Lecture 3-1 Copyright c 2008 The Australian National University 3.2 Floating Point Numbers Most scientic problems are concerned with continuous phenomena, e.g time distance, velocity, temperature - i.e. real numbers not integers Computers operate in an exact discrete world An understanding of how oating point arithmetic is handled on computers is fundamental to scientic computing - all computers (CPUs) of interest have separate oating point and integer arithmetic units Numerical analysis deals with the design and analysis of the behaviour of algorithms for solving scientic problems COMP3320 Lecture 3-2 Copyright c 2008 The Australian National University 3.3 Sources of Error Before computation begins - modeling - empirical measurements - previous computations - mistakes During computation - approximation error (truncation or discretization error) - rounding error Accuracy of nal result inevitably reects combination of approximations, and perturbations may be amplied by mature of problem or algorithm COMP3320 Lecture 3-3 Copyright c 2008 The Australian National University 3.4 Approximation Error Dierence between true result (for actual input) and result that would be produced by given algorithm using exact arithmetic, e.g. - approximation of a series x2 x3 xn = 1 + x + + + e = n=0 n! 2 6 x ex - numerical derivative N is large n=0 xn n! f (x + h) f (x) f (x) = lim h0 h f (x + h) f (x) f (x) h (h is small) COMP3320 Lecture 3-4 Copyright c 2008 The Australian National University 3.5 Rounding Error Dierence between result produced by given algorithm using exact aritmetic and result produced by same algorithm using rounded arithmetic - due to inexactness in representation of real numbers and arithmetic operations upon them - eects like 1/3 + 1/3 + 1/3 = 0.9999 COMP3320 Lecture 3-5 Copyright c 2008 The Australian National University 3.6 Total Computation Error Total Computation Error = Approximation Error + Rounding Error - but usually one of these is dominant (see labs) COMP3320 Lecture 3-6 Copyright c 2008 The Australian National University 3.7 Absolute and Relative Error Error Absolute = Value Approximate Value True Value Approximate = (Value True)(1 + Relative Error) Va = Vt(1 + ) Absolute Error Relative Error Error Relative = (Error Absolute)/(Value True) (Absolute Error)/(Value Approximate) True value is usually unknown - so we must estimate or bound error rather than compute it exactly Likewise relative error is often taken to be relative to approximate value, rather than true value COMP3320 Lecture 3-7 Copyright c 2008 The Australian National University 3.8 Floating Point Numbers Characterised by - : base or radix - t: the precision (signicant gures) - [L, U ]: exponent range Number (e.g. 1.23456 1013) represented as d1 d2 d3 dt1 e x = (d0 + 1 + 2 + 3 + + t1 ) 0 di 1 i = 0, 1, 2, , t 1 LeU d0d1d2 dt1 mantissa (d1d2 dt1 behind decimal place) e is the exponent COMP3320 Lecture 3-8 Copyright c 2008 The Australian National University 3.9 Typical Floating Point Systems Most computers use binary ( = 2) arithmetic System t L U IEEE SP 2 24 -126 127 IEEE DP 2 53 -1022 1023 Cray XMP 2 48 -16383 16384 HP Calculator 10 12 -499 499 IBM Mainframe 16 6 -64 63 IEEE by far most common Note trade-o between t and [L, U ] COMP3320 Lecture 3-9 Copyright c 2008 The Australian National University 3.10 Normalization Floating point system is normalized if leading digit d0 is always nonzero - mantissa m of nonzero oating point number always 1m< Why - unique representation of each number - no digits wasted on leading zero - in binary system the leading bit need not be stored COMP3320 Lecture 3-10 Copyright c 2008 The Australian National University 3.11 Properties of Floating Point Systems FP number system is nite and discrete Number of normalized FP numbers 2( 1) t1(U L + 1) + 1 Smallest and largest positive normalized number - underow level = UFL = l - overow level = OFL = U +1(1 t) FP numbers are equally spaced only between successive powers of Not all real numbers are exactly representable - those that are, are called machine numbers COMP3320 Lecture 3-11 Copyright c 2008 The Australian National University 3.12 IEEE Single Precision (32 Bits) = 2, t = 24 (normalized), L = 126, U = +127 2(2)23(127+126+1)+1 numbers 1 2 3 4 Sign(1) Special Cases Exponent(8) 9 10 11 Mantissa(23) 32 - zero - innity (plus and minus) - not a number (nan) - sub-normal numbers COMP3320 Lecture 3-12 Copyright c 2008 The Australian National University 3.13 Special Cases: Single Precision 0 0000 1110 1010 0011 1111 1011 0100 111 Valid IEEE Single Precision Number 0 0000 0000 0000 0000 0000 0000 0000 000 IEEE +0 1 0000 0000 0000 0000 0000 0000 0000 000 IEEE -0 0 1111 1111 0000 0000 0000 0000 0000 000 IEEE + 1 1111 1111 0000 0000 0000 0000 0000 000 IEEE 1111 1111 NON ZERO IEEE Not A Number (NAN) COMP3320 Lecture 3-13 Copyright c 2008 The Australian National University 3.14 Example Floating Point System 4.0 = 2, t = 3(normalized), L = 1, U = +1 (25 numbers) Sign d0 d1 d2 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 e decimal 1 3.5 1 3.0 1 2.5 1 2.0 0 1.75 0 1.50 0 1.25 0 1.0 -1 0.875 -1 0.75 -1 0.625 -1 0.5 0 0.0 Overflow limit 3.0 2.0 1.0 Underflow Limit 0.0 Underflow Limit 1.0 2.0 3.0 Overflow limit 4.0 OFL = (1.11)2 21 = 3.510, UFL = (1.00)2 21 = 0.510 Note grainy and unequally spaced COMP3320 Lecture 3-14 Copyright c 2008 The Australian National University 3.15 Rounding Rules Non-machine numbers must be approximated to nearby FP number - termed rounding and introduces rounding error - denote as f l(x) Rounding rules - chop: truncate x after (t 1) digit (round toward zero or round down) - round to nearest IEEE uses rounding to nearest COMP3320 Lecture 3-15 Copyright c 2008 The Australian National University 3.16 Machine Precision Accuracy of FP system characterized by quantity called unit round-o error or machine precision, or machine epsilon, denoted by mach - chopping: = mach 1t - nearest: mach = 1/2 1t Maximum relative error in representing real number x is given by: f l(x) x x mach COMP3320 Lecture 3-16 Copyright c 2008 The Australian National University 3.17 Machine Precision = 224 107 53 1016 mach = 2 For IEEE FP systems - Single Precision: - Double Precision: mach IEEE SP and DP have 7 and 16 decimal digits of precision respectively Machine precision and UFL are VERY dierent 0 < UFL < mach < OFL COMP3320 Lecture 3-17 Copyright c 2008 The Australian National University 3.18 Machine Precision: Toy System mach Round to nearest: = 1/2 1t = 0.125 f l(x) x x Exponent -1 0.500 -1 0.500 -1 0.500 -1 0.500 0 1.000 0 1.000 0 1.000 0 1.000 1 2.000 1 2.000 1 2.000 1 2.000 Err1 = Err2 = x 0.500 0.625 0.750 0.875 1.000 1.250 1.500 1.750 2.000 2.500 3.000 3.500 f l(x) 0.562 0.688 0.812 0.938 1.125 1.375 1.625 1.875 2.250 2.750 3.250 f l(x) x f l(x) Err1 0.111 0.091 0.077 0.067 0.111 0.091 0.077 0.067 0.111 0.091 0.077 Err2 0.125 0.100 0.083 0.071 0.125 0.100 0.083 0.071 0.125 0.100 0.083 1 1 1 1 1 1 1 1 1 1 1 1 Mantissa 0 0 1.000 0 1 1.250 1 0 1.500 1 1 1.750 0 0 1.000 0 1 1.250 1 0 1.500 1 1 1.750 0 0 1.000 0 1 1.250 1 0 1.500 1 1 1.750 COMP3320 Lecture 3-18 Copyright c 2008 The Australian National University 3.19 Subnormal Numbers and Gradual Underow Normalization causes gap around zero 4.0 3.0 2.0 1.0 0.0 1.0 2.0 3.0 4.0 Subnormal or denormalized numbers permit leading digit to be zero only for minimum exponent. 4.0 3.0 2.0 1.0 0.0 1.0 2.0 3.0 4.0 Subnormal Numbers Subnormal numbers extend range of magnitude representable, but they have less precision and unit roundo is the same Allows system to exhibit gradual underow COMP3320 Lecture 3-19 Copyright c 2008 The Australian National University 3.20 Errors and Floating Point Arithmetic Require, x op y = f l(x op y) - IEEE systems achieve this as long as (x op y) is within the range of the FP system Some familiar laws of real arithmetic are not valid! - FP addition and multipication are commutative (a b = b a), but NOT associative ((a + b) + c = a + (b + c)) - e.g if is a small positive number slightly less than mach (1 + ) + = 1 + = 1 BUT 1 + ( + ) > 1 COMP3320 Lecture 3-20 Copyright c 2008 The Australian National University 3.21 Cancellation Subtraction of two t-digit numbers with same sign and similar magnitude yields fewer than t digits - leading digits of two numbers cancel, e.g. 192.403 192.275 000.128 = 1.28000 101 Exact result but cancellation often implies serious loss of information - e.g. < mach correct result of 2 entirely lost (1 + ) (1 ) = 1 1 = 0 COMP3320 Lecture 3-21 Copyright c 2008 The Australian National University 3.22 Error Propagation: Addition/Subtraction Addition/subtraction - add or subtract absolute errors b = 2.0 0.1 c = 3.0 0.3 a = b + c = 5.0 0.4 = 0.1/2.0 = 0.05 c = 0.3/3.0 = 0.10 a = 0.4/5.0 = 0.08 b c relative error averaged a = b b+c b+c COMP3320 Lecture 3-22 Copyright c 2008 The Australian National University 3.23 Error Propagation: Multiplication/Division Multiplication/Division b = 2.0 0.1 c = 3.0 0.3 a = = = = - add or subtract relative errors = 0.1/2.0 = 0.05 c = 0.3/3.0 = 0.10 b bc (2.0 0.1) (3.0 0.3) 6.0 (0.6 + 0.3) 6.0 0.9 a = 0.9/6.0 = 0.15 relative error summed COMP3320 Lecture 3-23 Copyright c 2008 The Australian National University 3.24 Real Life Error Progagation errors = N N = Number of operations = Error per operation Good algorithms usually give 1GHz UltraSparc performs 2 109 oating point operations per second - Compute for 1 hour N = 7.2 1012 operations - N 3 106 - compare to single precision mach 107 Virtually all accuracy is lost Need to be very carefull about error propagation COMP3320 Lecture 3-24 Copyright c 2008 The Australian National University 3.25 Assessing Rounding Errors Examine eect of using higher precision Consider famous example from Rump in 1988 (IBM S/370) a = 77617.0, b = 33096.0 single precision f = 1.172603 . . . double precision f = 1.1726039400531 . . . extended precision f = 1.172603940053178 . . . However true result is Even the sign is wrong! f = 333.75b6 + a2(11a2b2 b6 121b4 2) + 5.5b8 + a/(2b) f = .82739605994682135 5 1017 While this is an extreme example of catastrophic cancellation in an inherently unstable function there must be a better way! COMP3320 Lecture 3-25 Copyright c 2008 The Australian National University 3.26 Interval Arithmetic: A New Floating Point Paradigm We are all familiar with representation of uncertainity using the (x ) notation, but this is cumbersome for computation, instead we dene an interval as - a range of numbers bounded by the intervals endpoints - e.g. the range 378 to 432 would be written as [378,432]. Evaluating a function in an interval, gives another interval - how long to double your money if invested at a compound interest rate of between [3,6]% per annum - answer is the interval [11yr. 7mo., 23yr.2mo.] Interval computations do not always increase interval width - evaluate f (x) = ln(x)/x over interval X=[2.716,2.718] - answer is the interval [0.3678793,0.3678795] COMP3320 Lecture 3-26 Copyright c 2008 The Australian National University 3.27 Improved Numerical Accuracy Two common ways to improve numerical accuracy and reduce interval width - reduce interval width of input values - increase the number of interval data values used to compute interval bounds First is obvious the second is more subtle - given n interval observations of the same true value, the best way to compute a narrow interval bound is not to compute the average, but rather the intersection - every observation must contain the correct value, so must their intersection COMP3320 Lecture 3-27 Copyright c 2008 The Australian National University 3.28 Support for Interval Arithmetic C++ and Fortran95 contain language constructs to enable abstract mathematical data types - use of classes/modules, user dened types and operator overloading This is okay for matrices, but less good for intervals - Suns Fortran95 has been augmented to include an interval data type - there is a proposal to include intervals in future Fortran standards - UltraSPARC III includes some hardware support for interval instructions COMP3320 Lecture 3-28 Copyright c 2008 The Australian National University 3.29 Use of Intervals The use of intervals in numerical computation is still very much an area of research, although there is a growing argument that projects like ASCI should require intervals (see Gustafson). Use to track rounding errors - assign to each variable an interval related to machine precision - propagate computation Use to accurately reect uncertainty Fundamentally new approaches - used in rening the value of the gravitational constant G - solution of non-linear equations - global optimisation We may briey explore the use of intervals in the labs COMP3320 Lecture 3-29 Copyright c 2008 The Australian National University
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Allan Hancock College - COMP - 3320
COMP3320/COMP6464: High Performance Microprocessors Alistair RendellSee: High Performance Computing, Dowd and Severance, Chapter 2 Structured Computer Organization, Tanenbaum, Chapter 8 in Ed 3 Great Microprocessors of the Past and Present, http:/ww
Allan Hancock College - COMP - 3320
COMP3320/COMP6464: High Performance Processors Multiple Register Sets! Alistair RendellSee: High Performance Computing, Dowd and Severance, Chapter 2 Structured Computer Organization, Tanenbaum, Chapter 8 in Ed 3 SPARC Architecture, Assembly Languag
Allan Hancock College - COMP - 3320
PROGRAMMINGSCIENTIFIC PROGRAMMINGEditor: Paul F. Dubois, paul@pfdubois.comJAVA AT MIDDLE AGE: ENABLING JAVA FOR COMPUTATIONAL SCIENCEBy George K. ThiruvathukalNOT LONG AFTER THE MOSAIC WEB BROWSER APPEARED AND NETSCAPE COMMUNICATIONS FORMED,
Allan Hancock College - COMP - 3320
COMP3320/COMP6464: The UltraSPARC Family Alistair RendellSee: High Performance Computing, Dowd and Severance, Appendix A Structured Computer Organization, Andrew S. Tanenbaum, Edition 4COMP3320 Lecture 8-1 Copyright c 2008 The Australian National
Allan Hancock College - COMP - 3320
R V28 I B4 V 2 8 R I A~ A 4 2 2 ~ a 6 4 V 8 6 V~ A r I B 6 4 XWUTobSRnPXW7 54SRbrn9Pb {wXI p A a~ I ~ 2 A 2 6 4 A 6 R 2 6 6 A R A 62 R V p R 82 4 I~ 9P rbbS~S~$7oPI SR#Dd7oX PI 5roXd pdPrXWU9D7#PqPt w R I v 6 R V28 6 A a 4A 6 R |
East Los Angeles College - MATH - 3733
1111.1MATH3733Random WalkWiener process or Brownian motion (BM) is a continuous time analogue of a random walk with very small steps. There is a strict theorem like CLT behind this. Random walk Wn (t) with steps = 1/n is defined as Wn (0) = 0;
East Los Angeles College - MATH - 1725
Lecture 3: Revision notes about normal distributionA continuous random variable X has a normal distribution with mean and variance 2 if its probability density function (pdf) is f (x) = Write X N(, 2 ). Reasons for importance 1) Many data sets
Allan Hancock College - COMP - 3320
UltraSPARC-II(TM): The Advancement of UltraComputingGary Goldman and Partha TirumalaiSPARC Technology Business - Sun Microsystems, Inc. 2550 Garcia Ave., Mountain View, CA 94043AbstractUltraSPARC-II extends the family of Suns 64-bit SPARC V9 m
Allan Hancock College - COMP - 3320
COMP3320/COMP6464: Post Risc, the Intel Family and beyond! Alistair RendellSee: High Performance Computing, Dowd and Severance, Appendix A Structured Computer Organization, Andrew S. Tanenbaum, Edition 49.2The MIPS R10000 Processor: Continued #2
Allan Hancock College - COMP - 3320
W. Alabama - CS - 448
Student ID 20060318 20060336 20060359 20060700 20060839 20061018 20061063 20061123 20061542 20061787 20061822 20062441 20062721 20062820 20062848 20063436 20063825 20064137 20064772 20064899 20064908 20065275 20065404 20065794 20065839 20065902 20066
Allan Hancock College - COMP - 3320
COMP3320/6464: The OpenMP Programming Model Alistair RendellSee: www.openmp.org High Performance Computing, Dowd and Severance, Chapter 11 Introduction to Parallel Computing, 2nd Ed, A. Grama, A. Gupta, G. Karypis, V. Kumar Parallel Programming in O
East Los Angeles College - MATH - 2790
# R code used in lecture 9 - Example 3.7 Finding the key#count&lt;-numeric(500)# set count = 0for(k in 1:500){count[k]=0}# loop for 500 simulations# each simulation is a sequence of Bernoulli trials ending in a successfor(k in 1:500){flag&lt;-0 #
Allan Hancock College - COMP - 3320
COMP3320/COMP6464: Optimizing Compilers Alistair RendellIn order to write high level language code that produces ecient machine code, you really need to understand how compilers and linkers translate high-level source statements into executable mach
Allan Hancock College - COMP - 3320
Redbooks PaperViktors BerstisFundamentals of Grid ComputingThe purpose of this IBM Redpaper is to provide discussion material about grid computing, concepts, use, and architecture. Grid computing represents unlimited opportunities in terms of bus
Allan Hancock College - COMP - 3320
COMP3320/COMP6464: Hardware Performance Counters Alistair Rendell See various articles linked to lecture note web site7.2Hardware Performance Counters All (nearly?) modern microprocessors have them Typically a group of registers that keep trac
Allan Hancock College - COMP - 3320
Chapter 2Message-Passing ComputingSlides for Parallel Programming Techniques &amp; Applications Using Networked Workstations &amp; Parallel Computers 2nd Edition, by B. Wilkinson &amp; M. Allen, 2004 Pearson Education Inc. All rights reserved.2.1Message
Allan Hancock College - COMP - 3320
Distributed Memory and Cluster ComputersAlistair Rendell(Adapted From Parallel Programming, Techniques and Applications using Networked Workstations and Parallel Computers, B. Wilkinson and M. Allen, Prentice Hall)1.1Message-Passing Multicomput
Allan Hancock College - COMP - 3320
Some comments only-Q. Run mpipingpong on 2 CPUs. You will find that the code appears to stopafter reporting results for 65536bytes. Why is this? Fix it!It stops because you have both processes wanting to send at the sametime. This works okay f
Allan Hancock College - COMP - 3320
Cache Oblivious Matrix Transposition: Simulation and ExperimentDimitrios Tsifakis, Alistair P. Rendell* and Peter E. StrazdinsDepartment of Computer Science, Australian National University Canberra ACT0200, Australia dtsifakis@ieee.org, alistair.re
Allan Hancock College - COMP - 3320
THE AUSTRALIAN NATIONAL UNIVERSITY First Semester Examination June 2005 COMP3320/COMP6464/Honours High Performance Scientic Computing Study Period: 15 minutes Time Allowed: 3 hours Permitted Materials: Calculator Exam questions total 70 marks. COMP3
Allan Hancock College - COMP - 3320
5.2.1Global R RegistersA1Registers R[0] R[7] refer to a set of eight registers called the global registers (labeled g0 through g7). At any time, one of MAXGL +1 sets of eight registers is enabled and can be accessed as the current set of globa
Allan Hancock College - COMP - 3320
Towards Linear Scaling MD COMP3320/6464Code Kernelfor (i=1; i&lt;total_atoms; i+) for (j=0; j&lt;i; j+) r2 = (at[i].x at[i].x)^2 + (at[i].y (at[i].z at[i].z)^2 PE += 1.0/r2^6 2.0/r2^3 f_x = (12.0/r2^7 12.0/r2^4)(at[i].x f_y = (12.0/r2^7 12.0/r2^4)(
Allan Hancock College - COMP - 3320
COMP3320/COMP6464: Operation Balance and Memory Access Patterns Alistair RendellSee: High Performance Computing, Dowd and Severance, Chapter 812.2Example: Vector Rotation Consider vector rotation by angle (where (c, s) = (cos , sin ) - Vector
Allan Hancock College - COMP - 2400
COMP2400-2005-051Australian National University Department of Computer ScienceCOMP2400/COMP6240Assignment 1 SQL Queries Deadline : 5.00pm Friday 19 August 2005 1 IntroductionSQL is a widely used standard on the relational database scene. It
Allan Hancock College - COMP - 2300
Data RepresentationCharacters and Stringsq text can be stored in memory by using a number to represent every character q Refs: O'H&amp;Bryant sect 2.1,2.4, Null&amp;Lobur sect 2.52.7, Tanembaum appendix B,related web linkss ASCII (American Standard Co
Allan Hancock College - COMP - 2600
Structural InductionCOMP2600 Formal Methods for Software EngineeringBen Lippmeier Australian National University Semester 2, 2008COMP 2600 Structural Induction1Structural InductionWhat is covered in this topic. Induction on the natural
Allan Hancock College - COMP - 3600
The Australian National University Department of Computer ScienceCOMP3600/COMP6466 in 2008 Assignment Two(Due: 5pm Friday, October 24 Late Penalty: 25% per day) Question 1.(50/50 for COMP3600 and 40/50 for COMP6466) Given two integers n and M wit
Allan Hancock College - COMP - 8400
THE AUSTRALIAN NATIONAL UNIVERSITY First Semester Examination June 2008 COMP8400 Algorithms and Techniques for Data Mining Study Period: 15 minutes Time Allowed: 3 hours Permitted Materials: One A4 page with notes on both sides. NO calculator permit
Allan Hancock College - COMP - 3420
DataPreprocessing Lecture12:Overviewofdatapreprocessing Lecture13:Descriptivedatasummarization Lecture14:Datacleaning Lecture15:Dataintegration/transformationanddata reduction Lecture16:Discretizationandconcepthierarchy generationandsummaryL
Allan Hancock College - COMP - 2400
SQL&gt; - cae August 2006SQL&gt; SQL&gt; drop table VideoHistory;Table dropped.SQL&gt; SQL&gt; create table VideoHistory as 2 select * from tvs.video;Table created.SQL&gt; SQL&gt; alter table VideoHistory 2 add YearSold number(4);Table altered.SQL&gt;
Allan Hancock College - COMP - 2400
- copy the file student.sql into the SQL*Plus buffer and - execute by typing '/' on the next line.SQL&gt; get student.sql 1 - A V Peterson 05-07-2005 2 - Student( StudentId, Surname, Initials, Degree ) 3 CREATE TABLE Student 4 ( 5 S
Allan Hancock College - COMP - 2400
SQL&gt; start enrolment.sqlSQL&gt; - AV Peterson 05-07-2005SQL&gt; SQL&gt; - Enrolment( StudentId, CourseCode, Mark, Year, Sem, Grade )SQL&gt; SQL&gt; CREATE TABLE Enrolment 2 ( 3 StudentId NUMBER(7), 4 CourseCode VARCHAR(8), 5 Year NUMBER(4),
Allan Hancock College - COMP - 2400
SQL&gt; - cae August 2006SQL&gt; SQL&gt; select length, incolor, count(*) 2 from movie 3 group by length, incolor; LENGTH INCOL COUNT(*)- - - 34 true 34 false 19 83 true
Allan Hancock College - COMP - 2400
SQL&gt; start q16.sqlSQL&gt; - A V Peterson 26-07-2005SQL&gt; - Q16 How many students are enrolled in COMP2400 in 2005?SQL&gt; SQL&gt; SELECT COUNT(*) 2 FROM Enrolment 3 WHERE CourseCode = 'COMP2400' 4 AND Year = 2005 5 / COUNT(*)
Allan Hancock College - COMP - 2400
SQL&gt; set pagesize 250SQL&gt; select nvl(soldto, 'No-one'), movieid 2 from video;NVL(SOLDTO MOVIEID- -No-one 1No-one 2No-one 3No-one 5No-one 72001/00002 112001/0000
Allan Hancock College - COMP - 2031
0 1 2 3 4 5 6 7 -19 3 5 6 2 -12 3 -10 -1
Allan Hancock College - COMP - 2300
2006 COMP2300 Exam Q2 (C Programming)[20 marks](a) Write a function int palindrome(char *str, int len) which for thegiven input string str of length len determines if it is a palindrome ornot. A palindrome is defined as a sequence of charact
Allan Hancock College - COMP - 2300
COMP2300-2006-CourseAdminThe Australian National University1Faculty of Engineering &amp; Information TechnologyDepartment of Computer Science COMP2300-2006-CourseAdmin 2006 Course Administration1 PreambleThis document gives a brief description o
Allan Hancock College - COMP - 2300
COMP2300-2007-CourseAdminThe Australian National University1Faculty of Engineering &amp; Information TechnologyDepartment of Computer Science COMP2300-2007-CourseAdmin 2007 Course Administration1 PreambleThis document gives a brief description o
Allan Hancock College - COMP - 2300
Data Representationq Refs: O'H&amp;Bryant sect 2.1,2.4, Null&amp;Lobur sect 2.52.7, Tanembaum appendix B,related web linksq bit, byte and word q characters and strings, ASCII q big-endian, little-endian q representing real numbersCOMP2300 D2: Data Rep
Allan Hancock College - COMP - 2300
PeANUt Module OverviewPeANUt The Basicsq a simple microprocessor simulator for teaching purposes q main topics: s s s sPeANUt architecture, machine and assembly language programming branches and conditions, loops, input/output, traps, macros p
Allan Hancock College - COMP - 2300
From Physical Memory To Virtual Memory: Understanding the Memory HierarchyAlistair RendellMemory Chips: DRAM Alternative to SRAM 1 capacitor and 1 transistorData off line Capacitor stores (10-15F) Just 40,000 electrons!Address LineTransi
Allan Hancock College - COMP - 2300
THE AUSTRALIAN NATIONAL UNIVERSITY Mid Semester Examination, April 2007 COMP2300 (Introduction to Computer Systems ) Writing Period: 1 hour duration Study Period: 0 minutes duration Permitted Materials: One A4 page with notes on both sides. NO calcul
Allan Hancock College - COMP - 2300
PeANUt Module Overviewq a simple microprocessor simulator for teaching purposes q main topics: s s s sPeANUt architecture, machine language and assembler programming branches and conditions, loops, input/output, traps, macros procedures and functi
Allan Hancock College - COMP - 2300
Allan Hancock College - COMP - 2300
Consider ( x 1)( x 7) y= ( x 11)With x = 10 we may proceed as (10-1) = 9 (10-7) = 3 Writing (9*3) = 27 intermediates on paper (10-11) = -1 27/(-1) = -27A Stack A Last In First Out (LIFO) data structure Consider a pile of paper we can pu
Allan Hancock College - COMP - 2300
COMP2300: OS and VM-related exam questions, 2007Q4(b) In both paging and set-associative caches, the least recently used(LRU), first-in-first-out (FIFO) and random replacement policies may beused. In general, which of these performs best and wh
Allan Hancock College - C - 2300
#include &lt;stdio.h&gt;int main(){ int i, total; total=0; for (i=0; i&lt;20; i+) { if (i &lt; 8 ){ continue; } else if (i &gt; 4 &amp; i &lt; 12){ total=total+i; } else if (i &gt; 10) { break; } else { tota
Allan Hancock College - COMP - 2300
#include &lt;stdio.h&gt;int main(){ int i, total; total=0; for (i=0; i&lt;20; i+) { if (i &lt; 8 ){ continue; } else if (i &gt; 4 &amp; i &lt; 12){ total=total+i; } else if (i &gt; 10) { break; } else { tota
Allan Hancock College - COMP - 2300
Assembly Level Machine OrganisationLecture 4Procedures in PeANUt Number systems (bases) in .mli les Procedure / function calls Nested procedures The stack Stack pointer Stack addressing mode Stack frame Reference: Specication of the PeANU
Allan Hancock College - COMP - 2300
Assembly Level Machine OrganisationLecture 9Bit operations and traps in PeANUt Bitwise operations Traps Trap concept PeANUt traps Trap handler and trap table Debugging References: Specification of the PeANUt computer (2.8.3 and Appendix B
Allan Hancock College - COMP - 2300
Module 2: The C programming languageLecture 4Various C assert(.) Multi-module programs #dene (Macros) Compilation and linking revisited The last word on C1COMP2300, 2006Module 2: The C programming languageLecture 4assert(.) assert
Allan Hancock College - COMP - 2300
Assembly Level Machine OrganisationLecture 1PeANUt Module Overview A simple microprocessor simulator for teaching purposes Main topics PeANUt architecture, machine language and assembly programming Branches and conditions, loops, input/outpu
Allan Hancock College - COMP - 2300
Assembly Level Machine OrganisationLecture 7Some announcements Assignment 1 is due next Wednesday 5th April at 12:00 (noon) Assignment 2 will be released towards the end of next week (draft version rst) (due in week 11, Wednesday 17th May) Lab
Allan Hancock College - COMP - 2300
Welcome to COMP2300 Introduction to Computer SystemsUltraSPARC III Cu processor layout(a rather advanced computer system!)COMP2300 2006 Lecture 1: Introduction20061Course Contactq Course web site: http:/cs.anu.edu.au/Student/comp23
Allan Hancock College - COMP - 2300
Examination Preparation LectureFinal examination Saturday, 17 June, 9:15 am 12:30 am, Sports Hall Please verify date, time and location 15 minutes reading time (9:15-9:30) Permitted material: A4 page (one sheet) with notes on both sides (no a
Allan Hancock College - COMP - 2300
Memory Systems and Modern MachinesLecture 2Announcements Assignment 1 will be returned in labs this week and marks will become available in StReaMS tomorrow (Tuesday) Some students will not see any marks (but will receive an e-mail.) :-( Lab 5
Allan Hancock College - COMP - 2300
#include&lt;stdio.h&gt; int main(void) { FILE *fp; int i; fp = fopen(&quot;myfile.txt&quot;,&quot;r+&quot;);
Allan Hancock College - C - 2300
#include &lt;stdio.h&gt;int main(void) { short int *x; /* x is a pointer to a variable of type int */ short int a = 2; printf(&quot; sizeof(a) = %d\n&quot;,sizeof(a); printf(&quot; sizeof(x) = %d\n&quot;,sizeof(x); x = &amp;a; /* The address of a is assigned to
Allan Hancock College - COMP - 2300
#include &lt;stdio.h&gt;int main(void) { short int *x; /* x is a pointer to a variable of type int */ short int a = 2; printf(&quot; sizeof(a) = %d\n&quot;,sizeof(a); printf(&quot; sizeof(x) = %d\n&quot;,sizeof(x); x = &amp;a; /* The address of a is assigned to