CS/COE0447 Computer Organization & Assembly Language

Slides:



Advertisements
Similar presentations
DAP teaching computer architecture at Berkeley since 1977
Advertisements

CMSC 150 DATA REPRESENTATION CS 150: Mon 30 Jan 2012.
CPU Design. CS252/Culler Lec 1.2 1/22/02 Levels of Representation (61C Review) High Level Language Program Assembly Language Program Machine Language.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 23 - Course.
Lecture 7: Instruction Set Architecture CSE 30: Computer Organization and Systems Programming Winter 2014 Diba Mirza Dept. of Computer Science and Engineering.
CEG 320/520: Computer Organization and Assembly Language Programming1 CEG 320/520 Computer Organization and Assembly Language Programming.
Data Representation in Computers
1 CS/COE0447 Computer Organization & Assembly Language Pre-Chapter 2.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Comp Sci 251 Intro 1 Computer organization and assembly language Wing Huen.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 2.
COMP3221 lec04--prog-model.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 4: Programmer’s Model of Microprocessors
CPU Internal memory I/O interface circuit System bus
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
Liang, Introduction to C++ Programming, (c) Chapter 1 Introduction to Computers, Programs, and C++
1 CS/COE0447 Computer Organization & Assembly Language CHAPTER 4 Assessing and Understanding Performance.
Computer Architecture CPSC 350
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
Computer Science I CSCI Summer 2009 David E. Goldschmidt, Ph.D.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
1 TM 1 Embedded Systems Lab./Honam University ARM Microprocessor Programming Model.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Computer Organization IS F242. Course Objective It aims at understanding and appreciating the computing system’s functional components, their characteristics,
Algorithms in Programming Computer Science Principles LO
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Chapter 3 Getting Started. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To give an overview of the structure of a contemporary.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Computer Architecture and Number Systems
Lec 3: Data Representation
Engineering Problem Solving With C An Object Based Approach
3.1 Denary, Binary and Hexadecimal Number Systems
Processor/Memory Chapter 3
Control Unit Lecture 6.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
A Closer Look at Instruction Set Architectures
CDA 3100 Summer 2011.
CS/COE0447 Computer Organization & Assembly Language
Computer Architecture CSCE 350
Data Representation – Instructions
Chapter One: Introduction
CSCI206 - Computer Organization & Programming
Programming Languages
September 24 Test 1 review More programming
CDA 3100 Spring 2010.
Machine Architecture and Number Systems
A primer on Computers and Programs
CS/COE0447 Computer Organization & Assembly Language
August 29 New address for Fang-Yi
Computers Inside and Out
Computer Architecture
MARIE: An Introduction to a Simple Computer
MARIE: An Introduction to a Simple Computer
Machine Architecture and Number Systems
Chapter 4: Representing instructions
Machine Architecture and Number Systems
Introduction to Microprocessor Programming
Introduction COE 301 Computer Organization
Introduction COE 301 Computer Organization Prof. Aiman El-Maleh
Networks & I/O Devices.
Part I Data Representation and 8086 Microprocessors
Presentation transcript:

CS/COE0447 Computer Organization & Assembly Language Pre-Chapter 2

Example: Chapter 1 example Question 1.48: If a computer issues 30 network requests per second and each request is on average 64 KB, will a 100 Mbit Ethernet link be sufficient? (printer, accessing files, …) KB = 10^3 bytes Byte = 8 bits Mbit = 10^6 A 100 Mbit Ethernet: 10^8 bit/s “bitrate” Answer: on board

“C Program” Down to “Numbers” void swap(int v[], int k) { int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; } swap: muli $2, $5, 4 add $2, $4, $2 lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15, 4($2) jr $31 compiler 00000000101000010… 00000000000110000… 10001100011000100… 10001100111100100… 10101100111100100… 10101100011000100… 00000011111000000… assembler

“Numbers” in Memory 00000000101000010… 00000000000110000… 10001100011000100… 10001100111100100… 10101100111100100… 10101100011000100… 00000011111000000…

Stored Program Concept program fetch data load/store program A program A disk I/O program counter data A program C program B program B data B processor hard disk main memory

Stored Program Concept, Cont’d Programs (instructions) are stored in memory as a stream of bits (numbers) Indistinguishable from data More than one programs can reside in memory at the same time Programs can be modified by the processor or I/O just as data can be modified Instructions Language of the machine Describes primitive actions, supported directly by the machine Instructions are fetched by the processor, are decoded and they determine processor actions

Number Representation What is the natural “base” for numbers? 2? 10? 16? 27? Unary is inefficient in space All other bases are a compact way of re-presenting numbers… X X X X X (U N A R Y) = = X X X X X

Example: Base 10 (Decimal) Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (10 of them) Example: 3217 = (3103) + (2102) + (1101) + (7100)

Numbers and Bases in General Number Base B  B unique values per digit Base 10: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Base 2: {0, 1} Base 16: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F} (Unsigned) number representation d31d30…d1d0 is a 32-digit non-negative number Value = d31B31 + d30B30 + … + d1B1 + d0B0 N-digit base B  BN unique values

Example: Base 2 (Binary) Digits: 0, 1 (2 of them) “Binary digit” = “Bit” Example: 11010two = (124) + (123) + (022) + (121) + (020) = 16 + 8 + 0 + 2 + 0 = 26ten Choice for machine implementation! 1 = on, 0 = off

Base Conversion Let’s do decimal-to-binary conversion Aten = dn-1dn-2…d1d0two Given a base-10 number A, come up with n-digit binary number that has the same value! X = the number Let N be the largest power of 2 that fits into X Put a 1 in that position X = X – 2^N Repeat until you are done!

Base Conversion, cont’d From binary to decimal From decimal to binary From binary to hexadecimal From hexadecimal to binary From decimal to hexadecimal? (more complicated; later)

Base Conversion, cont’d 0000 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 10 1011 B 11 1100 C 12 1101 D 13 1110 E 14 1111 F 15

Base Conversion, cont’d Binary to hex (base 16), or hex to binary base conversion is rather straightforward Take 4 bits in binary and convert them into one hex digit and vice versa Since binary notation tends to be long, hex notation is frequently used in assembly language (and in C programs). More on binary number representation will be discussed when we study arithmetic

Program Performance Program performance is measured in terms of time! Program execution time has to do with Number of instructions executed to complete a job How many clock cycles are needed to execute a single instruction The length of the clock cycle (clock cycle time)

Clock, Clock Cycle Time Circuits in computers are “clocked” At each clock rising (or falling) edge, some specified actions are done, usually within the next rising (or falling) edge Function block (made of circuits) clock cycle time clock

Program Performance Time = (# of clock cycles)  (clock cycle time) # of clock cycles = (# of instructions executed)  (average cycles per instruction) Time = (# of instructions executed)  (average clock cycles per instruction)  (clock cycle time) More of “program performance” issues will be discussed in Chapter 4.

Example You have a machine with a CPU running at 1GHz. The same company releases its 2GHz CPU with 100% compatibility with the existing 1GHz CPU, and you are considering upgrading. What is the expected performance improvement from doing so? Assume that programs have 40% memory-access instructions, and each memory access takes 10ns on average. All other instructions take exactly one cycle for execution.