1 / 9

1.3 Computation - An Introduction to Informatics -

1.3 Computation - An Introduction to Informatics -. 2008. 9. 29 WMN Lab. Hey-Jin Lee. outline. Computer Organization Storage Organization Machine Instruction Instruction cycle Euclid’s Algorithm Symbolic Languages and Higher-Level Machines. Computer Orga niza tion.

lara
Download Presentation

1.3 Computation - An Introduction to Informatics -

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1.3 Computation- An Introduction to Informatics - 2008. 9. 29 WMN Lab. Hey-Jin Lee

  2. outline • Computer Organization • Storage Organization • Machine Instruction • Instruction cycle • Euclid’s Algorithm • Symbolic Languages and Higher-Level Machines

  3. Computer Organization Arithmetic Unit : This part is capable of performing various arithmetic and other operations, as well as testing and computing the values of data. Storage Unit : This is the “memory” part of the machine where both the instructions and the data are stored. Control Unit : In general, this is for managing the operation of the entire computer system. Console Input / Output Arithmetic Unit AC Control Unit IC Figure 1-16. Computer Organization

  4. Storage Organization • A simple hypothetical machine • - Storage consists of 10,000 cells or words, each capable of holding • five decimal digits plus a sign. • - Depending on the interpretation by the control unit, a given word • can be treated as item of data or as an instruction. Addressing 0000 0001 1473 9998 9999 Storage Cell Figure 1-17. Storage Organization

  5. Machine Instruction • “single-address” instruction format • Every instruction consists of an operation and, at most, a single operand. Instruction Format Instruction set Machine Instructions Figure 1-18. Machine Instructions

  6. Instruction cycle • The control or executive part of the system continuously executes a loop. • Get instruction, say I, from the storage location addressed by ic. • Update ic to point to next instruction.(icic + 1) • Execute instruction I. • Go to step 1.

  7. Euclid’s Algorithm • Procedure for finding the gcd 0 r := m; 1 {Divide by successive subtractions.} 2 while r ≥ n do r := r-n; 3 {r = m mod n} Figure 1-20 : (m mod n) in Algolic Language Address Instruction Remarks 0201 + 1 1 0 0 0 Load m into AC. 0202 + 4 1 0 0 1 AC ← AC – n. 0203 + 8 0 2 0 5 If ( r – n ) < 0, then go to 205. 0204 + 5 0 2 0 2 r ≥ n. Repeat at 0202. 0205 + 3 1 0 0 1 ( r – n) < 0. Add n back in. 0206 + 2 1 0 0 2 Store result in r. Figure 1-21 : (m mod n) in Machine Language

  8. Euclid’s Algorithm Address Instruction Remarks 0201 + 1 1 0 0 0 Load m into AC. 0202 + 4 1 0 0 1 AC ← AC – n. 0203 + 8 0 2 0 5 If ( r – n ) < 0, then go to 205. 0204 + 5 0 2 0 2 r ≥ n. Repeat at 0202. 0205 + 3 1 0 0 1 ( r – n) < 0. Add n back in. 0206 + 2 1 0 0 2 Store result in r. Figure 1-21 : (m mod n) in Machine Language Address AC m n r ic 0201 20 20 8 -- 0202 0202 12 20 8 -- 0203 0203 12 20 8 -- 0204 0204 12 20 8 -- 0202 0202 4 20 8 -- 0203 0203 4 20 8 -- 0204 0204 4 20 8 -- 0202 0202 -4 20 8 -- 0203 0203 -4 20 8 -- 0204 0205 4 20 8 -- 0206 0206 4 20 8 4 0207 Figure 1-22 : A Trace of Execution

  9. Symbolic Languages and Higher-Level Machines • Higher-Level symbolic languages are realized on computers by providing more complex translators like compilers that produce equivalent machine language programs. • These languages relieve the programmer of responsibility for many machine details and permit him to concentrate on hi problem and algorithm.

More Related