Chapter 1. Computer Abstractions and Technology

Similar documents
The Computer Revolution. Chapter 1. The Processor Market. Classes of Computers. Morgan Kaufmann Publishers August 28, 2013

EECS2021. EECS2021 Computer Organization. EECS2021 Computer Organization. Morgan Kaufmann Publishers September 14, 2016

Chapter 1. Computer Abstractions and Technology. Lesson 3: Understanding Performance

CS3350B Computer Architecture

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Chapter 1. Computer Abstractions and Technology. Adapted by Paulo Lopes, IST

EECS Computer Organization Fall Based on slides by the author and prof. Mary Jane Irwin of PSU.

The Computer Revolution. Classes of Computers. Chapter 1

Thomas Polzer Institut für Technische Informatik

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

ECE232: Hardware Organization and Design

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017

Chapter 1. The Computer Revolution

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Chapter 2A Instructions: Language of the Computer

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 1. Computer Abstractions and Technology

ECE232: Hardware Organization and Design

CS3350B Computer Architecture MIPS Introduction

Architecture I. Computer Systems Laboratory Sungkyunkwan University

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 1. Computer Abstractions and Technology

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 1. Computer Abstractions and Technology

MIPS Instruction Set Architecture (1)

Chapter 1. and Technology

Computer Architecture. Fall Dongkun Shin, SKKU

ECE260: Fundamentals of Computer Engineering

Instructions: Language of the Computer

EECS2021E EECS2021E. The Computer Revolution. Morgan Kaufmann Publishers September 12, Chapter 1 Computer Abstractions and Technology 1

ECE 154A Introduction to. Fall 2012

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Unsigned Binary Integers

Unsigned Binary Integers

COMPUTER ORGANIZATION AND DESIGN

CSEE 3827: Fundamentals of Computer Systems

COMPUTER ARCHITECTURE AND OPERATING SYSTEMS (CS31702)

CSCI 402: Computer Architectures

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2

Computer Architecture Review. Jo, Heeseung

Operations, Operands, and Instructions

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Lecture 2. Instructions: Language of the Computer (Chapter 2 of the textbook)

Chapter 2. Instructions: Language of the Computer

Computer and Information Sciences College / Computer Science Department CS 207 D. Computer Architecture

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1

TDT4255 Computer Design. Lecture 1. Magnus Jahre

Computer Architecture. Lecture 2 : Instructions

CS3350B Computer Architecture. Introduction

COMPUTER ORGANIZATION AND. Editio. The Hardware/Software Interface. Chapter 1. Computer Abstractions and Technology

Rechnerstrukturen

Chapter 2. Instructions: Language of the Computer. HW#1: 1.3 all, 1.4 all, 1.6.1, , , , , and Due date: one week.

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design

Chapter 1. EE380, Fall Hank Dietz.

Computer Model. What s in a computer? Processor Memory I/O devices (keyboard, mouse, LCD, video camera, speaker, disk, CD drive, )

LECTURE 2: INSTRUCTIONS

Rechnerstrukturen. Chapter 2. Instructions: Language of the Computer

EE108B Lecture 2 MIPS Assembly Language I. Christos Kozyrakis Stanford University

CS3350B Computer Architecture MIPS Instruction Representation

Chapter 2. Baback Izadi Division of Engineering Programs

Chapter 1. Computer Abstractions and Technology

CSCI 402: Computer Architectures. Computer Abstractions and Technology. Recall. What is computer architecture

CSE2021 Computer Organization. Computer Abstractions and Technology

CPE300: Digital System Architecture and Design

Computer Architecture Computer Science & Engineering. Chapter 2. Instructions: Language of the Computer BK TP.HCM

CSE2021 Computer Organization

CSE2021 Computer Organization

Alternate definition: Instruction Set Architecture (ISA) What is Computer Architecture? Computer Organization. Computer structure: Von Neumann model

CS 4200/5200 Computer Architecture I

FUNDAMENTOS DEL DISEÑO DE

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

Lecture 4: Instruction Set Architecture

CS222: MIPS Instruction Set

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

CSSE232 Computer Architecture. Introduc5on

Lecture #6 Intro MIPS; Load & Store

COMPUTER ORGANIZATION AND DESIGN

Chapter 1. Computer Abstractions and Technology. Lesson 2: Understanding Performance

Computer Architecture

EEM 486: Computer Architecture

מבנה מחשבים Amar Lior Based on lectures notes from Arie Schlesinger

Chapter 3. Instructions:

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

ECE 486/586. Computer Architecture. Lecture # 7

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Stored Program Concept. Instructions: Characteristics of Instruction Set. Architecture Specification. Example of multiple operands

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Chapter 2. Instructions: Language of the Computer

IC220 SlideSet #2: Instructions (Chapter 2)

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

Machine Language Instructions Introduction. Instructions Words of a language understood by machine. Instruction set Vocabulary of the machine

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer

UCB CS61C : Machine Structures

Chapter 2. Instructions:

Hardware Level Organization

Review: What is a Computer?

Computer Systems Laboratory Sungkyunkwan University

CS/COE0447: Computer Organization

Chapter 4. The Processor

CS 61C: Great Ideas in Computer Architecture Introduction to Assembly Language and RISC-V Instruction Set Architecture

CS Computer Architecture Spring Lecture 01: Introduction

Transcription:

Chapter 1 Computer Abstractions and Technology

The Computer Revolution Progress in computer technology Underpinned by Moore s Law Makes novel applications feasible Computers in automobiles Cell phones Human genome project World Wide Web Search Engines Computers are pervasive 1.1 Introduction Chapter 1 Computer Abstractions and Technology 2

Classes of Computers Desktop computers General purpose, variety of software Subject to cost/performance tradeoff Server computers Network based High capacity, performance, reliability Range from small servers to building sized Embedded computers Hidden as components of systems Stringent power/performance/cost constraints Chapter 1 Computer Abstractions and Technology 3

The Processor Market Chapter 1 Computer Abstractions and Technology 4

What You Will Learn How programs are translated into the machine language And how the hardware executes them The hardware/software interface What determines program performance And how it can be improved How hardware designers improve performance What is parallel processing Chapter 1 Computer Abstractions and Technology 5

Understanding Performance Algorithm Determines number of operations executed Programming language, compiler, architecture Determine number of machine instructions executed per operation Processor and memory system Determine how fast instructions are executed I/O system (including OS) Determines how fast I/O operations are executed Chapter 1 Computer Abstractions and Technology 6

Below Your Program Application software Written in high-level language System software Compiler: translates HLL code to machine code Operating System: service code Handling input/output Managing memory and storage Scheduling tasks & sharing resources Hardware Processor, memory, I/O controllers 1.2 Below Your Program Chapter 1 Computer Abstractions and Technology 7

Levels of Program Code High-level language Level of abstraction closer to problem domain Provides for productivity and portability Assembly language Textual representation of instructions Hardware representation Binary digits (bits) Encoded instructions and data Chapter 1 Computer Abstractions and Technology 8

Components of a Computer The BIG Picture Same components for all kinds of computer Desktop, server, embedded Input/output includes User-interface devices Display, keyboard, mouse Storage devices Hard disk, CD/DVD, flash Network adapters For communicating with other computers 1.3 Under the Covers Chapter 1 Computer Abstractions and Technology 9

Anatomy of a Computer Output device Network cable Input device Input device Chapter 1 Computer Abstractions and Technology 10

Anatomy of a Mouse Optical mouse LED illuminates desktop Small low-res camera Basic image processor Looks for x, y movement Buttons & wheel Supersedes roller-ball mechanical mouse Chapter 1 Computer Abstractions and Technology 11

Through the Looking Glass LCD screen: picture elements (pixels) Mirrors content of frame buffer memory Chapter 1 Computer Abstractions and Technology 12

Opening the Box Chapter 1 Computer Abstractions and Technology 13

Inside the Processor (CPU) Datapath: performs operations on data Control: sequences datapath, memory,... Cache memory Small fast SRAM memory for immediate access to data Chapter 1 Computer Abstractions and Technology 14

Inside the Processor AMD Barcelona: 4 processor cores Chapter 1 Computer Abstractions and Technology 15

Abstractions The BIG Picture Abstraction helps us deal with complexity Hide lower-level detail Instruction set architecture (ISA) The hardware/software interface Application binary interface The ISA plus system software interface Implementation The details underlying and interface Chapter 1 Computer Abstractions and Technology 16

A Safe Place for Data Volatile main memory Loses instructions and data when power off Non-volatile secondary memory Magnetic disk Flash memory Optical disk (CDROM, DVD) Chapter 1 Computer Abstractions and Technology 17

Networks Communication and resource sharing Local area network (LAN): Ethernet Within a building Wide area network (WAN: the Internet Wireless network: WiFi, Bluetooth Chapter 1 Computer Abstractions and Technology 18

Technology Trends Electronics technology continues to evolve Increased capacity and performance Reduced cost DRAM capacity Year Technology Relative performance/cost 1951 Vacuum tube 1 1965 Transistor 35 1975 Integrated circuit (IC) 900 1995 Very large scale IC (VLSI) 2,400,000 2005 Ultra large scale IC 6,200,000,000 Chapter 1 Computer Abstractions and Technology 19

Instruction Set The repertoire of instructions of a computer Different computers have different instruction sets But with many aspects in common Early computers had very simple instruction sets Simplified implementation Many modern computers also have simple instruction sets 2.1 Introduction Chapter 2 Instructions: Language of the Computer 20

The MIPS Instruction Set Used as the example throughout the book Stanford MIPS commercialized by MIPS Technologies (www.mips.com) Large share of embedded core market Applications in consumer electronics, network/storage equipment, cameras, printers, Typical of many modern ISAs See MIPS Reference Data tear-out card, and Appendixes B and E Chapter 2 Instructions: Language of the Computer 21

Arithmetic Operations Add and subtract, three operands Two sources and one destination add a, b, c # a gets b + c All arithmetic operations have this form Design Principle 1: Simplicity favours regularity Regularity makes implementation simpler Simplicity enables higher performance at lower cost 2.2 Operations of the Computer Hardware Chapter 2 Instructions: Language of the Computer 22

Arithmetic Example C code: f = (g + h) - (i + j); Compiled MIPS code: add t0, g, h # temp t0 = g + h add t1, i, j # temp t1 = i + j sub f, t0, t1 # f = t0 - t1 Chapter 2 Instructions: Language of the Computer 23

Register Operands Arithmetic instructions use register operands MIPS has a 32 32-bit register file Use for frequently accessed data Numbered 0 to 31 32-bit data called a word Assembler names $t0, $t1,, $t9 for temporary values $s0, $s1,, $s7 for saved variables Design Principle 2: Smaller is faster c.f. main memory: millions of locations 2.3 Operands of the Computer Hardware Chapter 2 Instructions: Language of the Computer 24

Register Operand Example C code: f = (g + h) - (i + j); f,, j in $s0,, $s4 Compiled MIPS code: add $t0, $s1, $s2 add $t1, $s3, $s4 sub $s0, $t0, $t1 Chapter 2 Instructions: Language of the Computer 25

Memory Operands Main memory used for composite data Arrays, structures, dynamic data To apply arithmetic operations Load values from memory into registers Store result from register to memory Memory is byte addressed Each address identifies an 8-bit byte Words are aligned in memory Address must be a multiple of 4 MIPS is Big Endian Most-significant byte at least address of a word c.f. Little Endian: least-significant byte at least address Chapter 2 Instructions: Language of the Computer 26

Memory Operand Example 1 C code: g = h + A[8]; g in $s1, h in $s2, base address of A in $s3 Compiled MIPS code: Index 8 requires offset of 32 4 bytes per word lw $t0, 32($s3) # load word add $s1, $s2, $t0 offset base register Chapter 2 Instructions: Language of the Computer 27

Memory Operand Example 2 C code: A[12] = h + A[8]; h in $s2, base address of A in $s3 Compiled MIPS code: Index 8 requires offset of 32 lw $t0, 32($s3) # load word add $t0, $s2, $t0 sw $t0, 48($s3) # store word Chapter 2 Instructions: Language of the Computer 28

Registers vs. Memory Registers are faster to access than memory Operating on memory data requires loads and stores More instructions to be executed Compiler must use registers for variables as much as possible Only spill to memory for less frequently used variables Register optimization is important! Chapter 2 Instructions: Language of the Computer 29

Immediate Operands Constant data specified in an instruction addi $s3, $s3, 4 No subtract immediate instruction Just use a negative constant addi $s2, $s1, -1 Design Principle 3: Make the common case fast Small constants are common Immediate operand avoids a load instruction Chapter 2 Instructions: Language of the Computer 30

The Constant Zero MIPS register 0 ($zero) is the constant 0 Cannot be overwritten Useful for common operations E.g., move between registers add $t2, $s1, $zero Chapter 2 Instructions: Language of the Computer 31

Unsigned Binary Integers Given an n-bit number x x n 1 n 2 1 0 n 12 xn 22 x12 x02 Range: 0 to +2 n 1 Example 2.4 Signed and Unsigned Numbers 0000 0000 0000 0000 0000 0000 0000 1011 2 = 0 + + 1 2 3 + 0 2 2 +1 2 1 +1 2 0 = 0 + + 8 + 0 + 2 + 1 = 11 10 Using 32 bits 0 to +4,294,967,295 Chapter 2 Instructions: Language of the Computer 32

2s-Complement Signed Integers Given an n-bit number x x n 1 n 2 1 0 n 12 xn 22 x12 x02 Range: 2 n 1 to +2 n 1 1 Example 1111 1111 1111 1111 1111 1111 1111 1100 2 = 1 2 31 + 1 2 30 + + 1 2 2 +0 2 1 +0 2 0 = 2,147,483,648 + 2,147,483,644 = 4 10 Using 32 bits 2,147,483,648 to +2,147,483,647 Chapter 2 Instructions: Language of the Computer 33

2s-Complement Signed Integers Bit 31 is sign bit 1 for negative numbers 0 for non-negative numbers ( 2 n 1 ) can t be represented Non-negative numbers have the same unsigned and 2s-complement representation Some specific numbers 0: 0000 0000 0000 1: 1111 1111 1111 Most-negative: 1000 0000 0000 Most-positive: 0111 1111 1111 Chapter 2 Instructions: Language of the Computer 34

Signed Negation Complement and add 1 Complement means 1 0, 0 1 x x 1111...111 2 1 x 1 x Example: negate +2 +2 = 0000 0000 0010 2 2 = 1111 1111 1101 2 + 1 = 1111 1111 1110 2 Chapter 2 Instructions: Language of the Computer 35

Sign Extension Representing a number using more bits Preserve the numeric value In MIPS instruction set addi: extend immediate value lb, lh: extend loaded byte/halfword beq, bne: extend the displacement Replicate the sign bit to the left c.f. unsigned values: extend with 0s Examples: 8-bit to 16-bit +2: 0000 0010 => 0000 0000 0000 0010 2: 1111 1110 => 1111 1111 1111 1110 Chapter 2 Instructions: Language of the Computer 36

Representing Instructions Instructions are encoded in binary Called machine code MIPS instructions Encoded as 32-bit instruction words Small number of formats encoding operation code (opcode), register numbers, Regularity! Register numbers $t0 $t7 are reg s 8 15 $t8 $t9 are reg s 24 25 $s0 $s7 are reg s 16 23 2.5 Representing Instructions in the Computer Chapter 2 Instructions: Language of the Computer 37