CprE 281: Digital Logic

Similar documents
CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

Engr354: Digital Logic Circuits

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

ECE 341. Lecture # 2

Logic Design. Flip Flops, Registers and Counters

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

Unit 11. Latches and Flip-Flops

Registers & Counters. Logic and Digital System Design - CS 303 Erkay Savaş Sabanci University

1. Convert the decimal number to binary, octal, and hexadecimal.

1. True/False Questions (10 x 1p each = 10p) (a) I forgot to write down my name and student ID number.

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

ELE2120 Digital Circuits and Systems. Tutorial Note 7

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

D Latch (Transparent Latch)

Introduction to Digital Logic Missouri S&T University CPE 2210 Flip-Flops

MODULE 3. Combinational & Sequential logic

Sequential Logic Circuits

6. Sequential Logic Flip-Flops

Digital Logic Design ENEE x. Lecture 19

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

EECS 270 Midterm Exam Spring 2011

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

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

LATCHES & FLIP-FLOP. Chapter 7

CHAPTER 4: Logic Circuits

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

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

Course Administration

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

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

CMSC 313 Preview Slides

Synchronous Sequential Logic

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

Chapter. Synchronous Sequential Circuits

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

CHAPTER 4: Logic Circuits

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

CHAPTER1: Digital Logic Circuits

Other Flip-Flops. Lecture 27 1

MC9211 Computer Organization

Problems with D-Latch

Chapter 5: Synchronous Sequential Logic

Chapter 11 Latches and Flip-Flops

Final Exam review: chapter 4 and 5. Supplement 3 and 4

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

CS 261 Fall Mike Lam, Professor. Sequential Circuits

ECE321 Electronics I

Chapter 6 Digital Circuit 6-5 Department of Mechanical Engineering

Chapter 5 Synchronous Sequential Logic

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

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

Part II. Chapter2: Synchronous Sequential Logic

Topic D-type Flip-flops. Draw a timing diagram to illustrate the significance of edge

INTRODUCTION TO SEQUENTIAL CIRCUITS

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

Digital Fundamentals

Combinational vs Sequential

Switching Circuits & Logic Design, Fall Final Examination (1/13/2012, 3:30pm~5:20pm)

Spring 2017 EE 3613: Computer Organization Chapter 5: The Processor: Datapath & Control - 1

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Counter dan Register

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

Midterm Exam 15 points total. March 28, 2011

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

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

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

Digital Circuits ECS 371

Lec 24 Sequential Logic Revisited Sequential Circuit Design and Timing

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

CSE140: Components and Design Techniques for Digital Systems. More D-Flip-Flops. Tajana Simunic Rosing. Sources: TSR, Katz, Boriello & Vahid

Digital Networks and Systems Laboratory 2 Basic Digital Building Blocks Time 4 hours

MUX AND FLIPFLOPS/LATCHES

Flip-Flops and Registers

Experiment 8 Introduction to Latches and Flip-Flops and registers

ELCT201: DIGITAL LOGIC DESIGN

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

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

Flip-Flops and Sequential Circuit Design

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

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

Logic Design II (17.342) Spring Lecture Outline

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

Sequential Design Basics

Review of digital electronics. Storage units Sequential circuits Counters Shifters

Sequential Logic and Clocked Circuits

1 Hour Sample Test Papers: Sample Test Paper 1. Roll No.

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

UNIT IV. Sequential circuit

Digital Logic Design I

Synchronous Sequential Logic. Chapter 5

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

211: Computer Architecture Summer 2016

Introduction to Sequential Circuits

Transcription:

CprE 281: igital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/

Registers CprE 281: igital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev

Administrative Stuff The second midterm is next Friday. Homework 8 is due next Monday.

Midterm Exam #2 Administrative Stuff When: Friday October 28 @ 4pm. Where: This classroom What: Chapters 1, 2, 3, 4 and 5.1-5.8 The exam will be open book and open notes (you can bring up to 3 pages of handwritten notes).

Midterm 2: Format The exam will be out of 130 points You need 95 points to get an A It will be great if you can score more than 100 points. but you can t roll over your extra points L

Midterm 2: Topics Binary Numbers and Hexadecimal Numbers 1 s complement and 2 s complement representation Addition and subtraction of binary numbers Circuits for adders and fast adders Single and ouble precision IEEE floating point formats Converting a real number to the IEEE format Converting a floating point number to base 10 Multiplexers (circuits and function) Synthesis of logic functions using multiplexers Shannon s Expansion Theorem

Midterm 2: Topics ecoders (circuits and function) emultiplexers Encoders (binary and priority) Code Converters K-maps for 2, 3, and 4 variables Synthesis of logic circuits using adders, multiplexers, encoders, decoders, and basic logic gates Synthesis of logic circuits given constraints on the available building blocks that you can use Latches (circuits, behavior, timing diagrams) Flip-Flops (circuits, behavior, timing diagrams) Registers and Register Files

Review of Flip-Flops

A simple memory element with NOT Gates x x x

A simple memory element with NAN Gates x x x

A simple memory element with NOR Gates x x x

Basic Latch

A simple memory element with NOR Gates

A simple memory element with NOR Gates

A simple memory element with NOR Gates Set Reset

A memory element with NOR gates Reset Set [ Figure 5.3 from the textbook ]

Two ifferent Ways to raw the Same Circuit [ Figure 5.3 & 5.4 from the textbook ]

SR Latch: Circuit and Truth Table R a S R a b 0 0 0/1 1/0 (no change) 0 1 0 1 1 0 1 0 S b 1 1 0 0 (Undesirable) (a) Circuit (b) Truth table [ Figure 5.4a,b from the textbook ] NOR Gate NOR Gate Truth table x 1 x 2 f 0 0 1 0 1 0 1 0 0 1 1 0

Gated SR Latch

Circuit iagram for the Gated SR Latch [ Figure 5.5a from the textbook ]

Circuit iagram for the Gated SR Latch This is the gate of the gated latch

Circuit iagram for the Gated SR Latch Notice that these are complements of each other

Gated SR Latch: Circuit iagram, Characteristic Table, and Graphical Symbol (Undesirable) [ Figure 5.5 from the textbook ]

Gated SR latch with NAN gates S Clk R [ Figure 5.6 from the textbook ]

Gated SR latch with NAN gates S Clk R In this case the gate is constructed using NAN gates! Not AN gates.

Gated SR latch with NAN gates S Clk R Also, notice that the positions of S and R are now swapped.

Gated SR latch with NAN gates S Clk = 1 R 1 1 S R Finally, notice that when Clk=1 this turns into the basic latch with NAN gates, i.e., the SR Latch.

Gated SR latch with NOR gates Gated SR latch with NAN gates S Clk R

Gated SR latch with NOR gates Gated SR latch with NAN gates S Clk R Graphical symbols are the same

Gated SR latch with NOR gates (undesirable) Gated SR latch with NAN gates S Clk R (undesirable) Characteristic tables are the same

Gated Latch

Circuit iagram for the Gated Latch [ Figure 5.7a from the textbook ]

Gated Latch: Alternative esign Clk [https://en.wikipedia.org/wiki/flip-flop_(electronics)]

Gated Latch: Circuit iagram, Characteristic Table, and Graphical Symbol Note that it is now impossible to have S=R=1. When Clk=1 the output follows the input. When Clk=0 the output cannot be changed. [ Figure 5.7a,b from the textbook ]

Setup and hold times for Gated latch t su t h Clk Setup time (t su ) the minimum time that the signal must be stable prior to the the negative edge of the Clock signal Hold time (t h ) the minimum time that the signal must remain stable after the the negative edge of the Clock signal [ Figure 5.8 from the textbook ]

Master-Slave Flip-Flop

Constructing a Master-Slave Flip-Flop From Two Latches Master Slave

Constructing a Master-Slave Flip-Flop From Two Latches Master Slave

Constructing a Master-Slave Flip-Flop From Two Latches Master Slave

Constructing a Master-Slave Flip-Flop From Two Latches [ Figure 5.9a from the textbook ]

Constructing a Master-Slave Flip-Flop From one Latch and one Gated SR Latch (This version uses one less NOT gate) Master Slave

Constructing a Master-Slave Flip-Flop From one Latch and one Gated SR Latch (This version uses one less NOT gate) Master Slave

Edge-Triggered Flip-Flops

Master-Slave Flip-Flop Master Slave m s Clock Clk Clk (a) Circuit [ Figure 5.9a from the textbook ]

Negative-Edge-Triggered Master-Slave Flip-Flop Master Slave m s Clock Clk Clk Positive-Edge-Triggered Master-Slave Flip-Flop Master Slave m s Clock Clk Clk

Negative-Edge-Triggered Master-Slave Flip-Flop Master Slave m s Clock Clk Clk Positive-Edge-Triggered Master-Slave Flip-Flop Master Slave m s Clock Clk Clk

Negative-Edge-Triggered Master-Slave Flip-Flop Master Slave m s Clock Clk Clk Positive-Edge-Triggered Master-Slave Flip-Flop Master Slave m s Clock Clk Clk

T Flip-Flop

T Flip-Flop [ Figure 5.15a from the textbook ]

T Flip-Flop Positive-edge-triggered Flip-Flop [ Figure 5.15a from the textbook ]

T Flip-Flop What is this? [ Figure 5.15a from the textbook ]

What is this? T

What is this? T + =?

T Flip-Flop T 0 1 Clock

What is this? + =?

T Flip-Flop T Clock

T Flip-Flop (circuit, truth table and graphical symbol) [ Figure 5.15a-c from the textbook ]

T Flip-Flop (How it Works) If T=0 then it stays in its current state If T=1 then it reverses its current state In other words the circuit toggles its state when T=1. This is why it is called T flip-flop.

JK Flip-Flop

JK Flip-Flop = J + K [ Figure 5.16a from the textbook ]

JK Flip-Flop J K Clock (a) Circuit J K ( t + 1 ) 0 0 0 1 ( t ) 0 J 1 1 0 1 1 ( t ) K (b) Truth table (c) Graphical symbol [ Figure 5.16 from the textbook ]

JK Flip-Flop (How it Works) A versatile circuit that can be used both as a SR flip-flop and as a T flip flop If J=0 and S =0 it stays in the same state Just like SR It can be set and reset J=S and K=R If J=K=1 then it behaves as a T flip-flop

Registers

Register (efinition) An n-bit structure consisting of flip-flops

Parallel-Access Register

1-Bit Parallel-Access Register Load In 0 1 Out Clock

1-Bit Parallel-Access Register Load In 0 1 Out Clock The 2-to-1 multiplexer is used to select whether to load a new value into the flip-flop or to retain the old value. The output of this circuit is the output of the flip-flop.

1-Bit Parallel-Access Register Load In 0 1 Out Clock If Load = 0, then retain the old value. If Load = 1, then load the new value from In.

2-Bit Parallel-Access Register Out_1 Out_0 Load 0 1 0 1 Clock In_1 In_0

2-Bit Parallel-Access Register Parallel Output Out_1 Out_0 Load 0 1 0 1 Clock In_1 In_0 Parallel Input

3-Bit Parallel-Access Register Out_2 Out_1 Out_0 Load 0 1 0 1 0 1 Clock In_2 In_1 In_0 Notice that all flip-flops are on the same clock cycle.

3-Bit Parallel-Access Register Parallel Output Out_2 Out_1 Out_0 Load 0 1 0 1 0 1 Clock In_2 In_1 In_0 Parallel Input

4-Bit Parallel-Access Register Out_3 Out_2 Out_1 Out_0 Load 0 1 0 1 0 1 0 1 Clock In_3 In_2 In_1 In_0

4-Bit Parallel-Access Register Parallel Output Out_3 Out_2 Out_1 Out_0 Load 0 1 0 1 0 1 0 1 Clock In_3 In_2 In_1 In_0 Parallel Input

Shift Register

A simple shift register In 1 2 3 4 Out Clock [ Figure 5.17a from the textbook ]

A simple shift register In 1 2 3 4 Out Clock Positive-edge-triggered Flip-Flop

A simple shift register In 1 2 3 4 Out Clock Master Slave m s Clock Clk Clk

A simple shift register In 1 2 3 4 Out Clock Flip-Flop Master Slave m s Clock Clk Clk Gated -Latch Gated -Latch

A simple shift register In 1 2 3 4 Out Clock

A simple shift register In 1 2 3 4 Out Clock In Clock Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk

A simple shift register In 1 2 3 4 Out Clock In Clock Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk

A simple shift register In 1 2 3 4 Out Clock In Clock Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk

A simple shift register In 1 2 3 4 Out Clock In Clock Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk

A simple shift register In 1 2 3 4 Out Clock In Clock Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk

A simple shift register In Clock Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk Master Clk Slave Clk

A simple shift register In 1 2 3 4 Out Clock (a) Circuit t 0 In 1 1 2 3 4 = Out 0 0 0 0 t 1 0 1 0 0 0 t 2 1 0 1 0 0 t 3 1 1 0 1 0 t 4 1 1 1 0 1 t 5 0 1 1 1 0 t 6 0 0 1 1 1 t 7 0 0 0 1 1 (b) A sample sequence [ Figure 5.17 from the textbook ]

Parallel-Access Shift Register

Parallel-access shift register [ Figure 5.18 from the textbook ]

A shift register with parallel load and enable control inputs [ Figure 5.59 from the textbook ]

Register File

Register File [https://jindongpu.wordpress.com/2012/03/07/register-file/]

[http://fourier.eng.hmc.edu/e85_old/lectures/digital_logic/node19.html]

[http://fourier.eng.hmc.edu/e85_old/lectures/digital_logic/node19.html]

[http://www.eecg.toronto.edu/~enright/teaching/ece243s/notes/l19-implemenation-single-cycle.html]

Register File Register file is a unit containing r registers r can be 4, 8, 16, 32, etc. Each register has n bits n can be 4, 8, 16, 32, etc. n defines the data path width Output ports (ATA1 and ATA2) are used for reading the register file Any register can be read from any of the ports Each port needs a log 2 r bits to specify the read address (RA1 and RA2) Input port (L_ATA) is used for writing data to the register file Write address is also specified by log 2 r bits (WA) Writing is enabled by a 1-bit signal (WR) RA1 L_ATA WR Reg File RA2 WA ATA1 ATA2

Suppose that a register file contains 32 registers width of data path is 16 bits (i.e., each register has 16 bits) How many bits are there for each of the signals? RA1 RA2 ATA1 ATA2 WA L_ATA WR Register File: Exercise 5 5 16 16 5 16 1 RA1 L_ATA WR Reg File RA2 WA ATA1 ATA2

Register file design We will design an eight-register file with 4-bit wide registers A single 4-bit register and its abstraction are shown below L Clock 3 2 1 0 1 0 P 3 1 0 P 2 1 0 P 1 1 0 P 0 L Clock 3 2 1 0 3 2 1 0 We have to use eight such registers to make an eight register file L 3 2 1 0 L 3 2 1 0 L 3 2 1 0 Clk 3 2 1 0 Clk 3 2 1 0 Clk 3 2 1 0 How many bits are required to specify a register address?

Reading Circuit A 3-bit register address, RA, specifies which register is to be read For each output port, we need one 8-to-1 4-bit multiplier Register Address 111 001 000 L7 3 2 1 0 L1 3 2 1 0 L0 3 2 1 0 Clk 3 2 1 0 Clk 3 2 1 0 Clk 3 2 1 0 7 6 5 4 3 2 1 0 RA1 8-to-1 4-bit multiplex ATA1 7 6 5 4 3 2 1 0 8-to-1 4-bit multiplex RA2 ATA2

Adding write control to register file To write to any register, we need the register's address (WA) and a write register signal (WR) A 3-bit write address is decoded if write register signal is present One of the eight registers gets a L signal from the decoder L_ATA 3 to 8 e c o d e r WA WR L7 L1 L0 3 2 1 0 3 2 1 0 3 2 1 0 L7 111 001 000 3 2 1 0 3 2 1 0 3 2 1 0 Clk Clk Clk L2 L1 L0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 RA1 8-to-1 4-bit multiplex 8-to-1 4-bit multiplex RA2 ATA1 ATA2

uestions?

THE EN