Spiral 2-1. Datapath Components: Counters Adders Design Example: Crosswalk Controller

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

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

ALU A functional unit

Digital Control of Electric Drives

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

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

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

14:332:231 DIGITAL LOGIC DESIGN

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

Review for Final Exam

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Design of Sequential Circuits

CPE100: Digital Logic Design I

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits


EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

9.1. Unit 9. Implementing Combinational Functions with Karnaugh Maps or Memories

Digital Electronics Circuits 2017

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

CprE 281: Digital Logic

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Synchronous Sequential Circuit Design. Digital Computer Design

Adders, subtractors comparators, multipliers and other ALU elements

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Preparation of Examination Questions and Exercises: Solutions

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

EECS 270 Midterm 2 Exam Answer Key Winter 2017

Adders, subtractors comparators, multipliers and other ALU elements

CHW 261: Logic Design

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

Fundamentals of Computer Systems

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

Philadelphia University Student Name: Student Number:

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

CSC 322: Computer Organization Lab

Introduction to Digital Logic

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Lecture 10: Synchronous Sequential Circuits Design

CPE100: Digital Logic Design I

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

Philadelphia University Student Name: Student Number:

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

Fundamentals of Computer Systems

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

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Logic Design II (17.342) Spring Lecture Outline

Different encodings generate different circuits

Sequential Circuits Sequential circuits combinational circuits state gate delay

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

Example: vending machine

EE 209 Logic Cumulative Exam Name:

DIGITAL LOGIC CIRCUITS

DIGITAL LOGIC CIRCUITS

I. Motivation & Examples

Sample Test Paper - I

CPE100: Digital Logic Design I

CHW 261: Logic Design

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

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

Finite State Machine (FSM)

Fundamentals of Digital Design

CS61C : Machine Structures

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

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

Homework #4. CSE 140 Summer Session Instructor: Mohsen Imani. Only a subset of questions will be graded

Review Problem 1. should be on. door state, false if light should be on when a door is open. v Describe when the dome/interior light of the car

EECS150 - Digital Design Lecture 16 Counters. Announcements

Combinational Logic Design Combinational Functions and Circuits

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

Digital Circuits ECS 371

CS61C : Machine Structures

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

Lecture 7: Logic design. Combinational logic circuits

Design at the Register Transfer Level

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

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

EECS 270 Midterm Exam 2 Fall 2009

ECE 341. Lecture # 3

The Design Procedure. Output Equation Determination - Derive output equations from the state table

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Synchronous Sequential Logic

Shift Register Counters

14.1. Unit 14. State Machine Design

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

Digital Logic Appendix A

Digital Design. Sequential Logic

(Boolean Algebra, combinational circuits) (Binary Codes and -arithmetics)

Digital Integrated Circuits A Design Perspective. Arithmetic Circuits. Jan M. Rabaey Anantha Chandrakasan Borivoje Nikolic.

Combinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Analysis of clocked sequential networks

Sequential Logic Worksheet

Transcription:

2-. piral 2- Datapath Components: Counters s Design Example: Crosswalk Controller

2-.2 piral Content Mapping piral Theory Combinational Design equential Design ystem Level Design Implementation and Tools Project Performance metrics (latency vs. throughput) Boolean Algebra Canonical Representations Decoders and muxes ynthesis with min/maxterms ynthesis with Karnaugh Maps Edge-triggered flip-flops Registers (with enables) Encoded tate machine design tructural Verilog HDL CMO gate implementation Fabrication process 2 hannon's Theorem ynthesis with muxes & memory and comparator design Bistables, latches, and Flipflops Counters Memories One-hot state machine design Control and datapath decomposition MO Theory Capacitance, delay and sizing Memory constructs 3 HW/W partitioning Bus interfacing ingle-cycle CPU Power and other logic families EDA design process

2-.3 Learning Outcomes I understand the control inputs to counters I can design logic to control the inputs of counters to create a desired count sequence I understand how smaller adder blocks can be combined to form larger ones I can build larger arithmetic circuits from smaller building blocks I understand the timing and control input differences between asynchronous and synchronous memories

DATAPATH COMPONENT 2-.4

2-.5 Digital ystem Design Control (CU) and Datapath Unit (DPU) paradigm eparate logic into datapath elements that operate on data and control elements that generate control signals for datapath elements Datapath: s, muxes, comparators, counters, registers (shift, with enables, etc.), memories, FIFO s Control Unit: tate machines/sequencers clk reset Control Control ignals Condition ignals Data Inputs Datapath Data Outputs

COUNTER 2-.6

(+) Register 2-.7 Counters Count (Add to Q) at each clock edge Up Counter: Q* = Q + Can also build a down counter as well (Q* = Q ) tandard counter components include other features Resets: Reset count to Enables: Will not count at edge if EN= Parallel Load Inputs: Can initialize count to a value P (i.e. Q* = P rather than Q+) REET CLK How would you design the adder block above for a 4-bit counter? Only 4-inputs, use T.T. and K- Maps! Q

2-.8 ample 4-bit Counter 4-bit Up Counter RT: a synchronous reset input PE and P i inputs: loads Q with P when PE is active CE: Count Enable Must be active for the counter to count up TC (Terminal Count) output Active when Q= AND counter is enabled TC = EN Q3 Q2 Q Q Mealy output Indicates that on the next edge it will roll over to CE P P P2 P3 PE RT CLK 4-bit CNTR Q Q Q2 Q3 TC CLK RT PE CE Q*, X X X Q X X X P Q Q+

2-.9 Counters CLK RT CE PE P3-P Q3-Q TC R=active at clock edge, thus Q= Q*=Q+ Enable = off, thus Q holds Q*=Q+ Q*=Q+ PE = active, thus Q*=Q+ Q*=Q+ Q=P Mealy Tput: EN Q3 Q2 Q Q

2-. Counter Exercise CLK RT PE CE P[3:] Q[3:]

2-. Counter Design ketch the design of the 4-bit counter presented on the previous slides CE + P[3:] PE D[3:] Q[3:] Reg Q[3:] RT CLR CLK CLK TC

2-.2 Design a 2-bit Counter CE P P P2 P3 PE RT CLK CE P P P2 P3 PE RT CLK CE P P P2 P3 PE RT CLK 4-bit CNTR 4-bit CNTR 4-bit CNTR Q Q Q2 Q3 TC Q Q Q2 Q3 TC Q Q Q2 Q3 TC Q[3:] Q[7:4] Q[:8] Q9 Q8 Q7 Q6 Q5 Q4 Q3 Q2 Q Q

2-.3 Counter Example Design a circuit that counts each clock cycle to produce the pattern 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 5...9, 5 9, CE P P P2 P3 PE RT CLK 4-bit CNTR Q Q Q2 Q3 TC

ADDER 2-.4

(+) Register 2-.5 Intro o how would we build a circuit to add two numbers? Let's try to design a circuit that can add AN two 4-bit numbers, X[3:] and [3:] How many inputs? Can we use K-Maps or sum of minterms, etc? REET CLK Q + = X =

2-.6 Intro Idea: Build a circuit that performs one column of addition and then use 4 instances of those circuits to perform the overall 4-bit addition Let's start by designing a circuit that adds 2-bits: X and that are in the same column of addition + = X =

2-.7 Addition Half s Addition is done in columns Inputs are the bit of X, Outputs are the um Bit and Carry-Out ( ) Design a Half- (HA) circuit that takes in X and and outputs and + = X = um X X Half

2-.8 Addition Half s We d like to use one adder circuit for each column of addition Problem: No place for Carry-out of last adder circuit olution Redesign adder circuit to include an input for the carry X Half + = X = X Half

2-.9 Addition s Add a Carry-In input( ) New circuit is called a (FA) X = X + = X C out

2-.2 Addition s Find the minimal 2-level implementations for Cout and X

2-.2 Logic = X xor xor Cin Recall: XOR is defined as true when ODD number of inputs are true exactly when the sum bit should be Cout = X + XCin + Cin Carry when sum is 2 or more (i.e. when at least 2 inputs are ) Circuit is just checking all combinations of 2 inputs

2-.22 Addition s Use for each column of addition + X X X X

2-.23 Addition s Connect bits of top number to X inputs + X X X X

2-.24 Addition s Connect bits of bottom number to inputs = X + = X X X X

2-.25 Addition s Be sure to connect first to = X + = X X X X

2-.26 Addition s Use for each column of addition = X + = X X X X

2-.27 Addition s Use for each column of addition = X + = X X X X

2-.28 Addition s Use for each column of addition + = X = X X X X

2-.29 Addition s Use for each column of addition + = X = X X X X

2-.3 Addition s Use for each column of addition = X + = X X X X

2-.3 Performing ubtraction w/ s To subtract Flip bits of Add - = X = + X X X X

2-.32 Performing ubtraction w/ s To subtract Flip bits of Add - = X = + X X X X

2-.33 Performing ubtraction w/ s To subtract Flip bits of Add - = X = + X X X X

2-.34 Performing ubtraction w/ s To subtract Flip bits of Add - = X = + X X X C C C C out out in out X

2-.35 4-bit s 74L283 chip implements a 4-bit adder A 3 A 2 A A + B 3 B 2 B B 4 3 2 = A = B = A 3 B 3 A 2 B 2 A B A B 74L283 3 2

2-.36 Building an 8-bit Use (2) 4-bit adders to build an 8-bit adder to add X=X[7:] and = [7:] and produce a sum, =[7:] and a carry-out, C8. Make sure you understand the difference between system labels (actual signal names from the top level design) and device labels (placeholder names for the signals inside each block). B3 B2 B B A3 A2 A A B3 B2 B B A3 A2 A A C4 C C4 C 3 2 3 2

EXERCIE 2-.37

2-.38 Adding Many Bits ou know that an FA adds X + + Ci Use FA and/or HA components to add 4 individual bits: A + B + C + D X

2-.39 Adding 3 Numbers Add X[3:] + [3:] + Z[3:] to produce F[?:] using the adders shown plus any FA and HA components you need B3 C4 9 2 A3 3 5 B2 4 A2 2 3 2 B 283 3 A 6 B 5 A 4 7 C 7 5 6 3 2 4 5 2 C A B A B A2 B2 A3 B3 283 4 2 3 3 C4 9

2-.4 Mapping Algorithms to HW Wherever an if..then..else statement is used usually requires a mux if(a[3:] > B[3:]) Z = A+2 else Z = B+5 B[3:] A[3:] A[3:] B[3:] Circuit Circuit Comparison Circuit I I A>B Z[3:]

2-.4 Mapping Algorithms to HW Wherever an if..then..else statement is used usually requires a mux if(a[3:] > B[3:]) Z = A+2 else Z = B+5 B[3:] A[3:] A[3:] B[3:] I I I I A>B Comparison Circuit Circuit Z[3:]

2-.42 / ubtractor If sub/~add = Z = X[3:]-[3:] Else Z = X[3:]+[3:] I I I I I I I I B3 B2 B B A3 A2 A A C4 4-bit Binary C 3 2

2-.43 / ubtractor If sub/~add = Z = X[3:]-[3:] UB/~ADD Else C Z = X[3:]+[3:] UB/ ~ADD i Bi 2 3 X X X2 X3 A A A2 A3 B B B2 B3 C4 4-bit Binary 3 2 Z Z Z2 Z3 UB/~ADD

2-.44 Another Example Design a circuit that takes a 4-bit binary number, X, and two control signals, A5 and M and produces a 4-bit result, Z, such that: Z = X + 5, when A5,M =, Z = X, when A5,M =, Z = X, when A5,M =, 4-bit Input A5 M B3 B2 B B d d d d C M A5 X X X2 X3 B3 B2 B B A3 A2 A A C4 4-bit Binary 3 2 Z Z Z2 Z3

ROM AND MEMORIE 2-.45

2-.46 Memories Memories store (write) and retrieve (read) data Read-Only Memories (ROM s): Can only retrieve data (contents are initialized and then cannot be changed) Read-Write Memories (RWM s): Can retrieve data and change the contents to store new data

2-.47 ROM s Memories are just tables of data with rows and columns When data is read, one entire row of data is read out The row to be read is selected by putting a binary number on the address inputs A A A 2 Address Inputs 2 3 4 5 6 7 ROM Data Outputs D 3 D 2 D D

2-.48 ROM s Example Address = 4 dec. = bin. is provided as input ROM outputs data in that row ( bin.) A A A 2 2 3 ROM 4 Address: 2 = 4 5 6 7 Data: Row 4 is output D 3 D 2 D D

2-.49 Memory Dimensions Memories are named by their dimensions: Rows x Columns n rows and m columns => n x m ROM 2 n rows => n address bits (or k rows => log 2 k address bits) A A A n- 2 2 n -2 ROM... m cols. => m data outputs 2 n - D m- D

2-.5 RWM s Writable memories provide a set of data inputs for write data (as opposed to the data outputs for read data) A control signal R/W (=READ / = WRITE) is provided to tell the memory what operation the user wants to perform Address Inputs Data Inputs A A A 2 DI DI DI 2 DI 3 R/W 2 3 4 5 6 7 8x4 RWM Data Outputs DO 3 DO 2 DO DO

2-.5 RWM s Write example Address = 3 dec. = bin. DI = 2 dec. = bin. R/W = => Write op. Data in row 3 is overwritten with the new value of bin. Address Inputs Data Inputs R/W A A A 2 DI DI DI 2 DI 3 2 3 4 5 6 7 R/W 8x4 RWM DO 3 DO 2 DO DO Data Outputs????

DO[3:] 2-.52 Asynchronous Memories Notice that there is no clock signal with this memory Devices that do not use a clock signal are called "asynchronous" devices For these memories, the address must be kept valid and stable for at least t acc amount of time A[2:] DI[3:] R/W 2 3 4 5 6 7 A[2:] DI[3:] R/W t acc t acc DO[3:]

2-.53 Asynchronous vs. ynchronous Memories Asynchronous memories use no CLK signal For read: Address and R/W signal must be held steady for a certain period of time before DO outputs become valid For write: Address, DI, and R/W signal must be held steady for a certain period of time before internal memory is updated ynchronous memories use a CLK signal For read: Address and R/W signal will be registered on the CLK edge and then DO will become valid during that subsequence clock cycle For write: Address, DI and R/W signals will be registered on the CLK edge and then the internal memory updated during the subsequent clock cycle A A A 2 DI DI DI 2 DI 3 R/W CLK DO DO DO 2 DO 3 ynchronous memories add a clock signal and the input values at a clock edge will only be processed during the subsequence clock cycle

DO[3:] 2-.54 ynchronous Timing For synchronous memories the address must be valid and stable at the clock edge but then may be changed EN = Overall enable (unless it is ) the memory won't read or write (we assume EN=) WEN = Write enable = Write / = read CLK A[2:] A[2:] DI[3:] EN WEN CLK DI[3:] WEN t write 2 3 4 5 6 7 M[3] DO[3:]??? mem[3] = mem[6] = Assume EN= t acc

DO[3:] DO[3:] DO[3:] 2-.55 Using Memories Add two 8 number arrays (C[i] = A[i] + B[i]) D EN RT CLK reg Q A[2:] DI[3:] A EN RT CLK cntr Q EN WEN CLK A[2:] 8x4 Memory + A[2:] DI[3:] EN WEN CLK 8x4 Memory DI[3:] EN WEN 8x4 Memory B CLK i[3:] CLK A & B??? A[] & B[] A[] & B[] A[2] & B[2] i_q CMEM[]??? A[]+B[]

2-.56 Crosswalk Controller TEM DEIGN EXAMPLE

2-.57 Digital ystem Design Control and Datapath Unit paradigm eparate logic into datapath elements that operate on data and control elements that generate control signals for datapath elements Datapath: s, muxes, comparators, counters, registers (w/ enables) Control Unit: tate machines/sequencers clk reset Control Control ignals Condition ignals Data Inputs Datapath Data Outputs

2-.58 Crosswalk Controller Design a crosswalk controller to adhere to the following description 8 ticks of the clock in the WALK phase 8 ON/OFF BLINKING hand cycles (6 total ticks) Count 8 downto on the NUM display while hand is blinking 6 cycles in the OLID hand NUM(3:) NUM_ON HAND WALK

2-.59 Crosswalk tate Machine Use a 4-bit counter to count cycles along with an additional gate or two CE P P P2 P3 4-bit CNTR Q Q Q2 Q3 REET WALK WALK= BlinkOff NUM_ON= PE RT CLK TC NOWALK HAND= BlinkOn HAND=EN= NUM_ON=

2-.6 Crosswalk Controller Operation CLK Q(3:) EN C7 TC TATE NUM_ON NUM

2-.6 ummary ou should now be able to build: Registers (w/ Enables) Counters s