Digital Design Copyright © 2006 Frank Vahid 1 a 0 0 1 1 b 0 1 0 1 F InputsOutput a'b'a' b Converting among Representations Can convert from any representation.

Slides:



Advertisements
Similar presentations
Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
Advertisements

CPE 201 Digital Design Lecture 25: Register Transfer Level Design (2)
Lecture 23: Registers and Counters (2)
Registers and Counters
1 Counter with Parallel Load Up-counter that can be loaded with external value –Designed using 2x1 mux – ld input selects incremented value or external.
Digital Design - Sequential Logic Design Chapter 3 - Sequential Logic Design.
COE 202: Digital Logic Design Combinational Circuits Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Chapter 4: Datapath Components Slides to accompany the textbook Digital Design, First Edition,
Sequential Logic Design Process A sequential circuit that controls Boolean outputs and a specific time- ordered behavior is called a controller. StepDescription.
Register-Transfer Level (RTL) Design
1 Introduction Chapters 2 & 3: Introduced increasingly complex digital building blocks –Gates, multiplexors, decoders, basic registers, and controllers.
2-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Fundamentals of Digital.
Chapter 9: Hardware Description Languages
1 Counters N-bit up-counter: N-bit register that can increment (add 1) to its own value on each clock cycle –0000, 0001, 0010, 0011,...., 1110, 1111, 0000.
1 Register-Transfer Level (RTL) Design Recall –Chapter 2: Combinational Logic Design First step: Capture behavior (using equation or truth table) Remaining.
1 Optimizations and Tradeoffs We now know how to build digital circuits –How can we build better circuits? Let’s consider two important design criteria.
Digital Design 2e Copyright © 2010 Frank Vahid 1 Digital Design Chapter 4: Datapath Components Copyright © 2010 Frank Vahid Instructors of courses requiring.
Digital Design – Optimizations and Tradeoffs
Chapter 4: Datapath Components
Contemporary Logic Design Arithmetic Circuits © R.H. Katz Lecture #24: Arithmetic Circuits -1 Arithmetic Circuits (Part II) Randy H. Katz University of.
Basic Register Typically, we store multi-bit items
1 Introduction Chapters 2 & 3: Introduced increasingly complex digital building blocks –Gates, multiplexors, decoders, basic registers, and controllers.
1 Carry-Ripple Adder Using full-adder instead of half-adder for first bit, we can include a “carry in” bit in the addition –Will be useful later when we.
Chapter 7 - Part 2 1 CPEN Digital System Design Chapter 7 – Registers and Register Transfers Part 2 – Counters, Register Cells, Buses, & Serial Operations.
Chapter 4: Datapath Components
Combinational Logic Design Process
Controller Design Five step controller design process.
Chapter 9: Hardware Description Languages
Digital Fundamentals Floyd Chapter 9 Tenth Edition
Registers and Counters
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Building Functions.
Digital Design - Combinational Logic Design Chapter 2 - Combinational Logic Design.
CS 151: Digital Design Chapter 3 3-8: Encoding. CS 151 Encoding Encoding - the opposite of decoding - the conversion of a maximum of 2 n input code to.
Digital Electronics.
COE 202: Digital Logic Design Combinational Circuits Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
EEE2243 Digital System Design Chapter 4: Datapath Components by Muhazam Mustapha, February 2012.
Digital Logic Design Review Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM 2010.
CHAPTER 4 Combinational Logic
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
Introduction to Sequential Logic Design Finite State-Machine Design.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 6:
EEE2243 Digital System Design Chapter 4: Verilog HDL (Sequential) by Muhazam Mustapha, January 2011.
Chap 5. Registers and Counters. Chap Definition of Register and Counter l a clocked sequential circuit o consist of a group of flip-flops & combinational.
© BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing.
Digital Logic Design.
Arithmetic Circuits. Half Adder ABSumCarry
CS151 Introduction to Digital Design
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Digital Design 2e Copyright © 2010 Frank Vahid 1 How To Capture Desired Behavior as FSM List states –Give meaningful names, show initial state –Optionally.
Lecture 21: Registers and Counters (1)
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Digital Design 2e Copyright © 2010 Frank Vahid 1 Digital Design Chapter 4: Datapath Components Copyright © 2010 Frank Vahid Instructors of courses requiring.
Learning Outcome By the end of this chapter, students are expected to understand the design, operation and block diagram of the following datapath components:
Module 11.  In Module 9, we have been introduced to the concept of combinational logic circuits through the examples of binary adders.  Meanwhile, in.
Chap 5. Registers and Counters
1 DLD Lecture 16 More Multiplexers, Encoders and Decoders.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Digital Design 2e Copyright © 2010 Frank Vahid 1 RTL Design Process: Create a datapath Sub-steps –HLSM data inputs/outputs  Datapath inputs/outputs. –HLSM.
Digital Design 2e Copyright © 2010 Frank Vahid 1 Chapter 4: Datapath Components Instructor: Dr. Hyunyoung Lee Copyright © 2010 Frank Vahid Instructors.
Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Chapter 4: Datapath Components Slides to accompany the textbook Digital Design, First Edition,
Digital Electronics Multiplexer
CS221: Digital Logic Design Combinational Circuits 3
Digital Decode & Correction Logic
Chapter 2: Combinational Logic Design
Learning Outcome By the end of this chapter, students are expected to be able to: Design State Machine Write Verilog State Machine by Boolean Algebra and.
Digital Electronics Multiplexer
VHDL (VHSIC Hardware Description Language)
Introduction to Sequential Circuits
Chapter 4: Datapath Components
Presentation transcript:

Digital Design Copyright © 2006 Frank Vahid 1 a b F InputsOutput a'b'a' b Converting among Representations Can convert from any representation to any other Common conversions –Equation to circuit (we did this earlier) –Truth table to equation (which we can convert to circuit) Easy -- just OR each input term that should output 1 –Equation to truth table Easy -- just evaluate equation for each input combination (row) Creating intermediate columns helps a b F InputsOutputs F = sum of a’b’ a’b Term F = a’b’ + a’b c a b F Q: Convert to equation a F = ab’c + abc’ + abc ab’c abc’ abc a Q: Convert to truth table: F = a’b’ + a’b

Digital Design Copyright © 2006 Frank Vahid 2 Decoder Example New Year’s Eve Countdown Display –Microprocessor counts from 59 down to 0 in binary on 6-bit output –Want illuminate one of 60 lights for each binary number –Use 6x64 decoder 4 outputs unused d0 d1 d2 d3 i0 i1 i2 i3 i4 i5 e 6x64 dcd d58 d59 d60 d61 d62 d63 M ic r op r o c essor 0 Happy New Year a

Digital Design Copyright © 2006 Frank Vahid 3 Controller Design: Laser Timer Example Step 1: Capture the FSM –Already done Step 2: Create architecture –2-bit state register (for 4 states) –Input b, output x –Next state signals n1, n0 Step 3: Encode the states –Any encoding with each state unique will work x=1 x=0 b b’ On2On1 Off On3 a a Inputs: b; Outputs: x Combinational logic State register s1s0 n1 n0 x b clk FSM outputs FSM inputs FSM outputs

Digital Design Copyright © 2006 Frank Vahid 4 Controller Design: Laser Timer Example (cont) Step 4: Create state table x=1 x=0 b b’ On2On1 Off On3 Inputs: b; Outputs: x a

Digital Design Copyright © 2006 Frank Vahid 5 Controller Design: Laser Timer Example (cont) Step 5: Implement combinational logic a x = s1 + s0 (note from the table that x=1 if s1 = 1 or s0 = 1) n1 = s1’s0b’ + s1’s0b + s1s0’b’ + s1s0’b n1 = s1’s0 + s1s0’ n0 = s1’s0’b + s1s0’b’ + s1s0’b n0 = s1’s0’b + s1s0’

Digital Design Copyright © 2006 Frank Vahid 6 Controller Design: Laser Timer Example (cont) Step 5: Implement combinational logic (cont) a x = s1 + s0 n1 = s1’s0 + s1s0’ n0 = s1’s0’b + s1s0’ n1 n0 s0 s1 clk Combinational Logic State register b FSM outputs FSM inputs x

Digital Design Copyright © 2006 Frank Vahid 7 Register Example using the Load Input: Weight Sampler Scale has two displays –Present weight –Saved weight –Useful to compare present item with previous item Use register to store weight –Pressing button causes present weight to be stored in register Register contents always displayed as “Saved weight,” even when new present weight appears Scale Saved weight Weight Sampler Present weight clk b Save I3I2I1I0 Q3Q2Q1Q0 load 3 pounds pounds 1 a

Digital Design Copyright © 2006 Frank Vahid cos FA ciba cos FA ba 10 cos FA ba cos FA ba (d) Output after 8ns (4 FA delays) Carry-Ripple Adder’s Behavior 0 cos FA 001 co1 010 ciba cos FA ba 10 cos FA ba cos FA ba (b) Outputs after 4ns (2 FA delays) 0 0 cos FA co2 010 ciba cos FA ba 10 cos FA ba cos FA ba (c) Outputs after 6ns (3 FA delays) a (answer should be 01000) 1 Correct answer appears after 4 FA delays

Digital Design Copyright © 2006 Frank Vahid 9 Magnitude Comparator How does it work? in_gt in_eq in_lt out_gt out_eq out_lt Igt Ieq Ilt Stage3 a3b3 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage2 a2b2 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage1 a1b1 ab in_gt in_eq in_lt out_gt out_eq out_lt AgtB AeqB AltB Stage0 a0b ab (a) = in_gt in_eq in_lt out_gt out_eq out_lt Igt Ieq Ilt Stage3 a3b3 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage2 a2b2 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage1 a1b1 ab in_gt in_eq in_lt out_gt out_eq out_lt AgtB AeqB AltB Stage0 a0b ab (b) = = 1001 ? Ieq=1 causes this stage to compare a

Digital Design Copyright © 2006 Frank Vahid 10 Magnitude Comparator Final answer appears on the right Takes time for answer to “ripple” from left to right Thus called “carry-ripple style” after the carry-ripple adder –Even though there’s no “carry” involved 1011 = 1001 ? in_gt in_eq in_lt out_gt out_eq out_lt Igt Ieq Ilt Stage3 a3b3 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage2 a2b2 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage1 a1b1 ab in_gt in_eq in_lt out_gt out_eq out_lt AgtB AeqB AltB Stage0 a0b ab (c) > in_gt in_eq in_lt out_gt out_eq out_lt Igt Ieq Ilt Stage3 a3b3 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage2 a2b2 ab in_gt in_eq in_lt out_gt out_eq out_lt Stage1 a1b1 ab in_gt in_eq in_lt out_gt out_eq out_lt AgtB AeqB AltB Stage0 a0b ab (d) a

Digital Design Copyright © 2006 Frank Vahid 11 Counter Example: Light Sequencer Illuminate 8 lights from right to left, one at a time, one per second Use 3-bit up-counter to counter from 0 to 7 Use 3x8 decoder to illuminate appropriate light Note: Used 3-bit counter with 3x8 decoder –NOT an 8-bit counter – why not? lights bit up-counter cnt tcc2c1c0 3 x 8 dcdi2i1i0 unused 1 clk (1Hz) d7d6d5d4d3d2d1d0 a

Digital Design Copyright © 2006 Frank Vahid 12 RTL Example: Bus Interface WaitMyAddress Inputs: rd (bit); Q (32 bits); A, Faddr (4 bits) Outputs: D (32 bits) Local register: Q1 (32 bits) rd’ rd SendData D = “Z” Q1 = Q (A = Faddr) and rd ((A = Faddr) and rd)’ D = Q1 Step 2: Create a datapath (a) Datapath inputs/outputs (b) Instantiate declared registers (c) Instantiate datapath components and connections Datapath Bus interface Q1_ld ld Q1 FQaddr 4432 A D_en A_eq_Faddr = (4-bit) 32 D a

Digital Design Copyright © 2006 Frank Vahid 13 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0S1S2 S1 S2 S3 State Reduction Example Given FSM on the right –Step 1: Mark state pairs having different outputs as nonequivalent S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0S1S2 S1 S2 S3 S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0S1S2 S1 S2 S3 S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y a

Digital Design Copyright © 2006 Frank Vahid 14 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y S0S1S2 S1 S2 S3 State Reduction Example Given FSM on the right –Step 1: Mark state pairs having different outputs as nonequivalent –Step 2: For each unmarked state pair, write the next state pairs for the same input values S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y x=0 (S2, S2) x’ x=1 (S2, S2) S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y x x (S3, S1) x=0 (S2, S2) S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y (S3, S1) x’ (S0, S2) x=1 S0S1S2 S1 S2 S3 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y (S0, S2) xx (S3, S1) x=0 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y (S2, S2) S0S1S2 S1 S2 S3 (S3, S1) (S0, S2) (S3, S1) x’ (S0, S2) x=1 S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y (S2, S2) S0S1S2 S1 S2 S3 (S3, S1) (S0, S2) (S3, S1) (S0, S2) x x (S3, S3) S0 S1 y=0 y=1 S2 y=1 S3 y=1 x xx x’ x Inputs: x; Outputs: y (S2, S2) S0S1S2 S1 S2 S3 (S3, S1) (S0, S2) (S3, S1) (S0, S2) (S3, S3) a

Digital Design Copyright © 2006 Frank Vahid 15 State Encoding: One-Hot Encoding One-hot encoding –One bit per state – a bit being ‘1’ corresponds to a particular state –Alternative to minimum bit-width encoding in previous example –For A, B, C, D: A: 0001, B: 0010, C: 0100, D: 1000 Example: FSM that outputs 0, 1, 1, 1 –Equations if one-hot encoding: n3 = s2; n2 = s1; n1 = s0; x = s3 + s2 + s1 –Fewer gates and only one level of logic – less delay than two levels, so faster clock frequency Inputs: none; Outputs: x x=0 x=1 A B D C x= clk s1 n1 x s0 n0 State register clk n0 s3s2s1s0 n1 n2 n3 State register x delay (gate-delays) one-hot binary a