lecture7 - CSCI-365 Computer Organization Lecture Note :...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSCI-365 Computer Organization Lecture Note : Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson & Hennessy, 2005 Some slides and/or pictures in the following are adapted from: slides 2008 UCB 7 lw $t0, 0($2) lw $t1, 4($2) sw $t1, 0($2) sw $t0, 4($2) High Level Language Program (e.g., C) Assembly Language Program (e.g.,MIPS) Machine Language Program (MIPS) Hardware Architecture Description (e.g., block diagrams) Compiler Assembler Machine Interpretation temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; 0000 1001 1100 0110 1010 1111 0101 1000 1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111 Logic Circuit Description (Circuit Schematic Diagrams) Architecture Implementation CSCI-365 Levels of Representation int fib (int n) { if (n == 0) return 1; if (n == 1) return 1; return ( fib(n-1) + fib(n-2) ); } Example 3 Compile into MIPS Computers built on 2 key principles: 1) Instructions are represented as bit patterns - can think of these as numbers 2) Therefore, entire programs can be stored in memory to be read or written just like data Simplifies SW/HW of computer systems: Memory technology for data also used for programs Programs can be written to manipulate other programs (or self?) Big Idea: Stored-Program Concept Since all instructions and data are stored in memory, everything has a memory address: instructions, data words both branches and jumps use these One register keeps address of instruction being executed: Program Counter ( PC ) Basically a pointer to memory: Intel calls it Instruction Address Pointer, a better name Consequence #n: Everything Addressed Programs are distributed in binary form Programs bound to specific instruction set Different version for Macintoshes and PCs New machines want to run old programs (binaries) as well as programs compiled to new instructions Leads to backward compatible instruction set evolving over time Selection of Intel 8086 in 1981 for 1st IBM PC is major reason latest PCs still use 80x86 instruction set (Pentium 4); could still run program from 1981 PC today Consequence #n+1: Binary Compatibility Currently all data we work with is in words (32- bit blocks): Each register is a word lw and sw both access memory one word at a time So how do we represent instructions? Remember: CPU only understands 1s and 0s, so add $t0,$0,$0 is meaningless MIPS wants simplicity: since data is in words, make instructions be words too Instructions as Numbers One word is 32 bits, so divide instruction word into fields Each field tells processor something about instruction We could define different fields for each instruction, but MIPS is based on simplicity, so define 3 basic types of instruction formats: R-format I-format J-format Instructions as Numbers I-format : used for instructions with immediates,...
View Full Document

This note was uploaded on 11/26/2009 for the course MATH AND C CSCI365 taught by Professor Laurencetianruoyang during the Spring '09 term at St. Francis Xavier, Antigonish.

Page1 / 45

lecture7 - CSCI-365 Computer Organization Lecture Note :...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online