CPE300: Digital System Architecture and Design

Similar documents
CPE300: Digital System Architecture and Design

Topics in computer architecture

CPE300: Digital System Architecture and Design

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

17. Instruction Sets: Characteristics and Functions

Typical Processor Execution Cycle

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Instruction Sets: Characteristics and Functions

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

COSC 6385 Computer Architecture. Instruction Set Architectures

Lecture 4: Instruction Set Architecture

Instruction Set Design

Digital System Design Using Verilog. - Processing Unit Design

CPE300: Digital System Architecture and Design

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Chapter 13 Reduced Instruction Set Computers

Computer Organisation CS303

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

INTEL Architectures GOPALAKRISHNAN IYER FALL 2009 ELEC : Computer Architecture and Design

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

Microcontrollers. Microcontroller

CISC Processor Design

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions

COS 140: Foundations of Computer Science

CPU Structure and Function

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 12 Processor Structure and Function

UNIT- 5. Chapter 12 Processor Structure and Function

Processing Unit CS206T

Microcomputer Architecture and Programming

COMPUTER ORGANIZATION & ARCHITECTURE

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

CENG3420 Lecture 03 Review

18-349: Embedded Real-Time Systems Lecture 2: ARM Architecture

Computer Organization CS 206 T Lec# 2: Instruction Sets

William Stallings Computer Organization and Architecture

Introduction to C. Why C? Difference between Python and C C compiler stages Basic syntax in C

CPE300: Digital System Architecture and Design

Topics/Assignments. Class 10: Big Picture. What s Coming Next? Perspectives. So Far Mostly Programmer Perspective. Where are We? Where are We Going?

CHAPTER 5 A Closer Look at Instruction Set Architectures

Chapter 12. CPU Structure and Function. Yonsei University

Chapter 5. A Closer Look at Instruction Set Architectures

Instruction Sets Ch 9-10

Chapter 2A Instructions: Language of the Computer

Instruction Sets Ch 9-10

DC57 COMPUTER ORGANIZATION JUNE 2013

UNIT 2 PROCESSORS ORGANIZATION CONT.

Understand the factors involved in instruction set

Lecture 04: Machine Instructions

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology

Instruction Set Principles and Examples. Appendix B

CSCE 5610: Computer Architecture

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

Instruction Set Architecture (ISA)

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types

Instruction Set Architecture of MIPS Processor

Introduction to Microprocessor

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.

ARM processor organization

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Job Posting (Aug. 19) ECE 425. ARM7 Block Diagram. ARM Programming. Assembly Language Programming. ARM Architecture 9/7/2017. Microprocessor Systems

2. ADDRESSING METHODS

COMP3221: Microprocessors and. and Embedded Systems. Instruction Set Architecture (ISA) What makes an ISA? #1: Memory Models. What makes an ISA?

MARIE: An Introduction to a Simple Computer

ECE331: Hardware Organization and Design

Mark II Aiken Relay Calculator

The PAW Architecture Reference Manual

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

55:132/22C:160, HPCA Spring 2011

Instruction Set Architecture

COSC 6385 Computer Architecture - Instruction Set Principles

What Are The Main Differences Between Program Counter Pc And Instruction Register Ir

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

This course provides an overview of the SH-2 32-bit RISC CPU core used in the popular SH-2 series microcontrollers

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009

Lecture 4: Instruction Set Design/Pipelining

Lecture Topics. Announcements. Today: The MIPS ISA (P&H ) Next: continued. Milestone #1 (due 1/26) Milestone #2 (due 2/2)

EC 413 Computer Organization

Assembly Language Design

Chapter 4. MARIE: An Introduction to a Simple Computer

Topics Power tends to corrupt; absolute power corrupts absolutely. Computer Organization CS Data Representation

Full file at

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Reminder: tutorials start next week!

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

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Real instruction set architectures. Part 2: a representative sample

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set?

CHAPTER 5 A Closer Look at Instruction Set Architectures

CPE 323 MSP430 INSTRUCTION SET ARCHITECTURE (ISA)

Wednesday, September 13, Chapter 4

Computer Organization MIPS ISA

Chapter 5. A Closer Look at Instruction Set Architectures. Chapter 5 Objectives. 5.1 Introduction. 5.2 Instruction Formats

361 div.1. Computer Architecture EECS 361 Lecture 7: ALU Design : Division

Computer Organization and Technology Processor and System Structures

Transcription:

CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Arithmetic Unit 10032011 http://www.egr.unlv.edu/~b1morris/cpe300/

2 Outline Recap Chapter 3 Number Systems Fixed Point Arithmetic

3 The Motorola MC68000 chip Introduced in 1979 Computers Apple Lisa 2, Apple Macintosh 128, Atari 520STfm and 1040STfm, Commodore Amiga 500 and 1000 Still in use today (now Freescale Semiconductor) Very early 32-bit microprocessor Most operations on 32-bit internal data Some operations may use different number of bits External datapaths may not all be 32 bits wide 24-bit address bus for MC68000 Complex instruction set computer Large instruction set 14 addressing modes die

4 Motorola MC68000 Highlights CISC has many addressing modes and instruction formats Pack as much functionality as possible into small word size 16-bit instruction load Some instructions multiple words Interrupts and traps (a real machine) Memory mapped I/O

5 New Concepts from MC68000 Variable length instructions Large instruction set, variable format Operation on many different types Must specify byte, word, longword Effective address (EA) calculation 14 Addressing modes Subroutines E.g. function calls Exceptions Interruption of normal sequential instruction execution Memory-mapped I/O Part of CPU memory reserved for I/O

MC68000 Programmer s Model 6

7 Features of Processor State Distinction between 32-bit data registers and 32-bit address registers 16 bit instruction register Variable length instructions handled 16 bits at a time Stack pointer registers User and system stack pointers Condition code register: System & User bytes Arithmetic status (N, Z, V, C, X) is in user status byte System status has Supervisor & Trace mode flags and the Interrupt Mask

8 Main Memory Main memory: Mb[0..2 24-1]<7..0>: memory as bytes Mw[ad]<15..0> := Mb[ad]#Mb[ad+1]: memory as words Ml[ad]<31..0> := Mw[ad]#Mw[ad+2]: memory as longwords Word and longword forms are big-endian Lowest numbered byte contains most significant bit of word Hard word alignment constraints Not described in the RTN Word addresses must in end in on binary 0 Longword addresses end in two binary 0

9 Addressing Mode Highlights General address of operand specified by 6-bit effective address field 5 4 3 2 1 0 Mode Reg Modes 0-6 use a register to calculate a memory address Based offset modes (5-6) require an extra word (16- bits) to specify address Mode 7 does not use a register Functionality is expanded by repurposing reg field All variants require extra words to complete the instruction and specify the memory address

10 MC68000 Instruction Types Instruction fields not standardized Maximize instructions in limited word size (bits) Operates on different types (B, W, L) Data movement instructions CC can be set during move ALU instructions 1 EA, 1 Dn operand Destination specified by 3-bit mode field Program control instructions Use 16 condition codes Has subroutine specific instructions

11 Exceptions Changes sequential instruction execution Next instruction fetch not from PC location Exception vector Address supplying the next instruction 7 levels of priority Arise from instruction execution, hardware faults, external conditions Interrupts externally generated exceptions ALU overflow, power failure, completion of I/O operation, out of range memory access, etc. Trace bit = 1 causes exception after every instruction Used for debugging

12 Memory-Mapped I/O Part of CPU memory is devoted/reserved for I/O No separate I/O space Not popular for machines having limited address bits Single bus needed for memory and I/O Less packaging pins Size of I/O and memory spaces independent Many or few I/O devices may be installed Much or little memory may be installed Spaces are separated by putting I/O at the top end of address space 0xFFFFFF 0xFF800 0xFF7FFF 24-bit address space with top 32K reserved for I/O 0x000000 I/O Space Memory Space Notice top 32K can be addressed by a negative 16-bit value

13 The SPARC Microprocessor Scalable Processor Architecture (SPARC) RISC microprocessor architecture Not a machine specification for implementation General register, load/store architecture Only 2 addressing modes Reg + Reg Reg + 13-bit constant Only 69 basic instructions 32-bit instruction length Separate floating point handling 3 processing units integer unit, FP unit, coprocesser

14 SPARC Highlights RISC machine has fewer simple instructions Multistep arithmetic operations happen in special units Regular instruction formats and few addressing modes simplify instruction decode Load/store machine with ALU only on registers Use of branch delays for 4 stage pipeline Use of register windows Extend register space for fewer memory operations

15 SPARC Processor State 32-bit general registers Integer and floating point separate Brach delays Requires 2 program counters Processor-status register (PSR) Condition codes Window-invalid mask (WIM) Used for register windows Trap base register Traps and interrupts

16 Register Windows High percentage of memory traffic for saving and restoring registers during procedure calls More registers = less memory traffic Reduce overhead of calls Only a small subset of registers is visible to the programmer at a given time (within procedure) Dedicated but overlapping registers groups Global Input parameters Output parameters Local registers Overlap designed to prevent swapping of registers Output parameters in one window become input parameters in the next

Register Windows Mechanism 17

18 Window Specifics CWP points to register currently called r8 save moves CWP to former r24 restore reverses process Parameters placed in r24..r31 by caller are available in r8..r15 by callee Spill := attempt to save when all windows have been used save traps to routine to store registers to memory Window wraps around like a circular buffer On overflow, first window is reused

19 Main Memory Main memory: Mb[0..2 32-1]<7..0>: memory as bytes Mh[ad]<15..0> := Mb[ad]#Mb[ad+1]: memory as halfwords Mw[ad]<31..0> := Mh[ad]#Mh[ad+2]: memory as words Word and halfword forms are big-endian Lowest numbered byte contains most significant bit of word Hard word alignment constraints Not described in the RTN Word addresses must in end in binary 00

20 Addressing Modes Only 2 modes for load/store Sum of two registers Sum of register and sign extended 13-bit constant Allows for a variety of addressing modes can be synthesized Indexed Base in one register, index in another Register indirect g0 + rn ; r0 = 0 Displacement rn + const. ; n 0 Absolute g0 + const. Can only reach the bottom or top 4K bytes of memory

21 RTN for Instruction Interpretation Instruction_interpretation := ( IR Mw[PC] ; instruction_execution; update_pc_and_npc; instruction_interpretation): Notice execution occurs before PC updates 2 PC values to update because of delayed branch Interrupts not mentioned in this simple RTN statement

22 SPARC MB86900 Pipeline 4 stage pipeline Results written to registers in write stage A new inst. is started (issued) before previously issued instructions are complete Instructions guaranteed to complete in order

23 RISC vs. CISC Designs CISC: Complex Instruction Set Computer Many complex instructions and addressing modes Some instructions take many steps to execute Varying lengths of time Not always easy to find best instruction for a task RISC: Reduced Instruction Set Computer Pipeline friendly Few, simple instructions, addressing modes Usually one word per instruction May take several instructions to accomplish what CISC can do in one Should be able to finish (nearly) one instruction per clock cycle Complex address calculations may take several instructions Usually has load-store, general register ISA

24 Problem Solving Homework problems 3.1 3.2 3.3

25 Chapter 6 Number Systems and Radix Conversion Fixed-Point Arithmetic Seminumeric Aspects of ALU Design Floating-Point Arithmetic

26 Digital Number Systems Expanded generalization of lecture 07 topics Number systems have a base (radix) b Positional notation of an m digit base b number x = x m;1 x m;2 x 1 x 0 m;1 Value x = x i b i i<0

27 Range of Representation Largest number has all digits equal to largest possible base b digit, (b 1) Max value in closed form for unsigned m digit base b number m;1 xmax = i<0 (b 1)b i m;1 xmax = (b 1) i<0 b i = (b 1) bm ;1 b;1 xmax = b m 1 Sum of geometric series m;1 i<0 b i = b m ;1 b;1

28 Radix Conversion Conversion between different number systems involves computation Base of calculation is c (10 typical for us humans) Other base is b Calculation based on division For integers a and d, exist integers q and r such that a = q d + r 0 r b 1 Notation: q = a/d r = a mod b (mod is remainder)

29 Digit Symbol Correspondence Between Bases Each base (b or c) has different symbols to represent digits Lookup table given for correspondence between symbols Provides mapping between base b and base c symbols May be more than one digit required to represent a larger base symbol Base 12 0 1 2 3 4 5 6 7 8 9 A B Base 3 0 1 2 10 11 12 20 21 22 100 101 102

30 Base Conversion 1 Convert base b integer to calculator base c 1. Start with base b x = x m;1 x m;2 x 1 x 0 2. Set x = 0 in base c 3. Left to right, get next symbol x i 4. Lookup base c number D i for symbol x i 5. Calculate in base c x = x b + D i 6. Repeat step 3 until no more digits Example: Convert 0x3AF to base 10 x = 0 x = 16 x + 3 = 3 x = 16 3 + 10 (= A) = 58 x = 16 58 + 15 (= F) = 943 0x3AF = 943 10

31 Base Conversion 2 Convert calculator base c integer to base b 1. Start with base c integer x = x m;1 x m;2 x 1 x 0 2. Initialize i = 0 v = x Get digits right to left 3. Set D i = v mod b v = v/b Lookup D i to get x i 4. Set i = i + 1 Repeat step 3 if v 0 Example: Convert 3587 10 to base 12 3587 = 298 rem = 11 x 12 0 = B 298 = 24 rem = 10 x 12 1 = A 24 = 2 rem = 0 x 12 2 = 0 2 = 0 rem = 2 x 12 3 = 2 3587=20AB 12

32 Fractions and Fixed Point Numbers Base b fraction f=.f -1 f -2 f -m Value is integer f -1 f -2 f -m divided by b m Mixed fixed point number x n;1 x n;2 x 1 x 0. x ;1 x ;2 x ;m Value of n+m digit integer x n;1 x n;2 x 1 x 0 x ;1 x ;2 x ;m Divided by b m Moving radix point one place left divides by b Right shift for fixed radix point position Moving radix point one place right multiplies by b Left Shift for fixed radix point position

33 Converting Fractions to Calculator Base Can use integer conversion and divide result by b m Alternative algorithm 1. Let base b number be f =. f ;1 f ;2 f ;m 2. Initialize f = 0.0 i = m 3. Find base c equivalent of D of digit f i 4. Update f = f:d b i = i + 1 5. If i = 0, result is f; otherwise repeat step 3 Example Convert 0.413 8 to base 10 f = 0:3 8 = 0.375 f = 0.375:1 8 f = 0.171875:4 8 = 0.171875 = 0.521484375 Notice: there will be precision errors due to numerical roundoff Only a fixed number of digits can be retained

34 Converting Fractions to Base b 1. Start with fraction f in base c f =. f ;1 f ;2 f ;m 2. Initialize v = f i = 1 3. Set D ;i = b v v = b v-d ;i Get base b digit f ;i for D ;i with table 4. Increment i = i + 1 Repeat Step 3 until v = 0 Enough digits generated Example Convert 0.31 10 to base 8 0.31 8 = 2.48 f ;1 = 2 0.48 8 = 3.84 f ;2 = 3 0.84 8 = 6.73 f ;3 = 6 Notice: Since 8 3 > 10 2, 0.236 8 has more accuracy than 0.31 10

35 Digit Grouping for Related Bases Base b = c k Can convert between bases by replacing single digit symbol in base b with corresponding digits in base c (Our favorite method to change base e.g. binary to hex)