ENCE Computer Organization and Architecture. Chapter 1. Software Perspective

Similar documents
Chris Riesbeck, Fall Introduction to Computer Systems

Introduction to Computer Systems

Introduction to Computer Systems

Introduction to Computer Systems

A software view. Computer Systems. The Compilation system. How it works. 1. Preprocesser. 1. Preprocessor (cpp)

Bilgisayar Sistemlerine Genel Bakış

Computer Systems Organization

Introduction Presentation A

M2 Instruction Set Architecture

High Performance Computing Lecture 1. Matthew Jacob Indian Institute of Science

Remember This from Week 3? DFA: 4 Bar Position

Chapter 1 Computer System Overview

A Tour of Computer Systems

LC-3 Assembly Language

CSCI2467: Systems Programming Concepts

CS240: Programming in C. Lecture 2: Overview

Chapter 1 A Tour of Computer Systems

Compilation, Disassembly, and Profiling (in Linux)

Computer System: An Overview

Lecture 3: Instruction Set Architecture

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3

Draft. Chapter 1 Program Structure. 1.1 Introduction. 1.2 The 0s and the 1s. 1.3 Bits and Bytes. 1.4 Representation of Numbers in Memory

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

Great Reality #2: You ve Got to Know Assembly Does not generate random values Arithmetic operations have important mathematical properties

What s next. Computer Systems A Programmer s Perspective

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

Raspberry Pi / ARM Assembly. OrgArch / Fall 2018

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY

Computer System Overview

Chapter 2. Basics of Program Writing

Week 1 / Lecture 2 8 March 2017 NWEN 241 C Fundamentals. Alvin Valera. School of Engineering and Computer Science Victoria University of Wellington

Operating Systems: Internals and Design Principles, 7/E William Stallings. Chapter 1 Computer System Overview

PROGRAM COMPILATION MAKEFILES. Problem Solving with Computers-I

Compila(on, Disassembly, and Profiling

2 Compiling a C program

Four Components of a Computer System

This Unit: Main Memory. Building a Memory System. First Memory System Design. An Example Memory System

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Your first C and C++ programs

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

Introduction to Supercomputing

Notes By: Shailesh Bdr. Pandey, TA, Computer Engineering Department, Nepal Engineering College

Memory Management! Goals of this Lecture!

C Compilation Model. Comp-206 : Introduction to Software Systems Lecture 9. Alexandre Denault Computer Science McGill University Fall 2006

Advanced Memory Organizations

Chapter 1: Introduction Dr. Ali Fanian. Operating System Concepts 9 th Edit9on

CS133 C Programming. Instructor: Jialiang Lu Office: Information Center 703

CMPSC 311- Introduction to Systems Programming Module: Build Processing

Topic 2. System calls. 1. Basic architecture 2. Input/Output routine mechanism 3. Resident routines 4. Accessing OS services: system calls

Locality. CS429: Computer Organization and Architecture. Locality Example 2. Locality Example

Computer Organization

Lecture 03 Bits, Bytes and Data Types

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Chapter 6 Caches. Computer System. Alpha Chip Photo. Topics. Memory Hierarchy Locality of Reference SRAM Caches Direct Mapped Associative

C Preprocessor. Prabhat Kumar Padhy

CS 201 The Memory Hierarchy. Gerson Robboy Portland State University

Algorithm Performance Factors. Memory Performance of Algorithms. Processor-Memory Performance Gap. Moore s Law. Program Model of Memory II

Computer Systems Lecture 9

CS 333 Introduction to Operating Systems Class 2 OS-Related Hardware & Software The Process Concept

Memory Management. Kevin Webb Swarthmore College February 27, 2018

Byte Ordering. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

I/O Devices. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

CMPSC 311- Introduction to Systems Programming Module: Build Processing

How Compiling and Compilers Work

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2014 Lecture 14

Introduction to C Programming

Course Information and Introduction

CS Programming In C

Topic 6: A Quick Intro To C

Virtual Memory Virtual memory first used to relive programmers from the burden of managing overlays.

Programming. Data Structure

Assignment 1 due Mon (Feb 4pm

Lectures 5-6: Introduction to C

CS510 Operating System Foundations. Jonathan Walpole

Outline. Compiling process Linking libraries Common compiling op2ons Automa2ng the process

assembler Machine Code Object Files linker Executable File

Intermediate Programming & Design (C++) Notation

CS240: Programming in C

Byte Ordering. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Preview from Notesale.co.uk Page 6 of 52

Memory Management. Goals of this Lecture. Motivation for Memory Hierarchy

CS356: Discussion #9 Memory Hierarchy and Caches. Marco Paolieri Illustrations from CS:APP3e textbook

Memory Management (Chaper 4, Tanenbaum)

Lecture 2: Memory Systems

EL2310 Scientific Programming

Chapter Seven Morgan Kaufmann Publishers

CSE2421 Systems1 Introduction to Low-Level Programming and Computer Organization

High Performance Computing and Programming, Lecture 3

The Memory Hierarchy 10/25/16

Introduction to Computing Systems - Scientific Computing's Perspective. Le Yan LSU

The Memory System. Components of the Memory System. Problems with the Memory System. A Solution

Lab 1: Introduction to C Programming. (Creating a program using the Microsoft developer Studio, Compiling and Linking)

Memory and C/C++ modules

Pharmacy college.. Assist.Prof. Dr. Abdullah A. Abdullah

Computer is an electronic machine that can receive, store, transform and output data of all kinds (image, text, numeric, graphics and sound).

Introduction to Linux

Memory Management! How the hardware and OS give application pgms:" The illusion of a large contiguous address space" Protection against each other"

EL2310 Scientific Programming

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Transcription:

Computer Organization and Architecture Chapter 1 Software Perspective The Lifetime of a Simple Program A Simple Program # include <stdio.h> int main() { printf( hello, world\n ); } The goal of this course is to help you understand what happens and why, when the program executes on a computer system. Lifetime: Created as a source file Translated into object code Linked into executable Loaded to through a command interpreter Access through a storage hierarchy Hardware resources managed by OS System communicates using network 2 Source Program Representation The Source program is - A text file - A sequence of bits, organized in 8-bit chunks called bytes - Each byte represents one text character - Text characters are represented in ASCII format. Example # i n c l u d e <sp> 35 105 110 99 108 117 100 101 32 All information in a computer system is represented as a bunch of bits. 3

Translation Process The C program hello.c must be translated into a sequence of low-level machine language instructions. Example: On Linux, we use the GCC compiler to translate hello.c into object file Unix> gcc o hello hello.c Compiling phases gcc is a driver that calls preprocessor (cpp), compiler (cc1), assembler (as), and the linker (ld). Hello.c cpp Hello.i cc1 Hello.s as print.o Hello.o ld Hello 4 Understanding Compiler-Generated Code Optimizing program performance Is switch always more efficient than a sequence of ifthen-else? Why accessing a local variable is faster than accessing an argument passed by reference? Why two functionally equivalent loops have very different running times? Understanding link-time errors Linker is playing an increasingly important role Avoid security holes Buffer overflow bugs/tricks account for many security holes 5 Hardware organization Modeled after the Intel Pentium systems CPU/Processor Memory Buses I/O devices 6

Hardware organization Processor (CPU)»Interprets instructions», Registers,»Example instructions load, store, add, I/O read/write, jump»code and data I/O devices»keyboard, mouse, display,, network Buses»Transfer fixed-sized chunks of bytes 7 Running the hello program DMA User types hello Loading hello into 8 Running the hello program Executing hello Loading hello into 9

Running the hello program Write output string to the display 10 It May Look Complicated But it s actually simplified CPU/Processor Memory Buses I/O devices 11 Caches Matter L2 caches L1-cache Front-side bus Back-side bus Caches: smaller faster storage devices that serve as temporary staging areas for frequently referenced information, managed by hardware Local : like caches, but is managed by compilers/programmers 12

Storage Hierarchy Larger, Slower, And Cheaper Storage Devices registers On-chip L1 cache Off-chip L2 cache Memory 8 to 128 16KB to 64KB 256KB to 4MB 128MB to 16GB Local secondary storage 20GB to 1TB Remote secondary storage 13 idea: Storage Hierarchy Storage at one level serves as a cache for storage at the next lower level Example: The L1 cache is a cache for the L2 cache The L2 cache is a cache for the main The main is a cache for the The local serves as a cache for data stored on the s of other systems in a networked system. 14 Operating System OS controls the execution of application programs and acts as an interface between users and the computer hardware. Applications Operating System processor I/O Objectives Protection: to protect the hardware from misuse Convenience: make a computer easier to use (e.g. WIN) Efficiency: allow more efficient use of hardware resources Abstractions Processes for processor,, and I/O Virtual for main and I/O devices Files for I/O device 15

Networks Modern systems are often linked to other systems by networks The network can be viewed as just another I/O device Copying information from one machine to another becomes the most important application e-mail, instant messaging, www, FTP, telnet Napster, Morpheus Network is computer Web caches have been very successful 16