Logic Design IS1200, spring 2015 Review Slides

Similar documents
Computer Organization and Components

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Synchronous Digital Logic Systems. Review of Digital Logic. Philosophy. Combinational Logic. A Full Adder. Combinational Logic

Sequential Circuits. Introduction to Digital Logic. Course Outline. Overview. Introduction to Digital Logic. Introduction to Sequential Circuits

Lecture 8: Sequential Logic

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

CHAPTER 4: Logic Circuits

MODULE 3. Combinational & Sequential logic

CHAPTER 4: Logic Circuits

6. Sequential Logic Flip-Flops

COMP12111: Fundamentals of Computer Engineering

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

ECEN454 Digital Integrated Circuit Design. Sequential Circuits. Sequencing. Output depends on current inputs

Chapter 3. Boolean Algebra and Digital Logic

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

CprE 281: Digital Logic

Chapter 3 Unit Combinational

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

Combinational vs Sequential

AIM: To study and verify the truth table of logic gates

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

First Name Last Name November 10, 2009 CS-343 Exam 2

Chapter 5 Sequential Circuits

211: Computer Architecture Summer 2016

Chapter 6 Sequential Circuits

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part B Sequential Logic Building Blocks

Chapter 4. Logic Design

CS/ECE 250: Computer Architecture. Basics of Logic Design: ALU, Storage, Tristate. Benjamin Lee

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Chapter 5 Sequential Systems. Introduction

Sequential Circuit Design: Part 1

COMP2611: Computer Organization. Introduction to Digital Logic

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

ALGORITHMS IN HW EECS150 ALGORITHMS IN HW. COMBINATIONAL vs. SEQUENTIAL. Sequential Circuits ALGORITHMS IN HW

Logic Devices for Interfacing, The 8085 MPU Lecture 4

MC9211 Computer Organization

Logic Design ( Part 3) Sequential Logic (Chapter 3)

Decade Counters Mod-5 counter: Decade Counter:

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

Basis of sequential circuits: the R-S latch

CS 61C: Great Ideas in Computer Architecture

VeriLab. An introductory lab for using Verilog in digital design (first draft) VeriLab

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Overview of Chapter 4

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

Logic. Andrew Mark Allen March 4, 2012

ENGR 303 Introduction to Logic Design Lecture 10. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

Logic Design. Flip Flops, Registers and Counters

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

EE292: Fundamentals of ECE

ECE 545 Digital System Design with VHDL Lecture 2. Digital Logic Refresher Part B Sequential Logic Building Blocks

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

6.3 Sequential Circuits (plus a few Combinational)

Chapter 5 Sequential Circuits

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

Learning Outcomes. Unit 13. Sequential Logic BISTABLES, LATCHES, AND FLIP- FLOPS. I understand the difference between levelsensitive

1. What does the signal for a static-zero hazard look like?

AN INTRODUCTION TO DIGITAL COMPUTER LOGIC

EXPERIMENT #6 DIGITAL BASICS

Logic Symbols with Truth Tables

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

WINTER 15 EXAMINATION Model Answer

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Principles of Computer Architecture. Appendix A: Digital Logic

CprE 281: Digital Logic

ECE 25 Introduction to Digital Design. Chapter 5 Sequential Circuits ( ) Part 1 Storage Elements and Sequential Circuit Analysis

Last time, we saw how latches can be used as memory in a circuit

Chapter 5 Sequential Circuits

CprE 281: Digital Logic

12/31/2010. Overview. 12-Latches and Flip Flops Text: Unit 11. Sequential Circuits. Sequential Circuits. Feedback. Feedback

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 151) Pass Marks: 24

Chapter 5: Synchronous Sequential Logic

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

IT T35 Digital system desigm y - ii /s - iii

Agenda. EE 260: Introduction to Digital Design Counters and Registers. Asynchronous (Ripple) Counters. Asynchronous (Ripple) Counters

COMP sequential logic 1 Jan. 25, 2016

Module -5 Sequential Logic Design

give sequence to events have memory (short-term) use feedback from output to input to store information

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Logic Circuits. A gate is a circuit element that operates on a binary signal.

D Latch (Transparent Latch)

Spiral Content Mapping. Spiral 2 1. Learning Outcomes DATAPATH COMPONENTS. Datapath Components: Counters Adders Design Example: Crosswalk Controller

Registers, Register Transfers and Counters Dr. Fethullah Karabiber

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Chapter 3 :: Sequential Logic Design

Fundamentals of Computer Systems

Read-only memory (ROM) Digital logic: ALUs Sequential logic circuits. Don't cares. Bus

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

EECS 270 Midterm 1 Exam Closed book portion Winter 2017

CSC Computer Architecture and Organization

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

CPS311 Lecture: Sequential Circuits

Registers. Unit 12 Registers and Counters. Registers (D Flip-Flop based) Register Transfers (example not out of text) Accumulator Registers

CprE 281: Digital Logic

EECS 270 Group Homework 4 Due Friday. June half credit if turned in by June

11. Sequential Elements

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Computer Architecture and Organization

Page 1. Some Definitions. Chapter 3: Sequential Logic. Sequential Logic. The Combinational Logic Unit. A NOR Gate with a Lumped Delay

Transcription:

2 I2, spring 25 Review lides ssociate Professor, KTH Royal Institute of Technology ssistant Research ngineer, University of alifornia, erkeley genda I lides version. I 3 umber ystems (/3) ecimal and inary umbers 4 How can we represent numbers? ecimal umbers,2,3,,,9,,,,73,,, 375 = 3 2 7 5 The base is. inary umbers, binary value is called a bit. This is what a computer system is using. Often, = true and = false 2 = 2 4 2 3 2 2 2 2 = What is the number in decimal form? 3 I I

umber ystems (2/3) ytes, ibbles, Words,, L, 5 umber ystems (3/3) Hexadecimal umbers 6 It s quite tedious to work with only binary numbers Therefore, bits are grouped into bytes, each consisting of bits. msb lsb In a group of bits, the least significant bit (lsb) is to the right. The most significant bit (msb) is to the left. Within a word, the terms are the most significant byte () and the least significant byte (L). 4 bits (half a byte) is called a nibble. L icroprocessors use data in the size of words. 32-bit processor has 32-bit words, a 64-bit processor has 64-bit words. I 32-bit word re decimal numbers a good way to represent: 5 4 4 3 ibbles? 6 5 ytes? 235 77 Problem: ibbles cannot be identified directly in the byte. Hexadecimal umbers oined at I in 963. From Greek hexi (six) and Latin decem (ten). ource: Harris and Harris, 23. byte can hold 256 different values,, 2, 3, 4, 5, 6, 7,, 9,,,,,, F,,,, 9,,,... 5 4 The base is 6. lways two digits for each byte. One digit = one nibble. I 54 6 Logic Gates (/3), OR, OT, and UF 7 Logic Gates (2/3), OR, XOR, and XOR H OR OT. ote the mall bubble at the end. OR OT OR. OT The small circle (called a bubble) inverse the signal. OT is also called an inverter. UF Looks like not, but has no circle. uffer. Logically the same as a wire. Relevant from an analog point of view. XOR xclusive OR, pronounced ex-or. XOR xclusive OT OR. I I

Logic Gates (3/3) ulti-input Logic Gates 9 ombinational ircuit H Gates can be generalized to have more than two inputs. For instance: 3 gate with 3 inputs. OR5 OT OR gate with 5 inputs. XOR3 xclusive OR gate with 3 inputs. n -input XOR gate is also called a parity gate. It outputs when odd number of inputs are. = = = = = = = = This circuit is combinational because its outputs depend only on its inputs. The circuit is memoryless, that is, it has no memory. We will introduce memory in Lecture 2 Observe that this (rather useless) circuit always outputs. s a logic formula, this is called a tautology. I I oolean lgebra (/4) Truth Tables and um-of-products Form truth table with random output (we have seen them before). We can create a boolean expression from the truth table The of one or more variables is called a product. The line over a variable is called the complement and is the inverse of the variable (OT). ometimes a prime is used instead. can be written using no space or using a dot, e.g.!! OR is written using the symbol. This form is called sum-of-products (surprise!) I oolean lgebra (2/4) ome Theorems Theorem ual ame! = = Identity! = = ull lement! = = = Idempotency Involution! = = omplements! =! = ommutativity (!)! =!(!) (!)(!)=!() () = = () ssociativity () =! ()!()= istributivity = (!) ote! ot as traditional algebra = xercise: erive the simplest form of expression olution: = I H 2 ommutativity istributivity omplements (dual) Identity Indempotency (dual)

3 oolean lgebra (3/4) e organ s Theorem Theorem ual! 2! 3 = 2 3 = ( 2 3 ) (! 2! 3 ) Perfect Induction = Proof by xhaustion = Proof by ases = ugustus e organ ritish mathematician and logician (6 7). Important law. For O (omplementary metal oxide semiconductor), and OR gates are preferred over and OR gates. I 2 bits for the data input multiplexer can be seen as a simple switch, selecting which signal that should pass through the block. output One possible implementation. onvince yourself of its correctness! I I 6 2 3 2 3 4: multiplexer can be defined hierarchically. 4: multiplexer (4 inputs, output). The control signal selects which input bit that is sent to the output. ombinational locks (2/3) ultiplexers It s a 2: ultiplexer. 5 ombinational locks (/3) ultiplexers What is this? Proof by perfect induction. xhaustively show all cases in a truth table. ut how can we know that this theorem is true? = = = = = = ote that these two columns are equal Prove the e organ s Theorem for three variables The law shows that these gates are equivalent 4 oolean lgebra (4/4) Proof by Perfect Induction What is the output signal for the 4: multiplexer with these inputs? 2 3 =, =, 2=, 3=, =, = nswer: = I

7 ombinational locks (3/3) ecoders decoder has inputs and 2 outputs. sserts exactly one output. ecoder half adder has a carry out signal. 3 2 out Idea: hain adders together 2:4 decoder (2 inputs, 4 output). ote that only one signal is on each row. This is called one-hot. I 9 n -bit carry propagate adder (P) sums two -bit inputs. out ote the notation for a -bit bus. ee course book Prefix adder (advanced part) ven faster. Used in modern computers. in out out xercise: omplete the truth table I rithmetic ircuits and umbers (3/7) egative umbers, ign/agnitude 5 bits signed/magnitude numbers 6 = 2 7 = 2-6 = 2-7 = 2-6 7 = = 2 hould be but 3 3 an we add two numbers using binary addition? 32-bit ripple-carry adder 3 3 Idea: Let msb represent the sign ( = negative, = positive) and the remaining bits the magnitude. This representation is called signed/magnitude numbers. Ripple-carry adder imple but slow. in How can we represent negative numbers? arry-lookahead adder Faster, divides into blocks. in Three common implementations of Ps are: out rithmetic ircuits and umbers (2/7) arry Propagate dders How can we add bigger numbers? H full adder has both carry out and carry in signals. 2 3 rithmetic ircuits and umbers (/7) Half and Full dders 2 2 = 2 = -3 Problem : inary addition does not work http://www.publicdomainpictures.net/view-image.php?image=93652&picture=negativ-film out 3 3 3 29 I in 2 = and 2 = - Problem 2: trange effect; we have two numbers for zero... I 2

rithmetic ircuits and umbers (4/7) egative umbers, Two s omplement 2 rithmetic ircuits and umbers (5/7) egative umbers, Two s omplement 22 olution: Two s complement numbers Which patterns can we find in the following 3-bit two s complement numbers. Only one number represent (olution to problem ) ll negative numbers have msb set. This is called the sign bit. 2 = 2 = 2 = 2 2 = 3 2 = -4 2 = -3 2 = -2 2 = - Positive numbers are represented as usual. an represent one more negative number than positive numbers. egative numbers are listed in reverse order. I Why is it called two s complement? ecause the negation of an -bit value X is 2 X. Is binary addition working with two s complement numbers? 5 bits two s complement numbers (check yourself) xample: = 3 and X = 3. Then 2 3 3 = 3 = 5 = 2 hould be I 2 = 2 = 2 = 2 2 = 3 2 = -4 2 = -3 2 = -2 2 = - -6 7 = = 2 6 = 2 7 = 2 2 2 = 2-6 = es, it works (general proof left as 2-7 = 2 an exercise). ote that the carry out is, but ignored here. rithmetic ircuits and umbers (6/7) egative umbers, Two s omplement 23 rithmetic ircuits and umbers (7/7) ubtract 24 ut, in this case we need a subtract operator to get negative numbers (we have an adder) nother way to take the two s complement of a number X with bits: Invert all bit of number X and add. xample: = 3 and X = 3. X = 3 = 2 inv(x) = 2, 2 2 = 2 (general proof omitted) 2 = 2 = 2 = 2 2 = 3 2 = -4 2 = -3 2 = -2 2 = - ubtract is simple to implemented with a carry propagate adder (P): Invert input signal and set in =. out in = ote that setting carry in to adds to. We can easily create a circuit where = results in and = results in - out I I

25 26 ombinational vs. Logic I ircuit without memory (previous lecture) Output depends only on the input. There is no memory. out in 2 3 (this lecture) epends on both current and prior input values. s a consequence, sequential logic has memory. Today, we will learn about: Latches Flip-Flips Registers cknowledgement: The structure and several of the good examples are derived from the book igital esign and omputer rchitecture (23) by.. Harris and. L. Harris. ircuit with memory We will discuss other kinds of memories in course module 4: emory hierarchy. I I istability What is the difference between these two circuits? nswer: one, but both circuits contain a cycle. What is the value of? nalysis by considering two cases: ase I: ase II: = = oth cases are stable. The circuit is bistable. I 27 otation convention: T-connections connect, four way connections do not. This circuit has 2 stable states. Hence, it is a memory that can store bit of information. Problem: We cannot decide what to store (there is no input) R Latch What is the behavior of this circuit? nalyze the 4 cases for inputs and R. R is the T signal and R is the RT signal. If and R are zero, the circuit remembers the previous value, called pre. We have a memory R pre pre Problem. The awkward case =, R= results in that both and are zero. R I 2 n R latch can be implemented using different gates. This is the abstract symbol for an R latch. Problem 2. ixes the issues of what and when updates are made. It is hard to design large circuits this way.

Latch 29 Flip-Flop 3 The latch solves the problems with the R latch. It has one data input, and a clock input.? R pre pre The symbol? means don t care. It is used to simplify truth tables (we can skip one row in this case). ometimes a symbol X or is used to describe don t care. ymbol describing a latch: lso called a transparent latch or level-sensitive latch. =, the latch is transparent ( flows through to ). =, the latch is opaque (the latch blocks data from flowing through). I flip-flop is edge-triggered and not level-triggered. in master slave out out ase I: = The master is transparent and the slave is opaque. in flows to. These symbols describe Flip-Flops. ondensed symbol ase II: = The slave is transparent and the master is opaque. flows to out. The flip-flop (the standard flip-flop) copies to on the rising edge, and remembers its state all other times. I Resettable and nabled Flip-Flops 3 Register 32 resettable flip-flop resets the flip-flop to when a reset signal is active. RT n enabled flip-flop has an input. Its state changes only when = and there is a raising clock edge (alled WR in the exercise). RT The line above the signal name shows that the reset signal is active low: The reset is active on. True or False physical / This resettable flip-flop is synchronously resettable, meaning that it resets on a rising clock edge. It is is not asynchronously resettable where the reset is independent of the clock. nswer: True n -bit register consists of flip-flops that share the same clock input. 4-bit register built out of flip-flops (using condensed symbol notation). 3 2 3 2 4 4 3: 3: bstract form of a 4-bit register. ote that registers can also have enable signals, reset signals etc. I I

Problematic ircuits 33 Floating Values and Tristate uffers 34 Unstable circuit. Illegal value (X) = = What is the value of? What is the value of? nswer: it oscillates. This circuit is called a ring oscillator. nswer: = X, called an unknown or illegal value. For example, when a wire is driven to both and at the same time. This situation is called contention. tristate (or three-state) buffer has high impedance if the output enable signal is not active. ommonly used in buses when connecting multiple chips. If the buffers are not enabled at the same time, contention is avoided. Z Z When the enable signal is not active, the output is said to be floating (using symbol Z). I I Output nable Register 35 Register File (/2) 36 xercise: reate a 2-bit register that has an output enable (O) input signal. If O = then is floating, else it outputs the registers state. O O register file can be used to read and write data using an address. Writing bits is done by giving write data to W3, write address to 3, and setting write enable W3 to. 2 3 W3 This is a multi-ported register file. Two read ports and one write port. Reads and writes can be done in parallel. W3 R R2 Reading bits from read data port R is done by giving an -bit read address to. ame for the second read port (R2 and 2). I I

Register File (2/2) 37 Register-Transfer Level - ynchronous ircuits 3 3 2 ecoder W3 W3 an also be implemented using tristate buffers (see exercises). R 2 R2 xample: Register file with address depth = 2 (4 different addresses) and -bit words ( = ). It is hard to analyze large asynchronous circuits that contain cycles. olution: esign synchronous sequential circuits, also called designing at the register-transfer level (RTL), which means that combinational logic is combined with registers states are only updated on clock edges Which of the following circuits are using RTL design / sequential synchronous logic? ombinational Logic ircuit es, with no feedback ombinational Logic ircuit o, because of latch. ombinational Logic ircuit o, has a cycle without register in the path I I Finite tate achines (Fs) 39 imple ealy achine xample 4 ynchronous Logics can be defined as Fs oore achine ( inputs, outputs, k states) inputs ext tate Logic k next state k state Output Logic outputs clock init st 2 nd 3rd ealy achine ( inputs, outputs, k states) inputs next k ext tate state k Logic state Outputs can be directly dependent on the inputs Output Logic outputs inputs next k ext tate state k Logic fter st, 2 nd etc. positive clock edge. state Output Logic outputs I I

4 42 dge-triggered Timing ethodology How fast can we run a circuit? The clock period must be longer than the worst-case of delays in the circuit. delay = t prop t combinational t setup t skew Time to propagate through the flip-flop or register. inputs The longest delay in the combinational logic. ecessary time before the rising clock edge. next k ext tate state k Logic race may occur when the values of state elements depend on the relative speed of logic elements in the circuit. The worst-case delay is computed for the feedback loop through the next state logic. state ompensate for clock skew: clock signals reach state elements at different time. Output Logic outputs ummary ome key take away points: ombinational Logic vs. Logic: ombinational logic has no memory, whereas sequential logic includes memory. Latches vs. Flip-Flops vs. Registers vs. Register File Flip-flops are edge triggered, registers combine flip-flops, and register files uses addresses to access data. ynchronous vs. synchronous ynchronous esign makes design work easier. ealy vs. oore achines oth are finite state machines (Fs). oore machines depend only on the state, whereas ealy machines depend on the state and the input. Thanks for listening! I I