1 / 11

CS149D Elements of Computer Science

CS149D Elements of Computer Science. Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 7: 9/17/2002. Outline. Chapter 2 Data Manipulation Example of Program execution on the sample machine architecture introduced in the previous lecture

jefferyk
Download Presentation

CS149D Elements of Computer Science

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. CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 7: 9/17/2002 CS149D Fall 2002

  2. Outline • Chapter 2 Data Manipulation • Example of Program execution on the sample machine architecture introduced in the previous lecture • Other machine architectures • chapter 2 plan • covered sections 2.1-2.3, • Covered logical operations in section 2.4 • Skipped 2.5 • covered 2.6 CS149D Fall 2002

  3. Example of program execution • Example of adding 2 values • Get first value from memory and place in a register R1 • Get second value from memory and place in another register R2 • Activate addition circuitry with R1 and R2 as inputs and R3 to hold results • Store contents of R3 (result) in memory • Stop 1. 156C LOAD 5, 6C 2. 166D LOAD 6, 6D 3. 5056 ADD 0, 5, 6 4. 306E STORE 0, 6E 5. C000 HALT • Instruction is 2 bytes • Values to be added stored in 2’s complement notation at memory address 6C and 6D • Sum placed in memory at address 6E CS149D Fall 2002

  4. Example of program execution Program Program stored in Memory 1. 156C 2. 166D 3. 5056 4. 306E 5. C000 1 memory cell is 8 bits Program stored in consecutive addresses at address A0 CS149D Fall 2002

  5. Example of Program Execution Place address A0 in program counter and start machine Machine Cycle 1 Program Counter PC Instruction Register IR Control unit starts a new cycle CS149D Fall 2002

  6. Example of Program Execution Machine Cycle 2 PC is A2 Program Counter PC Instruction Register IR Control unit starts a new cycle CS149D Fall 2002

  7. Example of Program Execution Machine Cycle 3 PC is A4 Program Counter PC Instruction Register IR Control unit starts a new cycle CS149D Fall 2002

  8. Example of Program Execution Machine Cycle 4 PC is A6 Program Counter PC Instruction Register IR Control unit starts a new cycle CS149D Fall 2002

  9. Example of Program Execution Machine Cycle 5 PC is A8 Program Counter PC Instruction Register IR CS149D Fall 2002

  10. Logical Operations revisited 10011010 10011010 10011010 AND 11001001 OR 11001001 XOR 11001001 ________ ________ _________ 10001000 11011011 01010011 00001111 11110000 11111111 AND 10101010 OR 10101010 XOR 10101010 ________ ________ _________ 00001010 11111010 01010101 CS149D Fall 2002

  11. Other Machine Architectures • CISC Complex Instruction Set Computer • Complex machine that can decode and execute a wide variety of instructions • Easier to program (single instruction performs the task of several instructions in RISC) • Complex CPU design • To reduce required circuitry, use microprogram approach where each machine instruction is actually executed as a sequence of simpler instructions • Example is Pentium processors by Intel • RISC Reduced Instruction Set Computer • Simple machine that has a limited instruction set • Simpler CPU design • Machine language programs are longer than CISC counterpart because several instructions are required to perform the task of a single instruction in CISC • Example is PowerPC developed by Apply, IBM and Motorola • Other concepts: Pipelining, multiprocessor machines CS149D Fall 2002

More Related