Administrative Issues

Similar documents
1 Classical Universal Computer 3

CPU Organisation and Operation

LSN 2 Computer Processors

Central Processing Unit (CPU)

CPU Organization and Assembly Language

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

CHAPTER 7: The CPU and Memory

Chapter 5 Instructor's Manual

Notes on Assembly Language

İSTANBUL AYDIN UNIVERSITY

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

Instruction Set Design

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

Instruction Set Architecture (ISA)

MICROPROCESSOR AND MICROCOMPUTER BASICS

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Chapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC

OAMulator. Online One Address Machine emulator and OAMPL compiler.

CSC 2405: Computer Systems II

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

Computer Organization and Architecture

Let s put together a Manual Processor

(Refer Slide Time: 00:01:16 min)

Chapter 2 Logic Gates and Introduction to Computer Architecture

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis

Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013

EE361: Digital Computer Organization Course Syllabus

Microprocessor and Microcontroller Architecture

University of St. Thomas ENGR Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

An Overview of Stack Architecture and the PSC 1000 Microprocessor

Summary of the MARIE Assembly Language

San José State University Computer Science Department CS 147, Section 03 Introduction to Computer Architecture Fall, 2015

CSCI 4717 Computer Architecture. Function. Data Storage. Data Processing. Data movement to a peripheral. Data Movement

Computer Architecture Basics

Data Structures and Algorithms V Otávio Braga

MACHINE INSTRUCTIONS AND PROGRAMS

Processor Architectures

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

(Refer Slide Time: 02:39)

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

PART B QUESTIONS AND ANSWERS UNIT I

CSE 141L Computer Architecture Lab Fall Lecture 2

PROBLEMS (Cap. 4 - Istruzioni macchina)

Digital Systems. Syllabus 8/18/2010 1

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

Computer Systems Design and Architecture by V. Heuring and H. Jordan

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. COURSE CURRICULUM COURSE TITLE: COMPUTER ORGANIZATION AND ARCHITECTURE (Code: )

Guide to RISC Processors

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Operating System Overview. Otto J. Anshus

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Levels of Programming Languages. Gerald Penn CSC 324

Computer Programming. Course Details An Introduction to Computational Tools. Prof. Mauro Gaspari:

8051 hardware summary

Computer organization

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ

TYPES OF COMPUTERS AND THEIR PARTS MULTIPLE CHOICE QUESTIONS

Chapter 5, The Instruction Set Architecture Level

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX

THREE YEAR DEGREE (HONS.) COURSE BACHELOR OF COMPUTER APPLICATION (BCA) First Year Paper I Computer Fundamentals

Basic Computer Organization

PROBLEMS. which was discussed in Section

Chapter 7D The Java Virtual Machine

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

Introducción. Diseño de sistemas digitales.1

BASIC COMPUTER ORGANIZATION AND DESIGN

PROBLEMS #20,R0,R1 #$3A,R2,R4

An Introduction to Assembly Programming with the ARM 32-bit Processor Family

CS 40 Computing for the Web

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

Computer Organization

TEACHING COMPUTER ARCHITECTURE THROUGH SIMULATION (A BRIEF EVALUATION OF CPU SIMULATORS) *

High level code and machine code

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

EC 362 Problem Set #2

Computer Architectures

The Little Man Computer

ARM Microprocessor and ARM-Based Microcontrollers

Instruction Set Architecture

1 Computer hardware. Peripheral Bus device "B" Peripheral device. controller. Memory. Central Processing Unit (CPU)

Compilers I - Chapter 4: Generating Better Code

4 Machine Language. Make everything as simple as possible, but not simpler. Albert Einstein ( )

Assembly Language Programming

EE360: Digital Design I Course Syllabus

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions

Microprocessor & Assembly Language

Traditional IBM Mainframe Operating Principles

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Transcription:

CSC 3210 Computer Organization and Programming Introduction and Overview Dr. Anu Bourgeois (modified by Yuan Long) Administrative Issues Required Prerequisites CSc 2010 Intro to CSc CSc 2310 Java Programming CSc 2510 Discrete Math 2 absences allowed otherwise could be dropped Read the syllabus and policies Administrative Issues Required Textbook A HTML version avialble in https://docs.oracle.com/javase/specs/jvms/se8/html/ 1

9/2/15 Assignments About 5 programming assignments The lowest one will be dropped Penalty for late submissions is on the syllabus Must be your own work Class Policies No cell phones or laptops out during class You may be deducted points without warning Grading policies and Exams Homework (approx. 5): 20% Two tests: 15% each Final exams: 20% Weekly programming challenge assignments: 20% Attendance: 10% All re-grading requests must be made within 2 classes from returned work Two TAs Lu Yao Office: 25 Park Place (SunTrust building, 6th floor), cubicle 0650L/M/N/P/R Email: lyao2@student.gsu.edu Office Hour: MW 9:00 am to 10:00 am Rohini Boosam Office: 25 Park Place (SunTrust building, 6th floor), cubicle? Email:rboosam1@student.gsu.edu Office Hour: Tuesday 1:30 pm to 2:30 pm ; Thursday 1:00 pm to 2:00 pm 2

Expectations Writing code with loops Base conversions Especially involving decimal binary hexadecimal Binary arithmetic Basic logic operations Documenting code Why learn Assembly Language? Knowledge of assembly language is essential to understanding how computers are designed Provides the ability to optimize the code First word speed Gaming Simulations Medical equipment Second word security Knowing how to hack code CSC 3210 Computer Organization and Programming Material and images are from: Richard P. Paul, SPARC Architecture, Assembly Language Programming and C, 2nd edition, Prentice-Hall, 1999, ISBN 0-13-025596-3. 3

Layout of Richard P. Paul's Chapter 1 Hand-programmable calculator Fundamental definition of a computer Basic computer cycle Classic implementations of the computer Stack machine architecture Accumulator machine architecture Load/store machine architecture Programmable Calculators Numeric keyboard and function keys Single register accumulator Arithmetic logic unit for computations Stack provides memory LIFO data structure Pushing/popping operations No addresses for the memory cells HP-15C Programmable Calculator Emulator available at www.hp15c.com [Paul9 9]! 4

Postfix vs. Infix Postfix notation Operators follow operands 3 4 + Uses the stack to save memory No need for parenthesis Infix notation Operators are between operands 3 + 4 Need to specify order of operations -- parenthesis y = (x-1) (x-7) (x-11) (10 1) = 9 (10 7) = 3 (9 *3) = 27 (10 11) = -1 27/(-1) = -27 [Paul9 9]! 10 enter 1 10 enter 7 * 10 enter 11 / 5

Stack Operations [Paul9 9]! Use of Registers Why would we want to use registers? Registers are provided to hold constants 10 registers named r0 thru r9 3.14159 sto 0 stores value in r0 and leaves it on top of stack rcl 0 -- copy contents of r0 to top of stack Must specify register name 3.14159 sto 0 Place the constant on the stack and store value in register r0 1 Push 1, subtract, now TOP=2.14159 rcl 0 Place value of r0 on stack, TOP=3.14159 7 Push 7, subtract, TOP= -3.8584 * Multiply, TOP = -8.2631 rcl 0 Place value of r0 on stack, TOP=3.14159 11 Push 11, subtract, TOP = -7.8584 / Divide, TOP = 1.0515 6

Programmable Calculators In program mode, keystrokes not executed, code for each key is stored in memory Memory has an address and holds data Principal key designation Function keys Machine language codes for keystrokes Central processing unit Program counter holds address of next instruction to be executed sto 0 Store the number(x) entered in register 0, leaving a copy of it on the top of the stack 1 Push 1, subtract, TOP=x-1 rcl 0 Place value of r0 on top of stack, TOP=x 7 Push 7, subtract, TOP=x-7 * Multiply, TOP =(x-1)*(x-7) rcl 0 Place value of r0 on stack, TOP=x 11 Push 11, subtract, TOP =x-11 / Divide, TOP = (x-1)*(x-7)/(x-11) Have a try? g P/R f LBL A..(Put the program here) g RTN g R/S 3.172843 GSB A?How to write a program on HP15C Please refer to http://hp-15c.homepage.t-online.de/ programs.htm#prgmmode 7

Memory Memory used to store program Memory is addressed May compute memory addresses unlike registers Registers may be selected not indexed Machine language Program stored using machine language key codes of the calculator Central processing unit (CPU) executes the codes Program counter (PC) holds address of next instruction to be executed 8

Address M/C code Keystrokes Comment 000 001 44 0 sto 0 Store in register 0 002 1 1 Enter 1 003 30 - Subtract 004-005 45 0 rcl 0 Register 0 to stack 006 7 7 Enter 7 007 30 - Subtract 008 20 * Multiply 009-010 45 0 rcl 0 Register 0 to stack 011 1 1 Enter 1 012 1 1 Make it 11 013 30 - Subtract 014 10 / Divide 015-016 43 32 g Rtn Return to calculator mode [Paul9 9]! Calculator mode codes (m/c lang.) sent to ALU Program mode codes (m/c lang.) sent to memory Each machine code is stored in one addressable memory location Von Neumann Machine Contains addressable memory for instructions and data ALU executes instructions fetched from memory PC register holds address for next instruction to execute Defined an instruction cycle 9

CPU ALU PC Registers Data lines Address lines Control lines Memory I/O Von Neumann Model [Paul9 9]! Instruction Cycle pc = 0; do { instruction = memory[pc++]; decode (instruction); fetch (operands); execute; store (results); } while (instruction!= halt); Memory Figure 5.3 Structure of Random Access Memory Invitation to Computer Science, 6th Edition 30 10

Decoder Circuit Figure 4.30 Example of the Use of a Decoder Circuit Invitation to Computer Science, 6th Edition Fetch Data from Memory Figure 5.5 Organization of Memory and the Decoding Logic Invitation to Computer Science, 6th Edition 32 The Components of a Computer System Von Neumann architecture is based on the following three characteristics Four major subsystems called memory, input/output, the arithmetic/logic unit (ALU), and the control unit The stored program concept The sequential execution of instructions Invitation to Computer Science, 6th Edition 33 11

Figure 5.2 Components of the Von Neumann Architecture Invitation to Computer Science, 6th Edition 34 Machine Language Instructions Instructions that can be decoded and executed by the control unit of a computer Operation code(operator) field Unique unsigned integer code assigned to each machine language operation recognized by the hardware Operand field(s) A number Memory addresses of values on which the operation will work Depends on a Variable name specified operator Invitation to Computer Science, 6th Edition and assembler 35 Figure 5.14 Typical Machine Language Instruction Format Invitation to Computer Science, 6th Edition 36 12

Machine Language Instructions (continued) Instruction set Set of all operations that can be executed by a processor Reduced instruction set computers or RISC machines Include as little as 30 50 instructions Complex instruction set computers (CISC machines) Include 300 500 very powerful instructions Invitation to Computer Science, 6th Edition 37 Machine Language Instructions (continued) Classes of machine language instructions Data transfer Arithmetic Compare Branch Invitation to Computer Science, 6th Edition 38 Control Unit Registers and Circuits Program counter (PC) Holds the address of the next instruction to be executed Instruction register (IR) Holds a copy of the instruction fetched from memory Instruction decoder Determines what instruction is in the IR Invitation to Computer Science, 6th Edition 39 13

Figure 5.16 Organization of the Control Unit Registers and Circuits Invitation to Computer Science, 6th Edition 40 Figure 5.17 The Instruction Decoder Invitation to Computer Science, 6th Edition 41 Putting All the Pieces Together the Von Neumann Architecture Program execution phases Fetch, decode, and execute Von Neumann cycle The repetition of the fetch/decode/execute phase Invitation to Computer Science, 6th Edition 42 14

Figure 5.18 The Organization of a Von Neumann Computer Invitation to Computer Science, 6th Edition 43 Stack Machine Stack architecture does not have registers Use memory to place items onto stack Use push and pop operations for moving data between memory and the stack Must specify memory address MAR memory address register MDR memory data register IR instruction register holds fetched instruction ALU uses top two elements on the stack for all computations Stack Machine Assume address 300 holds the value 3 and address 400 holds the value 4 push [300] push [400] add pop [500] [Paul9 9]! 15

Accumulator Machine Accumulator register used as source operand and destination operand Use load and store operations to move data from accumulator from/to memory No registers or stack Must access memory often Accumulator Machine Assume address 300 holds the value 3 and address 400 holds the value 4 load 300 add 400 store 500 [Paul9 9]! Load Store Machine Initially memory limited to few hundred words Access time to all locations was the same As memory size increased time vs. cost issue arose New designs included variable access times Register file high speed memory 16

Load Store Machine Use load and store instructions between registers and memory ALU functions on registers only Register file replaces the stack of the stack machine SPARC architecture is a load/store machine Load Store Machine Assume address 300 holds the value 3 and address 400 holds the value 4 load [300], r0 load [400], r1 add r0, r1, r0 store r0, [500] [Paul9 9]! Assemblers An assembler is a macro processor to translate symbolic programs into machine language programs Symbols may be used before they are defined unlike using m4 Two pass process Once to determine all symbol definitions First Pass Once to apply the definitions Second Pass 17

Symbols A symbol followed by a colon defines the symbol to have as its value the current value of the location counter The symbol is called a label First Pass Figure 6.10 Generation of the Symbol Table Invitation to Computer Science, 6th Edition Second Pass Figure 6.13 Example of an Object Program Invitation to Computer Science, 6th Edition 18

define(y_r, r0) define(x_r, r1) define(a2_r, r2) define(a1_r, r3) define(a0_r, r4) define(temp_r, r5) Code in Sparc start: mov 0, %x_r! initialize x = 0 mov a2, %a2_r mov a1, %a1_r mov a0, %a0_r sub %x_r, %a2_r, %y_r! (x-1) sub %x_r, %a1_r, %temp_r! (x-7) mul %y_r, %temp_r, %y_r! (x-1)*(x-7) sub %x_r, %a0_r, %temp_r! (x-11) div %y_r, %temp_r, %y_r! divide to compute y 19