CS 61C: Great Ideas in Computer Architecture Synchronous Digital Systems

Similar documents
Intro To Digital Logic

Switches: basic element of physical implementations

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

CS61c: Representations of Combinational Logic Circuits

Floating Point Representation and Digital Logic. Lecture 11 CS301

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

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

Chapter 1 :: From Zero to One

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Lecture 7: Logic design. Combinational logic circuits

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

CMSC 313 Lecture 16 Announcement: no office hours today. Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

Lecture 22 Chapters 3 Logic Circuits Part 1

Lecture A: Logic Design and Gates

CMPE12 - Notes chapter 2. Digital Logic. (Textbook Chapters and 2.1)"

Fundamentals of Digital Design

ECE/CS 250 Computer Architecture

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

2.1. Unit 2. Digital Circuits (Logic)

CSE140: Components and Design Techniques for Digital Systems. Introduction. Instructor: Mohsen Imani

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

CS/COE0447: Computer Organization

EEE130 Digital Electronics I Lecture #4

Computer Science. 20. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Synchronous Sequential Logic

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

CMSC 313 Lecture 15 Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

Digital Circuits. 1. Inputs & Outputs are quantized at two levels. 2. Binary arithmetic, only digits are 0 & 1. Position indicates power of 2.

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Chapter 2: Switching Algebra and Logic Circuits

Gates and Logic: From switches to Transistors, Logic Gates and Logic Circuits

State and Finite State Machines

Latches. October 13, 2003 Latches 1

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Gates and Logic: From Transistors to Logic Gates and Logic Circuits

Applications. Smartphone, tablet, game controller, antilock brakes, microprocessor, Wires

For smaller NRE cost For faster time to market For smaller high-volume manufacturing cost For higher performance

Numbers and Arithmetic

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

CSC9R6 Computer Design. Practical Digital Logic

CS/COE0447: Computer Organization

ECE/CS 250: Computer Architecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Benjamin Lee

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

Computer organization

DIGITAL LOGIC CIRCUITS

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

CS 226: Digital Logic Design

20. Combinational Circuits

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Gates and Logic: From Transistors to Logic Gates and Logic Circuits

Introduction to CMOS VLSI Design Lecture 1: Introduction

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Fundamentals of Computer Systems

School of Computer Science and Electrical Engineering 28/05/01. Digital Circuits. Lecture 14. ENG1030 Electrical Physics and Electronics

Digital Logic Appendix A

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

ALU A functional unit

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

Welcome to EECS 150: Components and Design Techniques for Digital Systems

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

Binary addition example worked out

DIGITAL LOGIC CIRCUITS

Digital Logic. Lecture 5 - Chapter 2. Outline. Other Logic Gates and their uses. Other Logic Operations. CS 2420 Husain Gholoom - lecturer Page 1

CSE370: Introduction to Digital Design

Computer Organization: Boolean Logic

From Physics to Logic

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

Numbers and Arithmetic

Welcome to EECS 150: Components and Design Techniques for Digital Systems

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

Implementation of Boolean Logic by Digital Circuits

control in out in out Figure 1. Binary switch: (a) opened or off; (b) closed or on.

14:332:231 DIGITAL LOGIC DESIGN. Organizational Matters (1)

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

Chapter 5 CMOS Logic Gate Design

CPE100: Digital Logic Design I

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

Digital electronics form a class of circuitry where the ability of the electronics to process data is the primary focus.

Computer Science. 19. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section 6.1.

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Adders, subtractors comparators, multipliers and other ALU elements

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

ELEC Digital Logic Circuits Fall 2014 Switching Algebra (Chapter 2)

Contents. Chapter 2 Digital Circuits Page 1 of 30

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Memory, Latches, & Registers

Introduction to Computer Engineering ECE 203

ECE321 Electronics I

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Chapter 2 Combinational Logic Circuits

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

Transcription:

CS 61C: Great Ideas in Computer Architecture Synchronous Digital Systems Instructors: Krste Asanovic & Vladimir Stojanovic h>p://inst.eecs.berkeley.edu/~cs61c/sp15 1

So3ware Parallel Requests Assigned to computer e.g., Search Katz Parallel Threads Assigned to core e.g., Lookup, Ads Parallel InstrucPons >1 instrucpon @ one Pme e.g., 5 pipelined instrucpons Parallel Data >1 data item @ one Pme e.g., Add of 4 pairs of words Hardware descrippons All gates @ one Pme Programming Languages You are Here! Harness Parallelism & Achieve High Performance Hardware Warehouse Scale Computer Core Memory Input/Output InstrucPon Unit(s) Cache Memory Computer (Cache) Core Core FuncPonal Unit(s) A 0 +B 0 A 1 +B 1 A 2 +B 2 A 3 +B 3 Smart Phone Today Logic Gates 2

Machine Interpreta4on Levels of RepresentaPon/ InterpretaPon High Level Language Program (e.g., C) Compiler Assembly Language Program (e.g., MIPS) Assembler Machine Language Program (MIPS) Hardware Architecture DescripCon (e.g., block diagrams) Architecture Implementa4on temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; lw $t0, 0($2) lw $t1, 4($2) sw $t1, 0($2) sw $t0, 4($2) Anything can be represented as a number, i.e., data or instrucpons 0000 1001 1100 0110 1010 1111 0101 1000 1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111! Logic Circuit DescripCon (Circuit SchemaCc Diagrams) 3

Hardware Design Next several weeks: how a modern processor is built, starpng with basic elements as building blocks Why study hardware design? Understand capabilipes and limitapons of HW in general and processors in parpcular What processors can do fast and what they can t do fast (avoid slow things if you want your code to run fast!) Background for more in- depth HW courses (CS 150, CS 152) Hard to know what you ll need for next 30 years There is only so much you can do with standard processors: you may need to design own custom HW for extra performance Even some commercial processors today have customizable hardware! 4

Synchronous Digital Systems Hardware of a processor, such as the MIPS, is an example of a Synchronous Digital System Synchronous: All operapons coordinated by a central clock Digital: Heartbeat of the system! Represent all values by discrete values Two binary digits: 1 and 0 Electrical signals are treated as 1 s and 0 s 1 and 0 are complements of each other High /low voltage for true / false, 1 / 0 5

Switches: Basic Element of Physical ImplementaPons ImplemenPng a simple circuit (arrow shows acpon if wire changes to 1 or is asserted): A Z Close switch (if A is 1 or asserted) and turn on light bulb (Z) A Z Open switch (if A is 0 or unasserted) and turn off light bulb (Z) Z A 6

Switches (cont d) Compose switches into more complex ones (Boolean funcpons): A AND B Z A and B OR A Z A or B B 7

Historical Note Early computer designers built ad hoc circuits from switches Began to nopce common pa>erns in their work: ANDs, ORs, Master s thesis (by Claude Shannon) made link between work and 19 th Century MathemaPcian George Boole Called it Boolean in his honor Could apply math to give theory to hardware design, minimizapon, 8

Transistors High voltage (V dd ) represents 1, or true In modern microprocessors, Vdd ~ 1.0 Volt Low voltage (0 Volt or Ground) represents 0, or false Pick a midpoint voltage to decide if a 0 or a 1 Voltage greater than midpoint = 1 Voltage less than midpoint = 0 This removes noise as signals propagate a big advantage of digital systems over analog systems If one switch can control another switch, we can build a computer! Our switches: CMOS transistors 9

CMOS Transistor Networks Modern digital systems designed in CMOS MOS: Metal- Oxide on Semiconductor C for complementary: use pairs of normally- open and normally- closed switches Used to be called COS- MOS for complementary- symmetry - MOS CMOS transistors act as voltage- controlled switches Similar, though easier to work with, than electro- mechanical relay switches from earlier era Use energy primarily when switching 10

CMOS Transistors Three terminals: source, gate, and drain Switch acpon: if voltage on gate terminal is (some amount) higher/lower than source terminal then conducpng path established between drain and source terminals (switch is closed) Source Gate Drain Source Source Gate Drain Gate Drain Note circle symbol to indicate NOT or complement n-channel transitor open when voltage at Gate is low closes when: voltage(gate) > voltage (Threshold) (High resistance when gate voltage Low, Low resistance when gate voltage High) p-channel transistor closed when voltage at Gate is low opens when: voltage(gate) > voltage (Threshold) (Low resistance when gate voltage Low, High resistance when gate voltage High) 11

#2: Moore s Law # of transistors on an integrated circuit (IC) Predicts: 2X Transistors / chip every 2 years Modern microprocessor chips include several billion transistors Gordon Moore Intel Cofounder B.S. Cal 1950! Year 12

Intel 14nm Technology Plan view of transistors Side view of wiring layers 13

CMOS Circuit Rules Don t pass weak values => Use Complementary Pairs N- type transistors pass weak 1 s (V dd - V th ) N- type transistors pass strong 0 s (ground) Use N- type transistors only to pass 0 s (N for negapve) Converse for P- type transistors: Pass weak 0s, strong 1s Pass weak 0 s (V th ), strong 1 s (V dd ) Use P- type transistors only to pass 1 s (P for posipve) Use pairs of N- type and P- type to get strong values Never leave a wire undriven Make sure there s always a path to V dd or GND Never create a path from V dd to GND (ground) This would short- circuit the power supply! 14

CMOS Networks p-channel transistor closed when voltage at Gate is low opens when: voltage(gate) > voltage (Threshold) X what is the relationship between x and y? 1V x y 0V n-channel transitor open when voltage at Gate is low closes when: voltage(gate) > voltage (Threshold) Y 0 Volt (GND) 1 Volt (Vdd) 1 Volt (Vdd) 0 Volt (GND) Called an inverter or not gate 15

Two- Input Networks X Y what is the relationship between x, y and z? x y z 1V 0 Volt 0 Volt 1 Volt 0V Z 0 Volt 1 Volt 1 Volt 1 Volt 0 Volt 1 Volt 1 Volt 1 Volt 0 Volt Called a NAND gate (NOT AND) 16

Clickers/Peer InstrucPon X Y x y z A B C 1V 0 Volt 0 Volt 0 0 1 Volts Z 0 Volt 1 Volt 1 Volt 0 Volt 0 1 0 0 1 0 1 Volts Volts 0v 1 Volt 1 Volt 1 1 0 0 Volts 17

Administrivia Project 1-1 is out - due 3/01 See Sagar @ end of lec. if you spll don t have team Midterm is next Thursday 2/26, in class Covers up to and including the previous lecture 1 handwri>en, double sided, 8.5 x11 cheat sheet We ll give you MIPS green sheet DSP: Should have received email from Sagar this morning Conflicts/DSP must email/respond by tomorrow (Weds.) @ 23:59:59 18

Administrivia Review Sessions: TA: Probably 2/23, 6-8pm, waipng for room reservapon HKN: Saturday 2/21, 1-4pm, 100 GPB 19

CombinaPonal Logic Symbols Common combinaponal logic systems have standard symbols called logic gates Buffer, NOT A Z AND, NAND A B Z OR, NOR A B Z InverPng versions (NOT, NAND, NOR) easiest to implement with CMOS transistors (the switches we have available and use most) 20

Truth Tables for CombinaPonal Logic A B C D F Y 0 ExhausPve list of the output value generated for each combinapon of inputs 21

Truth Table Example #1: y= F(a,b): 1 iff a b a! b! y! 0! 0! 0! Y = A B + A B 0! 1! 1! 1! 0! 1! 1! 1! 0! Y = A + B XOR 22

Truth Table Example #2: A1 A0 B1 B0 2- bit Adder + C2 C1 C0 How Many Rows? 23

Truth Table Example #3: 32- bit Unsigned Adder How Many Rows? 24

Truth Table Example #4: 3- input Majority Circuit Y = A B C + A B C + A B C + A B C This is called Sum of Products form; Just another way to represent the TT as a logical expression Y = B C + A (B C + B C) Y = B C + A (B + C) More simplified forms (fewer gates and wires) 25

Boolean Algebra Use plus + for OR logical sum Use product for AND (a b or implied via ab) logical product Hat to mean complement (NOT) Thus ab + a + c = a b + a + c = (a AND b) OR a OR (NOT c ) 26

Boolean Algebra: Circuit & Algebraic SimplificaPon 27

Laws of Boolean Algebra X X = 0 X 0 = 0 X 1 = X X X = X X Y = Y X (X Y) Z = Z (Y Z) X (Y + Z) = X Y + X Z X Y + X = X X Y + X = X + Y X Y = X + Y X + X = 1 X + 1 = 1 X + 0 = X X + X = X X + Y = Y + X (X + Y) + Z = Z + (Y + Z) X + Y Z = (X + Y) (X + Z) (X + Y) X = X (X + Y) X = X Y X + Y = X Y Complementarity Laws of 0 s and 1 s IdenPPes Idempotent Laws CommutaPvity AssociaPvity DistribuPon UniPng Theorem United Theorem v. 2 DeMorgan s Law 28

Boolean Algebraic SimplificaPon Example 29

Boolean Algebraic SimplificaPon Example a b c y 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 30

Clickers/Peer InstrucPon Simplify Z = A+BC + A.(BC) A: Z = 0 B: Z = A(1+ BC) C: Z = (A + BC) D: Z = BC E: Z = 1 31

In the News: Spy Games Russian security firm claims US spy agencies insert code into disk drive firmware to snoop on foreign computers Also, a>acks computers not connected to internet by secrepng hardware that can listen to long- wave radio broadcasts Or through infected USB drives 32

Signals and Waveforms a n- 1 a n- 1 a 0 Noisy! Delay!

Signals and Waveforms: Grouping

Signals and Waveforms: Circuit Delay 2 3 4 5 3 10 0 1 5 13 4 6

Sample Debugging Waveform

Type of Circuits Synchronous Digital Systems consist of two basic types of circuits: CombinaPonal Logic (CL) circuits Output is a funcpon of the inputs only, not the history of its execupon E.g., circuits to add A, B (ALUs) SequenPal Logic (SL) Circuits that remember or store informapon aka State Elements E.g., memories and registers (Registers) 37

Uses for State Elements Place to store values for later re- use: Register files (like $1- $31 in MIPS) Memory (caches and main memory) Help control flow of informaion between combinaional logic blocks State elements hold up the movement of informapon at input to combinaponal logic blocks to allow for orderly passage 38

Accumulator Example Why do we need to control the flow of informapon? X i SUM S Want: S=0; for (i=0;i<n;i++) S = S + X i Assume: Each X value is applied in succession, one per cycle A}er n cycles the sum is present on S 39

First Try: Does this work? Feedback No! Reason #1: How to control the next iterapon of the for loop? Reason #2: How do we say: S=0? 40

Second Try: How About This? Register is used to hold up the transfer of data to adder Square wave clock sets when things change Rough Pming High (1) Low (0) High (1) Low (0) High (1) Low (0) Time Rounded Rectangle per clock means could be 1 or 0 Xi must be ready before clock edge due to adder delay 41

Model for Synchronous Systems CollecPon of CombinaPonal Logic blocks separated by registers Feedback is opponal Clock signal(s) connects only to clock input of registers Clock (CLK): steady square wave that synchronizes the system Register: several bits of state that samples on rising edge of CLK (posipve edge- triggered) or falling edge (negapve edge- triggered) 42

Register Internals n instances of a Flip- Flop Flip- flop name because the output flips and flops between 0 and 1 D is data input, Q is data output Also called D- type Flip- Flop 43

Camera Analogy Timing Terms Want to take a portrait Pming right before and a}er taking picture Set up Ime don t move since about to take picture (open camera shu>er) Hold Ime need to hold spll a}er shu>er opens unpl camera shu>er closes Time click to data Pme from open shu>er unpl can see image on output (viewscreen) 44

Hardware Timing Terms Setup Time: when the input must be stable before the edge of the CLK Hold Time: when the input must be stable a3er the edge of the CLK CLK- to- Q Delay: how long it takes the output to change, measured from the edge of the CLK 45

Maximum Clock Frequency What is the maximum frequency of this circuit? Hint: Frequency = 1/Period Max Delay = Setup Time + CLK- to- Q Delay + CL Delay 46

And in Conclusion, MulPple Hardware RepresentaPons Analog voltages quanpzed to represent logic 0 and logic 1 Transistor switches form gates: AND, OR, NOT, NAND, NOR Truth table mapped to gates for combinaponal logic design Boolean algebra for gate minimizapon State Machines Finite State Machines: made from Stateless combinaponal logic and Stateful Memory Logic (aka Registers) Clocks synchronize D- FF change (Setup and Hold Pmes important!) 47