440 likes | 569 Views
CDA 3100 Spring 2009. Special Thanks. Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course. Class organization. Class web page http://www.cs.fsu.edu/~zzhang/CDA3100_Spring_2009.htm Academic honor code
E N D
Special Thanks • Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course
Class organization • Class web page • http://www.cs.fsu.edu/~zzhang/CDA3100_Spring_2009.htm • Academic honor code • Programs you submitted must be your own work • While discussions of class materials and assignments are allowed, copying of solutions is strictly prohibited CDA3100
Class Communication • This class will use class web site to post news, changes, and updates. So please check the class website regularly • Please also make sure that you check your emails on the account on your University record CDA3100
Required Textbook • The required textbook for this class is • “Computer Organization and Design” • The hardware/software interface • By David A. Patterson and John L. Hennessy • Third Edition • Morgan Kaufmann Publishers, part of Elsevier • 2007 • We will cover chapters 1-4, part of 5, and appendix A,B CDA3100
Lecture Notes and Textbook • All the materials that you will be tested on will be covered in the lectures • Even though you may need to read the textbook for review and further detail explanations • The lectures will be based on the textbook and handouts distributed in class CDA3100
Programming Environment at CS • For this class, we will use “linprog” most of the time • “linprog” is a machine stack, consisting of four Pentium III machines • Running Linux 2.6.9 • Another available machine stack is “program”, consisting of four Sun workstations (Sun-Fire-V240, sparc ISA) • Running SunOS 5.10 • Using ssh to remotely login to these machines CDA3100
What you will learn to answer (among other things) • How does the software instruct the hardware to perform the needed functions • What is going on in the processor • How a simple processor is designed
Computer System Overview • A computer system consists of hardware and software that are combined to provide a tool to solve problems (with best performance) • Hardware includes CPU, memory, disks, printers, screen, keyboard, mouse ... • Software includes • System software • A general environment to create specific applications • Application software • A tool to solve a specific problem CDA3100
Computer System Overview – cont. CDA3100
Steps to Run a C Program • First we need to compile the program CDA3100
Steps to Run a C Program • Then we need to run the program • The operating system locates where the program is • Then it loads the program into memory • The instructions in the program are then executed one by one • When the program is done, the operating system then releases the memory and other resources allocated to the program CDA3100
Opening the Box CDA3100
A Pentium 4 Processor Chip CDA3100
Five Classic Components CDA3100
Hierarchical Abstraction • We focus on principles underlying these computer systems using hierarchical abstractions CDA3100
Hierarchical Abstractions • Applications/systems software • Assembly/machine language • Architectural issues: i.e., caches, virtual memory, pipelining • Boolean logic, 1s and 0s • Sequential logic, finite state machines • Combinational logic, arithmetic circuits • Transistors used to build logic gates (CMOS) • Semiconductors/silicon used to build transistors • Properties of atoms, electrons, and quantum dynamics • In this class we focus on the software-hardware interface • Known as the instruction set architectures (ISA) CDA3100
Instruction Set Architecture • A very important abstraction • Interface between hardware and low-level software • Standardizes instructions, machine language bit patterns, etc. • Advantage: different implementations of the same architecture • Modern instruction set architectures • IA-32, PowerPC, MIPS, SPARC, ARM, …
Market CDA3100
Why This Class Important? • If you want to create better computers • It introduces necessary concepts, components, and principles for a computer scientist • By understanding the existing systems, you may create better ones • If you want to build software with better performance • If you want to have a good choice of jobs • If you want to be a real computer science major CDA3100
Career Potential for a Computer Science Graduate http://www.jobweb.com/studentarticles.aspx?id=904&terms=starting+salary CDA3100
Career Potential for a Computer Science Graduate Source: NACE Fall 2005 Report(http://www.jobweb.com/resources/library/Careers_In/Starting_Salary_51_01.htm) CDA3100
Numbers • Numbers are abstraction of quantities • http://www.debtclock.com/ • How do we represent these quantities? CDA3100
We humans naturally use a particular numbering system Decimal Numbering System CDA3100
Decimal Numbering System • For any nonnegative integer , its value is given by • Here d0 is the least significant digit and dn is the most significant digit CDA3100
Decimal Numbering System • For any nonnegative integer , its value is given by val = 0; While there are more digits, end CDA3100
General Numbering System – Base X • Besides 10, we can use other bases as well • In base X, the value of CDA3100
General Numbering System – Base X • Besides 10, we can use other bases as well • In base X, the value of val = 0; While there are more digits, end CDA3100
Commonly Used Bases • Note that other bases are used as well including 12 and 60 • Which one is natural to computers? • Why? CDA3100
Meaning of a Number Representation • When we specify a number, we need also to specify the base • For example, 10 presents a different quantity in a different base There are 10 kinds of mathematicians. Those who can think binarily and those who can't... http://www.math.ualberta.ca/~runde/jokes.html CDA3100
Conversion between Representations • Now we can represent a quantity in different number representations • How can we convert from one representation to another one? • For example, how can we convert a decimal number to binary? • How can we then convert a binary number to a decimal one? • How can we convert between base X1 and base X2? CDA3100
Conversion Between Bases • From binary to decimal example CDA3100
Conversion Between Bases • From octal to decimal • From hexadecimal to decimal CDA3100
Conversion Between Bases • From base X to decimal (base 10) CDA3100
Conversion Program CDA3100
Conversion from Decimal to Base X • Given 5023ten, what is the representation in the following bases? • Binary? • Hexadecimal? • Octal? CDA3100
Conversion from Decimal to Base X • We have the following formula • How do we generate d0? CDA3100
Conversion from Decimal to Base X • We have the following formula • How do we generate d0? • Divide by X, the reminder is d0 • How do we generate d1? • Divide the quotient by X again and the reminder is d1 CDA3100
Conversion between Two Bases • We can always do the conversion in two steps, from base1 to decimal and from decimal to base2 • In some cases, the conversion is straightforward • For example, we often need to convert between a binary number and a hexadecimal number CDA3100
Number Representations in Computers • Binary is the natural choice for computers • Since computers consist of transistors which have two different states • Additionally, for efficiency, we typically use a fixed number of bits • unsigned char • unsigned short • unsigned int • unsigned long • The least significant bit is the rightmost bit while the most significant bit is the leftmost bit • Overflow occurs if a number can not be represented correctly in the given format CDA3100