Download presentation
Presentation is loading. Please wait.
1
CDA 3100 Spring 2009
2
Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course
3
Class organization Class web page
11/22/2018 Class organization Class web page 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 11/22/2018 CDA3100 CDA3100
4
11/22/2018 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 s on the account on your University record 11/22/2018 CDA3100 CDA3100
5
Required Textbook The required textbook for this class is
11/22/2018 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 11/22/2018 CDA3100 CDA3100
6
Lecture Notes and Textbook
11/22/2018 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 11/22/2018 CDA3100 CDA3100
7
Programming Environment at CS
11/22/2018 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 11/22/2018 CDA3100 CDA3100
8
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
9
Computer System Overview
11/22/2018 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 11/22/2018 CDA3100 CDA3100
10
Computer System Overview – cont.
11/22/2018 Computer System Overview – cont. 11/22/2018 CDA3100 CDA3100
11
Steps to Run a C Program First we need to compile the program
11/22/2018 Steps to Run a C Program First we need to compile the program 11/22/2018 CDA3100 CDA3100
12
11/22/2018 CDA3100
13
Steps to Run a C Program Then we need to run the program
11/22/2018 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 11/22/2018 CDA3100 CDA3100
14
11/22/2018 Opening the Box 11/22/2018 CDA3100 CDA3100
15
A Pentium 4 Processor Chip
11/22/2018 A Pentium 4 Processor Chip 11/22/2018 CDA3100 CDA3100
16
Five Classic Components
11/22/2018 Five Classic Components 11/22/2018 CDA3100 CDA3100
17
Hierarchical Abstraction
11/22/2018 Hierarchical Abstraction We focus on principles underlying these computer systems using hierarchical abstractions 11/22/2018 CDA3100 CDA3100
18
Hierarchical Abstractions
11/22/2018 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) 11/22/2018 CDA3100 CDA3100
19
Instruction Set Architecture
11/22/2018 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, … CDA3100
20
11/22/2018 Market 11/22/2018 CDA3100 CDA3100
21
Why This Class Important?
11/22/2018 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 11/22/2018 CDA3100 CDA3100
22
Career Potential for a Computer Science Graduate
11/22/2018 Career Potential for a Computer Science Graduate 11/22/2018 CDA3100 CDA3100
23
Career Potential for a Computer Science Graduate
11/22/2018 Career Potential for a Computer Science Graduate Source: NACE Fall 2005 Report ( 11/22/2018 CDA3100 CDA3100
24
Numbers Numbers are abstraction of quantities
11/22/2018 Numbers Numbers are abstraction of quantities How do we represent these quantities? 11/22/2018 CDA3100 CDA3100
25
Decimal Numbering System
11/22/2018 Decimal Numbering System We humans naturally use a particular numbering system 11/22/2018 CDA3100 CDA3100
26
Decimal Numbering System
11/22/2018 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 11/22/2018 CDA3100 CDA3100
27
Decimal Numbering System
11/22/2018 Decimal Numbering System For any nonnegative integer , its value is given by val = 0; While there are more digits, end 11/22/2018 CDA3100 CDA3100
28
General Numbering System – Base X
11/22/2018 General Numbering System – Base X Besides 10, we can use other bases as well In base X, the value of 11/22/2018 CDA3100 CDA3100
29
General Numbering System – Base X
11/22/2018 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 11/22/2018 CDA3100 CDA3100
30
Commonly Used Bases Which one is natural to computers? Why? Base
11/22/2018 Commonly Used Bases Base Common Name Representation Digits 10 Decimal 5023ten or 5023 0-9 2 Binary two 0-1 8 Octal 11637eight 0-7 16 Hexadecimal 139Fhex or 0x139F 0-9, A-F Note that other bases are used as well including 12 and 60 Which one is natural to computers? Why? 11/22/2018 CDA3100 CDA3100
31
Meaning of a Number Representation
11/22/2018 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... 11/22/2018 CDA3100 CDA3100
32
11/22/2018 CDA3100
33
Conversion between Representations
11/22/2018 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? 11/22/2018 CDA3100 CDA3100
34
Conversion Between Bases
11/22/2018 Conversion Between Bases From binary to decimal example 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20 11/22/2018 CDA3100 CDA3100
35
Conversion Between Bases
11/22/2018 Conversion Between Bases From octal to decimal From hexadecimal to decimal 11/22/2018 CDA3100 CDA3100
36
Conversion Between Bases
11/22/2018 Conversion Between Bases From base X to decimal (base 10) 11/22/2018 CDA3100 CDA3100
37
11/22/2018 Conversion Program 11/22/2018 CDA3100 CDA3100
38
Conversion from Decimal to Base X
11/22/2018 Conversion from Decimal to Base X Given 5023ten, what is the representation in the following bases? Binary? Hexadecimal? Octal? 11/22/2018 CDA3100 CDA3100
39
Conversion from Decimal to Base X
11/22/2018 Conversion from Decimal to Base X We have the following formula How do we generate d0? 11/22/2018 CDA3100 CDA3100
40
Conversion from Decimal to Base X
11/22/2018 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 11/22/2018 CDA3100 CDA3100
41
11/22/2018 CDA3100
42
Conversion between Two Bases
11/22/2018 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 11/22/2018 CDA3100 CDA3100
43
Number Representations in Computers
11/22/2018 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 11/22/2018 CDA3100 CDA3100
44
Unsigned Formats and Their Ranges
11/22/2018 Unsigned Formats and Their Ranges Type (C) Number of bits Largest number (decimal) unsigned char 8 255 unsigned short 16 65535 unsigned int 32 4,294,967,295 unsigned long long 64 18,446,744,073,709,551,615 Exact arithmetic ? 11/22/2018 CDA3100 CDA3100
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.