Basic Building Blocks Multiplexer Demultiplexer Adder +

Slides:



Advertisements
Similar presentations
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
Advertisements

The Processor: Datapath & Control
MIPS Architecture CPSC 321 Computer Architecture Andreas Klappenecker.
Levels in Processor Design
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
CSE331 W09.1Irwin Fall 2007 PSU CSE 331 Computer Organization and Design Fall 2007 Week 9 Section 1: Mary Jane Irwin (
Computer Engineering AddSub page 1 Basic Building Blocks Multiplexer + Demultiplexer Adder.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
W.S Computer System Design Lecture 4 Wannarat Suntiamorntut.
EI 209 Chapter 3.1CSE, 2015 EI 209 Computer Organization Fall 2015 Chapter 3: Arithmetic for Computers Haojin Zhu ( )
By Wannarat Computer System Design Lecture 4 Wannarat Suntiamorntut.
1 Signed Arithmetic Logical Operations Ellen Spertus MCS 111 October 1, 2002.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
MicroComputer Engineering BranchProcCall page Addiu$t1 $r0 3 Addiu$t1 $t1 5 Addiu$t1 $t1 7 Example.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Computer Arthmetic Chapter Four P&H. Data Representation Why do we not encode numbers as strings of ASCII digits inside computers? What is overflow when.
EE204 L03-ALUHina Anwar Khan EE204 Computer Architecture Lecture 03- ALU.
Pirouz Bazargan SabetDecember 2003 Effective Implementation of a 32-bit RISC Processor Pirouz Bazargan Sabet University of Paris 6 - LIP6 - ASIM
MIPS Processor.
Add & Subtract. Addition Add bit by bit from right to left Ex 5+6 or (5)0111 (7) (6)OR (3) 1011 (11)1010 (10)
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Single-cycle CPU Control
Access the Instruction from Memory
Single Cycle CPU - Control
Based on slides from D. Patterson and www-inst.eecs.berkeley.edu/~cs152/ COM 249 – Computer Organization and Assembly Language Chapter 3 Arithmetic For.
Computer Arthmetic Chapter Four P&H.
CS 230: Computer Organization and Assembly Language
Example Addiu $t1 $r0 3 Addiu $t1 $t1 5 Addiu $t1 $t1 7.
Computer Organization and Design Instruction Sets - 2
Instructions: Language of the Computer
IT 251 Computer Organization and Architecture
/ Computer Architecture and Design
Computer Organization and Design Instruction Sets - 2
MIPS Processor.
ADITI SHINDE CHIDAMBARAM ALAGAPPAN
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
CSCE 212 Chapter 5 The Processor: Datapath and Control
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
Topic 3a Two’s Complement Representation
MIPS Processor.
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
Levels in Processor Design
Rocky K. C. Chang 6 November 2017
Instruction encoding The ISA defines Format = Encoding
The Processor Lecture 3.2: Building a Datapath with Control
Guest Lecturer TA: Shreyas Chand
Lecture 9. MIPS Processor Design – Decoding and Execution
MIPS Assembly.
COMS 361 Computer Organization
A 1-Bit Arithmetic Logic Unit
Instruction encoding The ISA defines Format = Encoding
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Instruction encoding The ISA defines Format = Encoding
The branch instruction
Reading and writing to data memory
Basic Building Blocks Multiplexer Demultiplexer Adder +
Instruction encoding The ISA defines Format = Encoding
CS352H Computer Systems Architecture
CS/COE0447 Computer Organization & Assembly Language
COMS 361 Computer Organization
MIPS Assembly.
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
Presentation transcript:

Basic Building Blocks Multiplexer Demultiplexer Adder +

The Program Counter There is a special register inside the processor. Big enough to hold an instruction address (32 bits). Called the program counter (PC).

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend

Fetch - Execute Fetch: Execute: Send the value in the PC to the instruction memory. The instruction memory gives out one instruction. Execute: Carry out the fetched instruction. Also: PC := PC+4; Fetch Execute  108 times per second

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend

The Register File 32 word (32 bit) registers. r0 is special: Read: always zero. Write: allowed, but won´t change it. r31 is special: Hard-wired return address (lab1).

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend

Add Instructions 32 bit operands. Example: Add rd rs rt. There is also: Addu rd rs rt. These are not add signed and add unsigned. The “u”-variant ignores overflow. 6 5 5 5 Opcode rs rt rd

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Add rd rs rt

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Add rd rs rt

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Add rd rs rt

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Add rd rs rt

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Add rd rs rt

Add rd rs rt … next instr Zero ext. Branch logic A ALU 4 B + 31 + A ALU 4 B + 31 + Sgn/Ze extend Add rd rs rt … next instr

Sub Instructions 32 bit operands. Example: There is also: Sub rd rs rt rd := rs - rt There is also: Subu rd rs rt These are not sub signed and sub unsigned The “u”-variant ignores overflow

How to Negate Y := -X? Sub rd $0 rt ($0 means r0) rd := 0 - rt Careful: Neg  Not

Compare Instructions Signed integers: Unsigned integers: Slt rd rs rt if rs < rt then rd := 1 else rd := 0 Unsigned integers: Sltu rd rs rt

Immediate Variants of the arithmetic instructions: Addi rt rs Imm Addiu rt rs Imm Slti rt rs Imm Sltiu rt rs Imm Imm sign-extend No sub instruction

Sign/Zero extension The immediate field is 16 bits But most operations work on 32 bits! Zero extension Sign extension Immediate 0000000000000000 Immediate xxxxxxxxxxxxxxxx x Immediate 31 16 15 31 16 15 Bit 15, the Sign bit, is copied into bits 16 - 31

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Addi rt rs Imm

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Addi rt rs Imm

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Addi rt rs Imm

Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Addi rt rs Imm

Addi rt rs Imm … next instr Zero ext. Branch logic A ALU 4 B + 31 + Sgn/Ze extend Addi rt rs Imm … next instr