CS61C : Machine Structures

Similar documents
CS61C : Machine Structures

Latches. October 13, 2003 Latches 1

Design of Sequential Circuits

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Combinatorial Logic Design Multiplexers and ALUs CS 64: Computer Organization and Design Logic Lecture #13

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

CSC 322: Computer Organization Lab

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

Floating Point Representation and Digital Logic. Lecture 11 CS301

ELEN Electronique numérique

Adders, subtractors comparators, multipliers and other ALU elements

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

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

Adders, subtractors comparators, multipliers and other ALU elements

Fundamentals of Digital Design

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

ECE/CS 250 Computer Architecture

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

Sequential Logic Circuits

Review for Final Exam

Systems I: Computer Organization and Architecture

CS/COE0447: Computer Organization

Adders allow computers to add numbers 2-bit ripple-carry adder

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

ELCT201: DIGITAL LOGIC DESIGN

Chapter 4. Sequential Logic Circuits

mith College Computer Science CSC270 Spring 16 Circuits and Systems Lecture Notes Week 2 Dominique Thiébaut

Numbers and Arithmetic

Philadelphia University Student Name: Student Number:

Time Allowed 3:00 hrs. April, pages

CSE370 HW6 Solutions (Winter 2010)

CS/COE0447: Computer Organization

Synchronous Sequential Logic

ALU A functional unit

Sequential Circuit Analysis

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Lecture 22 Chapters 3 Logic Circuits Part 1

Combinational Logic Design Arithmetic Functions and Circuits

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

Numbers and Arithmetic

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

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

Logic Design II (17.342) Spring Lecture Outline

CprE 281: Digital Logic

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

State and Finite State Machines

Sequential vs. Combinational

CPS 104 Computer Organization and Programming Lecture 11: Gates, Buses, Latches. Robert Wagner

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Philadelphia University Student Name: Student Number:

Lecture 13: Sequential Circuits, FSM

CSC9R6 Computer Design. Practical Digital Logic

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

Lecture 8: Sequential Networks and Finite State Machines

Philadelphia University Faculty of Engineering

Digital Electronics Circuits 2017

Synchronous Sequential Circuit Design. Digital Computer Design

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

Arithme(c logic units and memory

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Introduction to Digital Logic

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

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Introduction to Digital Logic Missouri S&T University CPE 2210 Multiplexers/Demultiplexers

Binary addition example worked out

Sequential Logic Worksheet

Logic. Combinational. inputs. outputs. the result. system can

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

211: Computer Architecture Summer 2016

Combinational Logic Design Combinational Functions and Circuits

Homework Assignment #1 Solutions EE 477 Spring 2017 Professor Parker

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Lecture 13: Sequential Circuits, FSM

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Topic 8: Sequential Circuits

Lecture 7: Logic design. Combinational logic circuits

Binary addition by hand. Adding two bits

Lecture 3 Review on Digital Logic (Part 2)

Sequential Circuits. Circuits with state. Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. L06-1

EE 209 Logic Cumulative Exam Name:

CS470: Computer Architecture. AMD Quad Core

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

CHAPTER1: Digital Logic Circuits Combination Circuits

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

University of Guelph School of Engineering ENG 2410 Digital Design Fall There are 7 questions, answer all questions.

LECTURE 28. Analyzing digital computation at a very low level! The Latch Pipelined Datapath Control Signals Concept of State

EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters

UNIVERSITY OF WISCONSIN MADISON

CPE100: Digital Logic Design I

Computer Architecture. ESE 345 Computer Architecture. Design Process. CA: Design process

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

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

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

Digital Logic Appendix A

Midterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two.

Mealy & Moore Machines

Transcription:

inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #15: Combinational Logic Blocks 2005-07-14 CS 61C L15 Blocks (1) Andy Carle

Outline CL Blocks Latches & Flip Flops A Closer Look CS 61C L15 Blocks (2)

Review (1/3) Use this table and techniques we learned to transform from 1 to another CS 61C L15 Blocks (3)

(2/3): Circuit & Algebraic Simplification CS 61C L15 Blocks (4)

(3/3):Laws of Boolean Algebra CS 61C L15 Blocks (5)

CL Blocks Let s use our skills to build some CL blocks: Multiplexer (mux) Adder ALU CS 61C L15 Blocks (6)

Data Multiplexor (here 2-to-1, n-bit-wide) mux CS 61C L15 Blocks (7)

N instances of 1-bit-wide mux CS 61C L15 Blocks (8)

How do we build a 1-bit-wide mux? CS 61C L15 Blocks (9)

4-to-1 Multiplexor? CS 61C L15 Blocks (10)

An Alternative Approach Hierarchically! CS 61C L15 Blocks (11)

Arithmetic and Logic Unit Most processors contain a logic block called Arithmetic/Logic Unit (ALU) We ll show you an easy one that does ADD, SUB, bitwise AND, bitwise OR CS 61C L15 Blocks (12)

Our simple ALU CS 61C L15 Blocks (13)

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 CS 61C L15 Blocks (14)

N 1-bit adders 1 N-bit adder b0 + + + CS 61C L15 Blocks (15)

Adder/Subtracter One-bit adder LSB CS 61C L15 Blocks (16)

Adder/Subtracter One-bit adder (1/2) CS 61C L15 Blocks (17)

Adder/Subtracter One-bit adder (2/2) CS 61C L15 Blocks (18)

What about overflow? Consider a 2-bit signed # & overflow: 10 = -2 + -2 or -1 11 = -1 + -2 only ± # 00 = 0 NOTHING! 01 = 1 + 1 only Highest adder What op? 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! CS 61C L15 Blocks (19)

What about 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! CS 61C L15 Blocks (20)

Extremely Clever Subtractor CS 61C L15 Blocks (21)

Administrivia We re now halfway through the semester yikes HW 45 Due Monday Proj2 coming Logisim! CS 61C L15 Blocks (22)

State Circuits Overview State circuits have feedback, e.g. in0 in1 Combi- lab 12 national counter Logic out0 out1 Output is function of inputs + fed-back signals. Feedback signals are the circuit's state. What aspects of this circuit might cause complications? CS 61C L15 Blocks (23)

A simpler state circuit: two inverters 0 1! 0 1 0 When started up, it's internally stable. Provide an or gate for coordination: S 01 10 01 10 OR Q 01 What's the result? How do we set to 0? CS 61C L15 Blocks (24)

S An R-S latch (cross-coupled NOR gates) S means set (to 1), R means reset (to 0). 10 10 01 10 10 OR 10 Hold! R 10 Adding Q gives standard RS-latch: CS 61C L15 Blocks (25) _ Q OR Truth table S R Q 0 0 hold (keep value) 0 1 0 1 0 1 1 1 unstable A B N O R 0 0 1 0 1 0 1 0 0 1 1 0 Q

An R-S latch (in detail) A B NOR 0 0 1 0 1 0 1 0 0 1 1 0 CS 61C L15 Blocks (26) Truth table _ S R Q Q Q(t+ t) 0 0 0 1 0 hold 0 0 1 0 1 hold 0 1 0 1 0 reset 0 1 1 0 0 reset 1 0 0 1 1 set 1 0 1 0 1 set 1 1 0 x x unstable 1 1 1 x x unstable

Controlling R-S latch with a clock Can't change R and S while clock is active. A B NOR 0 0 1 0 1 0 1 0 0 1 1 0 R' clock' S' R S Q Q' Clocked latches are called flip-flops. CS 61C L15 Blocks (27)

D flip-flop are what we really use Inputs C (clock) and D. When C is 1, latch open, output = D (even if it changes, transparent latch ) When C is 0, latch closed, output = stored value. C D A N D 0 0 0 0 1 0 1 0 0 1 1 1 CS 61C L15 Blocks (28)

D flip-flop details We don t like transparent latches We can build them so that the latch is only open for an instant, on the rising edge of a clock (as it goes from 0 1) D C Q Timing Diagram CS 61C L15 Blocks (29)

Edge Detection A B O 0 0 1 0 1 1 1 0 1 1 1 1 This is a rising-edge D Flip-Flop When the CLK transitions from 0 to 1 (rising edge) - Q D; Qbar not D All other times: Q Q; Qbar Qbar CS 61C L15 Blocks (30)

Peer Instruction A. Truth table for mux with 4 control signals has 2 4 rows B. We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl C. If 1-bit adder delay is T, the N-bit adder delay would also be T CS 61C L15 Blocks (31)

And In conclusion Use muxes to select among input S input bits selects 2S inputs Each input can be n-bits wide, indep of S 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 CS 61C L15 Blocks (32)