Computer Engineering AddSub page 1 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.
1 Representing Numbers Using Bases Numbers in base 10 are called decimal numbers, they are composed of 10 numerals ( ספרות ) = 9* * *10.
Levels in Processor Design
Microprocessor 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.
Basic Operational Concepts of a Computer
CSE331 W09.1Irwin Fall 2007 PSU CSE 331 Computer Organization and Design Fall 2007 Week 9 Section 1: Mary Jane Irwin (
Lecture 8. MIPS Instructions #3 – Branch Instructions #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education.
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.
Computer Organization CS224 Fall 2012 Lessons 7 and 8.
EI 209 Chapter 3.1CSE, 2015 EI 209 Computer Organization Fall 2015 Chapter 3: Arithmetic for Computers Haojin Zhu ( )
EE 3755 Datapath Presented by Dr. Alexander Skavantzos.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
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.
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
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:
Access the Instruction from Memory
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.
Electrical and Computer Engineering University of Cyprus
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
COMP541 Datapaths I Montek Singh Mar 28, 2012.
IT 251 Computer Organization and Architecture
MIPS Processor.
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
Instruction encoding The ISA defines Format = Encoding
The Processor Lecture 3.2: Building a Datapath with Control
Lecture 9. MIPS Processor Design – Decoding and Execution
MIPS Assembly.
COMS 361 Computer Organization
A 1-Bit Arithmetic Logic Unit
Basic Building Blocks Multiplexer Demultiplexer Adder +
Access the Instruction from Memory
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 +
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
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Computer Engineering AddSub page 1 Basic Building Blocks Multiplexer + Demultiplexer Adder

Computer Engineering AddSub page 2 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).

Computer Engineering AddSub page 3 Branch logic Sgn/Ze extend Zero ext. ALU A B

Computer Engineering AddSub page 4 Fetch - Execute Fetch: –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  10 8 times per second

Computer Engineering AddSub page 5 Branch logic Sgn/Ze extend Zero ext. ALU A B

Computer Engineering AddSub page 6 Branch logic Sgn/Ze extend Zero ext. ALU A B

Computer Engineering AddSub page 7 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).

Computer Engineering AddSub page 8 Branch logic Sgn/Ze extend Zero ext. ALU A B

Computer Engineering AddSub page 9 Add Instructions 32 bit operands. Example: –Add rd rs rt. –rd := rs + rt. There is also: –Addu rd rs rt. These are not add signed and add unsigned. The “u”-variant ignores overflow. Opcode rsrt rd

Computer Engineering AddSub page 10 Branch logic Sgn/Ze extend Zero ext. Add rd rs rt ALU A B

Computer Engineering AddSub page 11 Branch logic Sgn/Ze extend Zero ext. Add rd rs rt ALU A B

Computer Engineering AddSub page 12 Branch logic Sgn/Ze extend Zero ext. Add rd rs rt ALU A B

Computer Engineering AddSub page 13 Branch logic Sgn/Ze extend Zero ext. Add rd rs rt ALU A B

Computer Engineering AddSub page 14 Branch logic Sgn/Ze extend Zero ext. Add rd rs rt ALU A B

Computer Engineering AddSub page 15 Branch logic Sgn/Ze extend Zero ext. Add rd rs rt … next instr ALU A B

Computer Engineering AddSub page 16 Sub Instructions 32 bit operands. Example: –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

Computer Engineering AddSub page 17 How to Negate Y := -X? Subrd $0 rt($0 means r0) rd := 0 - rt Careful: Neg  Not

Computer Engineering AddSub page 18 Compare Instructions Signed integers: –Slt rd rs rt –if rs < rt then rd := 1 else rd := 0 Unsigned integers: –Sltu rd rs rt –if rs < rt then rd := 1 else rd := 0

Computer Engineering AddSub page 19 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

Computer Engineering AddSub page 20 Sign/Zero extension The immediate field is 16 bits But most operations work on 32 bits! Zero extension Sign extension Immediate xxxxxxxxxxxxxxxx Immediate Immediate Bit 15, the Sign bit, is copied into bits x

Computer Engineering AddSub page 21 Branch logic Sgn/Ze extend Zero ext. ALU A B

Computer Engineering AddSub page 22 Branch logic Sgn/Ze extend Zero ext. Addi rt rs Imm ALU A B

Computer Engineering AddSub page 23 Branch logic Sgn/Ze extend Zero ext. Addi rt rs Imm ALU A B

Computer Engineering AddSub page 24 Branch logic Sgn/Ze extend Zero ext. Addi rt rs Imm ALU A B

Computer Engineering AddSub page 25 Branch logic Sgn/Ze extend Zero ext. Addi rt rs Imm ALU A B

Computer Engineering AddSub page 26 Branch logic Sgn/Ze extend Zero ext. Addi rt rs Imm … next instr ALU A B