Truth Table! Review! Use this table and techniques we learned to transform from 1 to another! ! Gate Diagram! Today!

Similar documents
UC Berkeley CS61C : Machine Structures

CS61C : Machine Structures

Clever Signed Adder/Subtractor. Five Components of a Computer. The CPU. Stages of the Datapath (1/5) Stages of the Datapath : Overview

CS3350B Computer Architecture Winter 2015

Review. Pipeline big-delay CL for faster clock Finite State Machines extremely useful You ll see them again in 150, 152 & 164

CS61C : Machine Structures

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 27: Single- Cycle CPU Datapath Design

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 18 CPU Design: The Single-Cycle I ! Nasty new windows vulnerability!

CS61C : Machine Structures

CS61C : Machine Structures

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

! CS61C : Machine Structures. Lecture 22 Caches I. !!Instructor Paul Pearce! ITʼS NOW LEGAL TO JAILBREAK YOUR PHONE!

CS61C : Machine Structures

CSE140: Components and Design Techniques for Digital Systems

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single- Cycle CPU Datapath Control Part 1

Review: Abstract Implementation View

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Tailoring the 32-Bit ALU to MIPS

CS 351 Exam 2 Mon. 11/2/2015

inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 19 CPU Design: The Single-Cycle II & Control !

Chapter 4. The Processor

CS222: Processor Design

Systems Architecture

CENG 3420 Lecture 06: Datapath

Many ways to build logic out of MOSFETs

Lecture #17: CPU Design II Control

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

Midterm. Sticker winners: if you got >= 50 / 67

Lecture 10: Simple Data Path

UC Berkeley CS61C : Machine Structures

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

Topic Notes: MIPS Instruction Set Architecture

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

CS 351 Exam 2, Fall 2012

LECTURE 5. Single-Cycle Datapath and Control

Chapter 5 Solutions: For More Practice

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

CS61C : Machine Structures

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Processor (I) - datapath & control. Hwansoo Han

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

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

Chapter 4. The Processor

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

UCB CS61C : Machine Structures

are Softw Instruction Set Architecture Microarchitecture are rdw

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

The MIPS Processor Datapath

Instructors: Randy H. Katz David A. PaHerson hhp://inst.eecs.berkeley.edu/~cs61c/fa10. Fall Lecture #9. Agenda

UCB CS61C : Machine Structures

ECE232: Hardware Organization and Design

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Chapter 4. The Processor Designing the datapath

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

CS Computer Architecture Spring Week 10: Chapter

CS 2506 Computer Organization II

Introduction. Datapath Basics

I-Format Instructions (3/4) Define fields of the following number of bits each: = 32 bits


CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Register Transfer Level (RTL) Design

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

Levels in Processor Design

Computer Science and Engineering 331. Midterm Examination #1. Fall Name: Solutions S.S.#:

ECE331: Hardware Organization and Design

Single cycle MIPS data path without Forwarding, Control, or Hazard Unit

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B

Week 6: Processor Components

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

CS61C Machine Structures. Lecture 12 - MIPS Procedures II & Logical Ops. 2/13/2006 John Wawrzynek. www-inst.eecs.berkeley.

CPS104 Computer Organization Lecture 1. CPS104: Computer Organization. Meat of the Course. Robert Wagner

Chapter 4 The Processor 1. Chapter 4A. The Processor

University of California, Berkeley College of Engineering Department of Electrical Engineering and Computer Science

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation

ECE 2300 Digital Logic & Computer Organization. More Single Cycle Microprocessor

CPS104 Computer Organization Lecture 1

Instruction Set Architecture part 1 (Introduction) Mehran Rezaei

Review. Manage memory to disk? Treat as cache. Lecture #26 Virtual Memory II & I/O Intro

CS3350B Computer Architecture Quiz 3 March 15, 2018

ECE260: Fundamentals of Computer Engineering

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

ENCM 369 Winter 2013: Reference Material for Midterm #2 page 1 of 5

CS61C : Machine Structures

CS61C : Machine Structures

14:332:331. Lecture 1

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Review. Lecture #9 MIPS Logical & Shift Ops, and Instruction Representation I Logical Operators (1/3) Bitwise Operations

ECE260: Fundamentals of Computer Engineering

CS61C - Machine Structures. Lecture 6 - Instruction Representation. September 15, 2000 David Patterson.

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

Transcription:

CS61C L17 Combinational Logic Blocks and Intro to CPU Design (1)! inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 17 Combinational Logic Blocks and Intro to CPU Design 2010-07-20!!!Instructor Paul Pearce! Passwords that are simple, AND safe! Researchers at Harvard and Microsoft have developed a new scheme for password requirements that simply mandates that no single password may be too popular. Their findings will be presented at Hot Topics in Security next month.! http://www.technologyreview.com/computing/25826/ Review! Use this table and techniques we learned to transform from 1 to another! Boolean Expression! Truth Table! Gate Diagram! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (2)! Today! Data Multiplexors! Arithmetic and Logic Unit! Adder/Subtractor! Datapath design! Data Multiplexor (here 2-to-1, n-bit-wide)! mux! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (3)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (4)! N instances of 1-bit-wide mux! How many rows in TT?! How do we build a 1-bit-wide mux?! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (5)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (6)!

CS61C L17 Combinational Logic Blocks and Intro to CPU Design (7)! 4-to-1 Multiplexor?! How many rows in TT?! Is there any other way to do it?! Hint: NCAA tourney!! Ans: Hierarchically!! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (8)! Arithmetic and Logic Unit! Our simple ALU! Most processors contain a special logic block called Arithmetic and Logic Unit (ALU)! Weʼll show you an easy one that does ADD, SUB, bitwise AND, bitwise OR! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (9)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (10)! Adder/Subtracter Design -- how?! Truth-table, then determine canonical form, then minimize and implement as weʼve seen before! Look at breaking the problem down into smaller pieces that we can cascade or hierarchically layer! Administrivia! If you want a regrade for your midterm, staple a paper with your explanation (clearly indicating on what question you want more points) to your exam and turn it in to your TA in section Monday! Weʼll regrade the exam and your score MIGHT go down! We will regrade with respect to the established rubric, so that all tests are graded equally! Project 2 will be done with 1 partner (groups of 2). Start thinking about who you want to work with.! Hint: Your best friend may not be the best choice for a partner. Projects ruin friendships.! HW6 due tomorrow at midnight.! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (11)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (12)!

CS61C L17 Combinational Logic Blocks and Intro to CPU Design (13)! Adder/Subtracter One-bit adder LSB! Adder/Subtracter One-bit adder (1/2)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (14)! Adder/Subtracter One-bit adder (2/2)! N 1-bit adders 1 N-bit adder! +! +! +! b 0 " Overflow = c n?! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (15)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (16)! What op?! Consider a 2-bit signed # & overflow:! 10 = -2 + -2 or -1 11 = -1 + -2 only 00 = 0 NOTHING! ±! #! 01 = 1 + 1 only Highest adder! C 1 = Carry-in = C in, C 2 = Carry-out = C out! No C out or C in NO overflow!! C in, and C out NO overflow!! C in, but no C out A,B both > 0, overflow!! C out, but no C in A,B both < 0, overflow!! Consider a 2-bit signed # & overflow:!!10 = -2 + -2 or -1 11 = -1 + -2 only 00 = 0 NOTHING! 01 = 1 + 1 only Overflows when! ±! #! C in, but no C out A,B both > 0, overflow!! C out, but no C in A,B both < 0, overflow!! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (17)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (18)!

CS61C L17 Combinational Logic Blocks and Intro to CPU Design (19)! Extremely Clever Subtractor! Five Components of a Computer! A - B = A + (-B); how do we make -B? +! +! +! An xor is a Conditional Inverter! x y xor 0 0 0 0 1 1 1 0 1 1 1 0 Processor Control Datapath Computer Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Disk (where programs, data live when not running) Display, Printer CS61C L17 Combinational Logic Blocks and Intro to CPU Design (20)! The CPU! Processor (CPU): the active part of the computer, which does all the work (data manipulation and decisionmaking)! Datapath: portion of the processor which contains hardware necessary to perform operations required by the processor (the brawn)! Control: portion of the processor (also in hardware) which tells the datapath what needs to be done (the brain)! Stages of the Datapath : Overview! Problem: a single, atomic block which executes an instruction (performs all necessary operations beginning with fetching the instruction) would be too bulky and inefficient! Solution: break up the process of executing an instruction into stages, and then connect the stages to create the whole datapath! smaller stages are easier to design! easy to optimize (change) one stage without touching the others! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (21)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (22)! Stages of the Datapath (1/5)! Stages of the Datapath (2/5)! There is a wide variety of MIPS instructions: so what general steps do they have in common?! Stage 1: Instruction Fetch! no matter what the instruction, the 32-bit instruction word must first be fetched from memory (the cache-memory hierarchy)! also, this is where we Increment PC (that is, PC = PC + 4, to point to the next instruction: byte addressing so + 4)! Stage 2: Instruction Decode! upon fetching the instruction, we next gather data from the fields (decode all necessary instruction data)! first, read the opcode to determine instruction type and field lengths! second, read in data from all necessary registers! for add, read two registers! for addi, read one register! for jal, no reads necessary! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (23)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (24)!

CS61C L17 Combinational Logic Blocks and Intro to CPU Design (25)! Stages of the Datapath (3/5)! Stage 3: ALU (Arithmetic-Logic Unit)! the real work of most instructions is done here: arithmetic (+, -, *, /), shifting, logic (&, ), comparisons (slt)! what about loads and stores?! lw $t0, 40($t1)! the address we are accessing in memory = the value in $t1 PLUS the value 40! so we do this addition in this stage! Stages of the Datapath (4/5)! Stage 4: Memory Access! actually only the load and store instructions do anything during this stage; the others remain idle during this stage or skip it all together! since these instructions have a unique step, we need this extra stage to account for them! as a result of the cache system, this stage is expected to be fast! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (26)! Stages of the Datapath (5/5)! Generic Steps of Datapath! Stage 5: Register Write! most instructions write the result of some computation into a register! examples: arithmetic, logical, shifts, loads, slt! what about stores, branches, jumps?! donʼt write anything into a register at the end! these remain idle during this fifth stage or skip it all together! PC" +4" instruction" memory" 1. Instruction" Fetch" rd" rs" rt" imm" registers" 2. Decode/" Register" Read" ALU Data" memory" 5. Reg." 3. Execute" 4. Memory" Write" CS61C L17 Combinational Logic Blocks and Intro to CPU Design (27)! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (28)! Peer Instruction! 1) Truth table for mux with 4-bits of select is 2 4 rows long! 2) We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (29)! 12 a) FF b) FT c) TF d) TT And In conclusion! Use muxes to select among input! S input bits selects 2 S inputs! Each input can be n-bits wide, independent of S! Can implement muxes hierarchically! ALU can be implemented using a mux! Coupled with basic block elements! N-bit adder-subtractor done using N 1-bit adders with XOR gates on input! XOR serves as conditional inverter! CPU design involves Datapath,Control! Datapath in MIPS involves 5 CPU stages! 1. Instruction Fetch! 2. Instruction Decode & Register Read! 3. ALU (Execute)! 4. Memory! 5. Register Write! CS61C L17 Combinational Logic Blocks and Intro to CPU Design (31)!