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

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

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

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

Counter dan Register

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

Asynchronous (Ripple) Counters

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

LSN 12 Shift Registers

Digital Logic Design ENEE x. Lecture 19

Logic Design II (17.342) Spring Lecture Outline

Logic Design. Flip Flops, Registers and Counters

Unit 11. Latches and Flip-Flops

Registers and Counters

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

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

Computer Organization & Architecture Lecture #5

CHAPTER 4: Logic Circuits

CHAPTER1: Digital Logic Circuits

MODULE 3. Combinational & Sequential logic

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

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

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

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

Counters

ECE 263 Digital Systems, Fall 2015

CHAPTER 4: Logic Circuits

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

Midterm Exam 15 points total. March 28, 2011

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

Dr. Shahram Shirani COE2DI4 Midterm Test #2 Nov 19, 2008

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Universal Asynchronous Receiver- Transmitter (UART)

Lecture 8: Sequential Logic

Course Administration

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

ELE2120 Digital Circuits and Systems. Tutorial Note 8

Sequential Logic. Analysis and Synthesis. Joseph Cavahagh Santa Clara University. r & Francis. TaylonSi Francis Group. , Boca.Raton London New York \

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

ECE 341. Lecture # 2

LATCHES & FLIP-FLOP. Chapter 7

Logic Design II (17.342) Spring Lecture Outline

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

RS flip-flop using NOR gate

Experiment 8 Introduction to Latches and Flip-Flops and registers

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

Principles of Computer Architecture. Appendix A: Digital Logic

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

ASYNCHRONOUS COUNTER CIRCUITS

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

Registers and Counters

RS flip-flop using NOR gate

Chapter 2. Digital Circuits

Administrative issues. Sequential logic

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

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.

AM AM AM AM PM PM PM

D Latch (Transparent Latch)

Digital Fundamentals: A Systems Approach

MC9211 Computer Organization

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

EKT 121/4 ELEKTRONIK DIGIT 1

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

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

Synchronous Sequential Logic

Electrical and Telecommunications Engineering Technology_TCET3122/TC520. NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Figure 1 shows a simple implementation of a clock switch, using an AND-OR type multiplexer logic.

UNIVERSITY OF MASSACHUSSETS LOWELL Department of Electrical & Computer Engineering Course Syllabus for Logic Design Fall 2013

Department of Computer Science and Engineering Question Bank- Even Semester:

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

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

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

Operating Manual Ver.1.1

Contents Circuits... 1

North Shore Community College

COE328 Course Outline. Fall 2007

Synchronous Sequential Logic

Flip-Flops and Sequential Circuit Design

TIME SCHEDULE. MODULE TOPICS PERIODS 1 Number system & Boolean algebra 17 Test I 1 2 Logic families &Combinational logic

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

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

Computer Architecture and Organization

DIGITAL CIRCUIT LOGIC UNIT 9: MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

UNIT IV. Sequential circuit

Sequential Logic Design CS 64: Computer Organization and Design Logic Lecture #14

Registers and Counters

Other Flip-Flops. Lecture 27 1

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

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

Minnesota State College Southeast

Half-Adders. Ch.5 Summary. Chapter 5. Thomas L. Floyd

6. Sequential Logic Flip-Flops

ELE2120 Digital Circuits and Systems. Tutorial Note 7

Combinational vs Sequential

Transcription:

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

Registers and Counters CprE 28: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev

Administrative Stuff The second midterm is this Friday. Homework 8 is due today. Homework 9 went out. It is due on Mon Nov 9. No HW due next Monday

Midterm Exam #2 Administrative Stuff When: Friday October 3 @ 4pm. Where: This classroom What: Chapters, 2, 3, 4 and 5.-5.7 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 3 points You need 95 points to get an A It will be great if you can score more than points. but you can t roll over your extra points L

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

Midterm 2: Topics Decoders (circuits and function) Demultiplexers 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

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

Parallel-Access Register

-bit Parallel-access register IN LD D Clock At the input of the D flip-flop, a 2-to- Multiplexer is used to select whether to load a new input value or to retain the old value If signal LD = then load the new value If signal LD = then retain the old value

4-bit Parallel-access register LD IN3 IN2 IN IN D D D D Clock 3 2 Notice that all flip-flops are on the same clock cycle.

Shift Register

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

Parallel-Access Shift Register

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

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

Register File

Register File Register file is a unit containing r registers r can be 4, 8, 6, 32, etc. Each register has n bits n can be 4, 8, 6, 32, etc. n defines the data path width Output ports (DATA and DATA2) 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 (RA and RA2) Input port (LD_DATA) 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 -bit signal (WR) RA LD_DATA WR Reg File RA2 WA DATA DATA2

Suppose that a register file contains 32 registers width of data path is 6 bits (i.e., each register has 6 bits) How many bits are there for each of the signals? RA RA2 DATA DATA2 WA LD_DATA WR Register File: Exercise 5 5 6 6 5 6 RA LD_DATA WR Reg File RA2 WA DATA DATA2

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 LD Clock D3 D2 D D D P 3 D P 2 D P D P LD Clock D3 D2 D D 3 2 We have to use eight such registers to make an eight register file LD D3 D2 D D LD D3 D2 D D LD D3 D2 D D Clk 3 2 Clk 3 2 Clk 3 2 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- 4-bit multiplier Register Address LD7 D3 D2 D D LD D3 D2 D D LD D3 D2 D D Clk 3 2 Clk 3 2 Clk 3 2 7 6 5 4 3 2 RA 8-to- 4-bit multiplex DATA 7 6 5 4 3 2 8-to- 4-bit multiplex RA2 DATA2

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 LD signal from the decoder LD_DATA 3 to 8 D e c o d e r WA WR LD7 LD LD D3 D2 D D D3 D2 D D D3 D2 D D LD7 3 2 3 2 3 2 Clk Clk Clk LD2 LD LD 7 6 5 4 3 2 7 6 5 4 3 2 RA 8-to- 4-bit multiplex 8-to- 4-bit multiplex RA2 DATA DATA2

Counters

A three-bit up-counter [ Figure 5.9 from the textbook ]

A three-bit up-counter The first flip-flop changes on the positive edge of the clock [ Figure 5.9 from the textbook ]

A three-bit up-counter The first flip-flop changes on the positive edge of the clock The second flip-flop changes on the positive edge of [ Figure 5.9 from the textbook ]

A three-bit up-counter The first flip-flop changes on the positive edge of the clock The second flip-flop changes on the positive edge of The third flip-flop changes on the positive edge of [ Figure 5.9 from the textbook ]

A three-bit up-counter T T T Clock 2 (a) Circuit Clock 2 Count 2 3 4 5 6 7 (b) Timing diagram [ Figure 5.9 from the textbook ]

A three-bit up-counter T T T Clock 2 (a) Circuit The propagation delays get longer Clock 2 Count 2 3 4 5 6 7 (b) Timing diagram [ Figure 5.9 from the textbook ]

A three-bit down-counter [ Figure 5.2 from the textbook ]

A three-bit down-counter T T T Clock 2 (a) Circuit Clock 2 Count 7 6 5 4 3 2 (b) Timing diagram [ Figure 5.2 from the textbook ]

Synchronous Counters

A four-bit synchronous up-counter [ Figure 5.2 from the textbook ]

A four-bit synchronous up-counter The propagation delay through all AND gates combined must not exceed the clock period minus the setup time for the flip-flops [ Figure 5.2 from the textbook ]

A four-bit synchronous up-counter T T T 2 T 3 Clock (a) Circuit Clock 2 3 Count 2 3 4 5 6 7 8 9 2 3 4 5 (b) Timing diagram [ Figure 5.2 from the textbook ]

Derivation of the synchronous up-counter Clock cycle 2 3 4 5 6 7 8 2 changes 2 changes [ Table 5. from the textbook ]

Derivation of the synchronous up-counter Clock cycle 2 3 4 5 6 7 8 2 changes 2 changes T = T = T 2 = [ Table 5. from the textbook ]

A four-bit synchronous up-counter T = T = T 2 = [ Figure 5.2 from the textbook ]

In general we have T = T = T 2 = T 3 = 2 T n = 2 n-

Adding Enable and Clear Capability

Inclusion of Enable and Clear capability Enable T T T T Clock Clear_n [ Figure 5.22 from the textbook ]

Inclusion of Enable and Clear capability This is the new thing relative to the previous figure, plus the clear_n line Enable T T T T Clock Clear_n [ Figure 5.22 from the textbook ]

Providing an enable input for a D flip-flop [ Figure 5.56 from the textbook ]

Synchronous Counter with D Flip-Flops

A four-bit counter with D flip-flops [ Figure 5.23 from the textbook ]

Counters with Parallel Load

A counter with parallel-load capability [ Figure 5.24 from the textbook ]

Reset Synchronization

Motivation An n-bit counter counts from,,, 2 n - For example a 3-bit counter counts up as follow,, 2, 3, 4, 5, 6, 7,,, 2, What if we want it to count like this,, 2, 3, 4, 5,,, 2, 3, 4, 5,,, In other words, what is the cycle is not a power of 2?

What does this circuit do? [ Figure 5.25a from the textbook ]

A modulo-6 counter with synchronous reset Enable D D Clock D 2 Load Clock 2 (a) Circuit Clock 2 Count 2 3 4 5 (b) Timing diagram [ Figure 5.25 from the textbook ]

A modulo-6 counter with asynchronous reset T T T 2 Clock (a) Circuit Clock 2 Count 2 3 4 5 2 (b) Timing diagram [ Figure 5.26 from the textbook ]

A modulo-6 counter with asynchronous reset T T T 2 Clock (a) Circuit The number 5 is displayed for a very short amount of time Clock 2 Count 2 3 4 5 2 (b) Timing diagram [ Figure 5.26 from the textbook ]

uestions?

THE END