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

Similar documents
Let s put together a Manual Processor

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

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

Central Processing Unit (CPU)

Chapter 5 Instructor's Manual

CHAPTER 7: The CPU and Memory

MICROPROCESSOR AND MICROCOMPUTER BASICS

Microprocessor & Assembly Language

Instruction Set Design

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

EC 362 Problem Set #2

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

Central Processing Unit

İSTANBUL AYDIN UNIVERSITY

Instruction Set Architecture

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

An Introduction to the ARM 7 Architecture

CS201: Architecture and Assembly Language

MACHINE ARCHITECTURE & LANGUAGE

CPU Organization and Assembly Language

Notes on Assembly Language

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

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

CPU Organisation and Operation

LSN 2 Computer Processors

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings:

Chapter 2 Logic Gates and Introduction to Computer Architecture

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

Computer Organization and Architecture

PART B QUESTIONS AND ANSWERS UNIT I

Compilers I - Chapter 4: Generating Better Code

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

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

Chapter 1 Computer System Overview

Summary of the MARIE Assembly Language

PROBLEMS (Cap. 4 - Istruzioni macchina)

Binary Adders: Half Adders and Full Adders

Instruction Set Architecture (ISA) Design. Classification Categories

EE282 Computer Architecture and Organization Midterm Exam February 13, (Total Time = 120 minutes, Total Points = 100)

Lecture 2. Binary and Hexadecimal Numbers

Computer organization

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

Computer Organization. and Instruction Execution. August 22

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

Instruction Set Architecture (ISA)

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

TIMING DIAGRAM O 8085

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

1 Classical Universal Computer 3

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

A New Paradigm for Synchronous State Machine Design in Verilog

8085 INSTRUCTION SET

The 104 Duke_ACC Machine

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010

An Overview of Stack Architecture and the PSC 1000 Microprocessor

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

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

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

Board Notes on Virtual Memory

BASIC COMPUTER ORGANIZATION AND DESIGN

An Efficient RNS to Binary Converter Using the Moduli Set {2n + 1, 2n, 2n 1}

Chapter 7D The Java Virtual Machine

Administrative Issues

VLIW Processors. VLIW Processors

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

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

361 Computer Architecture Lecture 14: Cache Memory

(Refer Slide Time: 02:39)

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

Systems I: Computer Organization and Architecture

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

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

Traditional IBM Mainframe Operating Principles

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

A3 Computer Architecture

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

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

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

Review: MIPS Addressing Modes/Instruction Formats

The WIMP51: A Simple Processor and Visualization Tool to Introduce Undergraduates to Computer Organization

Hardware Assisted Virtualization

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

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

SIM-PL: Software for teaching computer hardware at secondary schools in the Netherlands

The Design of the Inferno Virtual Machine. Introduction

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

The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine

================================================================

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

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

Disk Storage Shortfall

Modbus RTU Communications RX/WX and MRX/MWX

Analysis of Micromouse Maze Solving Algorithms

In the Beginning The first ISA appears on the IBM System 360 In the good old days

Lecture 5: Gate Logic Logic Optimization

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

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Transcription:

Addressing The problem Objectives:- When & Where do we encounter Data? The concept of addressing data' in computations The implications for our machine design(s) Introducing the stack-machine concept Slide 1

What do we mean by data? Data can be held in memory Data is usually organised as 8-bit, 16-bit or 32-bit (Byte, Word, or Double-Word) Data can also be addressed directly as an operand in an instruction - for example ADD A, 03h has an operand 03h Instructions usually operate dyadically - i.e. they require two things. - the example ADD A, 03h has two items to add ( A and 03h ) - Having only one register (A) is not ideal, - It does not match the frequent case of dyadic operations well. - Would more registers be better? Historical interest The 6502 was a successful early CPU in the 70 s, with only an A register. The 6809 emerged later, and had both A and B registers. Let us consider the Jorvick-2 machine design once again. Slide 2

Our improved Processor Jorvick 2 :- + Accumulator Detect Zero 1 + Prog Counter bbbb P ppp Opcode Jorvick-2 is an extreme example of an Accumulator machine. All operations use the accumulator (Register A) and a secondary operand - It might be more convenient if there were more registers available Slide 3

More Registers - What are the options you may have already encountered the concept of register addressing:- - 3-Register addressing e.g. Add R1,R2, R3-2-Register Addressing e.g. Add R1, R2-1 Register Addressing e.g. Add R1 (to the accumulator) - 0 Register Addressing e.g. Add ( works on a stack) Hardware Impact :- - addressing many registers means Complex and potentially Slower circuitry - addressing fewer registers is generally simpler and faster - But fewer registers makes coding harder, perhaps longer? Short programs on slow machine == big programs on fast machine? Slide 4

More Registers A 3-port Register file (most likely to be used in modern CPUs) Consider the example of a 3-port register file of four 8-bit registers :- 2-bit Register Address ZZ R0 R1 R2 R3 2-bit Register Address XX 2-bit Register Address YY Accessing any 3 of 4 registers simultaneously can create design problems. Modern CPU's allow multiple instructions at the same time (ILP), so we may have 3 ports or 3n ports for n simultaneous instructions much worse!. Instructions must contain both the function code (e.g. add, sub etc) and the register addresses. FFFF Rx Ry Rz <- Example of an Instruction 10 BITS Slide 5

Less Registers A 1-port Register file the standard Accumulator model The Accumulator model is much simpler, only one register file port is needed, but this is also a data bottleneck and makes ILP very difficult. Acc 2-bit Register Address RR R0 R1 R2 R3 Instructions only contain the function code (e.g. add, sub etc) and one register address, the second register is always the accumulator, FFFF 6 BITS RR <- Example of an Instruction format Slide 6

NO Registers The Stack Model The stack (or Zero-Operand) model has no addressable registers, and thus no register file in the traditional sense. TOP NEXT 3RD 4TH Instructions only specify the function code (e.g. add, sub etc). Registers are always TOP and NEXT by default. FFFF 4 BITS <- Example of a Stack Machine Instruction Slide 7

Jorvick 3 Adopting a Stack-machine approach:- 3RD But where does the rest of the stack go? NEXT TOP + i0 i1 Detect Zero 1 + Prog Counter L bbb P ppp Opcode J3 is a sort of stack-machine. L bit allows us to load something (a number bbb) onto the stack - But bbb has got shorter and we have introduced new component delays Slide 8

J3 Some instruction set examples We can start to see some new instructions when we examine J3 and its circuits. The names are just invented by us to describe operations We can have SET, which pushes a value onto the stack e.g. SET 02h We have ADD, which simply adds two values from the stack together. So we could add two numbers like this :- SET 03h (hex code = B1h) SET 01h (hex code = 91h) ADD (hex code = 01h) However, we cannot do SUB anymore, since our design only has an adder in the Data- Path. Instead we would have to use SET and ADD in the following way:- SET 03h ADD (this will subtract 03h from the top of stack) Slide 9

J3 Is this design reaching a Dead-End? - J3 has new features (SET using the L bit, and Branch using P) - But these features have been at the cost of making bbbb and pppp smaller What are the options? - Could we make the instruction bigger use 16 bits instead of 8 bits? - Could we improve the way branches are handled? - Most processors don t combine branches with arithmetic operations - Branches are not as frequent as arithmetic operations (maybe 1:6 ratio) - So 5 out of every 6 instruction bytes have wasted branch bits. - It would be nice to have other instructions - Why not have SUB as well as ADD, also AND and OR are useful - What If I want to DROP something off the stack? Adding these new features is too tricky with J3, we need another technology-shift Slide 10

Jorvick 4 The Next Generation of Stack Machine Technology! 3RD NEXT TOP ALU Function Code bits ALU Load Bit i0 i1 Conditional Branch Bit Detect Zero Instruction Decoder 1 + Prog Counter bbbbbbbb Opcode We will start to think about what we can do with our new and more realistic design in the next lecture Slide 11

Conclusions We usually need access to two operands at a time An Accumulator can be a bottleneck in this case The alternatives can increase complexity, but are usually unavoidable Stack processors take a different approach, but are not popular at present 8-bits is not enough to control the internal signals of a CPU - we need to look at the alternatives in order to progress Slide 12