15
Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Embed Size (px)

Citation preview

Page 1: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Introduction to CS-215

Computer Organization & Assembly Language: Module 0

Page 2: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Course topics Computer Organization

Computer Components CPU, memory, I/O devices, bus

Representing information Integers, real numbers, text characters, machine code

Arithmetic operations Assembly Language

Basic features Translation (C++ assembly language) Data structures Procedures Programmed I/O

Page 3: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Course activities

Computer Organization Representing information

Encode and decode various types of data• How is 3.14 represented by a computer?

• What unsigned integer is represented by the byte 11001010?

Arithmetic operations Demonstrate the (addition/subtraction/multiplication/division)

of two (integers/real numbers) using one of the algorithms for hardware operations presented in class

• Requires an understanding of the representations

• It is not enough to use conventional techniques and convert the result!

Page 4: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Course activities

Assembly Language Translation (C++ assembly language)

Implement a C++ code fragment in assembly language Procedures

Implement a C++ function in assembly language• Use activation records

Programmed I/O Write code which manages I/O to a device

• monitor, keyboard

Page 5: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Course resources Text: A Programmer's View of Computer Architecture,

Goodman & Miller Website: http://cs.uwm.edu/~cs215

Syllabus Lecture slides Assignments Language and simulator resources

Desire2Learn (D2L) Announcements Dropbox (assignment submission) Discussion board

Page 6: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Focus: MIPS R2000 Assembly Language

The MIPS R2000 is an old CPU from SGI Modern MIPS used in SGI workstations, Sony PS2 All MIPS chips use nearly the same assembly language MIPS assembly language is very similar to that of the

PowerPC chip, the heart of the Apple Macintosh Why MIPS R2000

Simple, easily learned language Straight-forward architecture Freely available GUI simulator: SPIM

Page 7: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

PCSpim

Initially developed at UW-Madison by James Larus More stable than its Unix counterpart

Xspim is on both miller and grid Has a graphic interface for easy debugging

More on PCSpim later

Page 8: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Why study assembly language?

Developing a more accurate model of computation is the main goal of this course

A software engineer who understands how a computer works will be able to: design more efficient code Find and fix problems with code that don't stem from

the semantics of the source language Correctly diagnose problems in a deployed application

hardware, OS, libraries, network, source code, etc.

Page 9: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

What is a model?

A model is a partial representation of a system incomplete specific purpose

Multiple models for different purposes Model of the city of Milwaukee for

MCTS bus driver MMSD engineer Bicyclist Commercial airline pilot

Page 10: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Level of detail

Eliminating distracting detail enables focus on aspects of interest, get higher level perspectives street maps for navigation do not show buildings and

topography More detail is NOT necessarily better

A detailed schematic of a car engine would not help the average motorist troubleshoot a sputtering engine

A flow chart would be better A city map that shows every alley is less useful to a

visitor than one that shows just major roads

Page 11: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Abstraction Modeling is about abstraction:

building general, high-level concept pictures Models often abstract away variation

Access to UWM computers requires authentication The authentication abstraction filters out mechanism

login-password, fingerprint recognition, ID badge, etc.

Different abstractions, levels of abstraction depending on aspects of interest, degree of expertise

Page 12: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Learning is model refinement The primary purpose of modeling is to improve

understanding Observing differences between the model and reality

shows us gaps in our understanding This is how learning works, according to educational theory Cognitive dissonance

Learn is updating our model to better predict reality

Page 13: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

Novice user’s model of computation

A computer is a machine that: Can generate video and sound, like a TV responds to input from a keyboard and a mouse

Unlike a TV must be plugged into the Internet to work properly

Like a TV needs cable, or an antenna

This is a useful model for word-processing, email, web browsing, copying CD’s, etc.

Programming requires a more detailed model

Page 14: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

CS-201 model of computation A computer is a machine

that executes a C++ program, by Executing each line of the

program sequentially, subject to control structures and function calls

Allowing the program to receive text input from the keyboard, or a file

Allowing the program to produce text output to the monitor, or a file

C++ Program

Computer

Page 15: Introduction to CS-215 Computer Organization & Assembly Language: Module 0

A more complex model of computation

A computer executes machine instructions, and can control a variety of input/output devices

Compiler language definition settings implementation details

Operating system resource allocation device management

CPU machine instructions addressing modes

CPU

Operating System

Compiler

C++ Program