© 2003-2008 BYU 12 REGISTERS Page 1 ECEn 224 Registers.

Slides:



Advertisements
Similar presentations
Lecture 23: Registers and Counters (2)
Advertisements

Registers and Counters
Registers and Counters. Register Register is built with gates, but has memory. The only type of flip-flop required in this class – the D flip-flop – Has.
Half Adder Sum = X’Y+XY’ = X  Y Carry = XY YXYXYX  YYYX  XX XOR XNOR.
Henry Hexmoor1 Chapter 7 Henry Hexmoor Registers and RTL.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 TopicJ: Counters José Nelson Amaral.
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
Registers & Counters Registers. Shift Registers: Counters:
11/16/2004EE 42 fall 2004 lecture 331 Lecture #33: Some example circuits Last lecture: –Edge triggers –Registers This lecture: –Example circuits –shift.
ENGIN112 L27: Counters November 5, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 27 Counters.
Sequential PLD timing Registers Counters Shift registers
CS370 Counters. Overview °Counter: A register that goes through a prescribed series of states °Counters are important components in computers. °Counters.
Digital Logic Design Lecture 24. Announcements Homework 8 due today Exam 3 on Tuesday, 11/25. – Topics for exam are up on the course webpage.
ENGIN112 L26: Shift Registers November 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 26 Shift Registers.
CS 140L Lecture 4 Professor CK Cheng 10/22/02. 1)F-F 2)Shift register 3)Counter (Asynchronous) 4)Counter (Synchronous)
What is shift register? A shift register is a digital memory circuit found in calculators, computers, and data-processing systems. Bits (binary digits)
Digital Fundamentals Floyd Chapter 9 Tenth Edition
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
EKT 124 / 3 DIGITAL ELEKTRONIC 1
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
Registers and Counters
ECE 301 – Digital Electronics Flip-Flops and Registers (Lecture #15)
1 Shift Registers. –Definitions –I/O Types: serial, parallel, combinations –Direction: left, right, bidirectional –Applications –VHDL implementations.
EE24C Digital Electronics Projects
Last Mod: March 2014  Paul R. Godin Shift Registers Registers 1.1.
1 Registers and Counters A register consists of a group of flip-flops and gates that affect their transition. An n-bit register consists of n-bit flip-flops.
Digital Design: Principles and Practices
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
Princess Sumaya Univ. Computer Engineering Dept. Chapter 6:
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 17 Dr. Shi Dept. of Electrical and Computer Engineering.
 Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences.
1 Register A register is a sequential circuit that can be set to a specific state and retain that state until externally changed. –State is a combination.
© BYU 13 COUNTERS Page 1 ECEn 224 COUNTERS Counters Transition Tables Moore Outputs Counter Timing.
Registers Page 1. Page 2 What is a Register?  A Register is a collection of flip-flops with some common function or characteristic  Control signals.
Abdullah Said Alkalbani University of Buraimi
Sequential Logic Circuit
Sequential Logic Circuit
Registers 4.2 N-bit register: Stores N bits, N is the width
Sequential logic circuits
Last Mod: Jan 2015  Paul R. Godin Shift Registers : Technician Series Registers 1.1.
EKT 124 / 3 DIGITAL ELEKTRONIC 1
© BYU 11b MSFF Page 1 ECEn 224 MSFF Master/Slave Flip Flops.
Digital Electronics Electronics Technology Landon Johnson Shift Registers.
Digital Fundamentals Tenth Edition Floyd Chapter 9.
ECE 545—Digital System Design with VHDL Lecture 1
Chapter 8 Solving Larger Sequential Problems.
Lecture Overview Shift Register Buffering Direct Memory Access.
Registers ECEn/CS 224.
REGISTER TRANSFER LANGUAGE (RTL) INTRODUCTION TO REGISTER Registers1.
Modular sequential logic Use latches, flip-flops and combinational logic –Flip-flops usually grouped to form a register Shift registers –n bits {x n …x.
1 CHAPTER 12 REGISTERS AND COUNTERS This chapter in the book includes: Objectives Study Guide 12.1Registers and Register Transfers 12.2Shift Registers.
Class Exercise 1B.
REGISTER TRANSFER LANGUAGE (RTL)
Electronics Technology
SLIDES FOR CHAPTER 12 REGISTERS AND COUNTERS
Basics of digital systems
INTRODUCTION Overview of Shift Registers
3.2 Shift Register Basic shift register function
D Flip-Flop.
Shift Registers.
Digital System Design Review.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
ECE 545—Digital System Design with VHDL Lecture 1
Registers.
CSC 220: Computer Organization
A register design with parallel load input
Switching Theory and Logic Design Chapter 5:
Outline Registers Counters 5/11/2019.
Registers Today we’ll see some common sequential devices: counters and registers. They’re good examples of sequential analysis and design. They are also.
Week 11 Flip flop & Latches.
Presentation transcript:

© BYU 12 REGISTERS Page 1 ECEn 224 Registers

© BYU 12 REGISTERS Page 2 ECEn 224 A 4-Bit Register CLK D3 D2 D1 D0 Q3 Q2 Q1 Q0 D Q CLK DQ 44 D Q Could be called a parallel-in/parallel-out register. Why?

© BYU 12 REGISTERS Page 3 ECEn 224 A Shift Register CLK SerIn D Q CLK Q3Q2Q1Q0 Called a serial-in, parallel-out shift register (SIPO)

© BYU 12 REGISTERS Page 4 ECEn 224 SIPO Register (Serial-In/Parallel-Out) CLK SerIn D Q CLK Q3Q2Q1Q0 Parallel-Out

© BYU 12 REGISTERS Page 5 ECEn 224 SISO Register (Serial-In/Serial-Out) CLK SerIn D Q CLK SerOut Useful for delaying a serial bit-stream some number of cycles…

© BYU 12 REGISTERS Page 6 ECEn 224 How to Make Any of These Loadable? D Q CLK DQ 44 This register loads on every clock cycle. How to make it load when told to? D Q CLK DQ 44 An obvious solution… This is incorrect – why? LOAD

© BYU 12 REGISTERS Page 7 ECEn 224 Gated Clocking Is A Bad Thing To Do… D Q CLK DQ LOAD CLK LOAD t AND GatedClock The flip flop gets its clock signal late Thus, its output appears late…

© BYU 12 REGISTERS Page 8 ECEn 224 Gated Clocking Causes different flip flops to load at different times –A form of clock skew –Makes doing timing analysis more difficult –Can lead to circuits which run more slowly –Can lead to circuits which fail at any clock rate

© BYU 12 REGISTERS Page 9 ECEn 224 CLK GatedClock LOAD t CLK-Q D Q CLK Q LOAD D Q FFAFFB CLK QAQA QAQA t AND Value that should be loaded into FFB (‘1’) Value that gets loaded into FFB (‘0’) GatedClock

© BYU 12 REGISTERS Page 10 ECEn 224 CLK GatedClock LOAD t CLK-Q D Q CLK Q LOAD D Q FFAFFB CLK QAQA QAQA t AND Value that should be loaded into FFB (‘1’) Value that gets loaded into FFB (‘0’) GatedClock If t CLK-Q < t AND : FFB loads wrong value

© BYU 12 REGISTERS Page 11 ECEn 224 Globally Synchronous Design One global clock All registers load on that clock’s edge Control over loading done via input forming logic (IFL) Simplifies timing analysis and requirements Makes it possible for even novices to design large, functioning circuits Multi-clock circuits  next semester’s topic

© BYU 12 REGISTERS Page 12 ECEn 224 The Correct Way To Make A Loadable Register (1-Bit) D Q 0101 CLK DIN LOAD Q When LOAD=0, FF loads old value When LOAD=1, FF loads DIN

© BYU 12 REGISTERS Page 13 ECEn 224 A Correct Scenario D Q FFA CLK QAQA D Q 0101 CLK LOAD Q FFB No clock skew Both FF’s load on exactly same clock edge Both Q’s appear at same time Timing analysis greatly simplified

© BYU 12 REGISTERS Page 14 ECEn 224 A Loadable Parallel-In, Parallel-Out Register D Q 0101 CLK DIN(3:0) LOAD Q(3:0) 444 PIPO ? 4

© BYU 12 REGISTERS Page 15 ECEn 224 A Loadable Parallel-In, Serial-Out Register (PISO) CLK D Q 0101 LOAD/SHIFT# D2 CLK D Q 0101 LOAD/SHIFT# D1 CLK D Q 0101 LOAD/SHIFT# D0 SerOut SerIn When LOAD/SHIFT# = 1, register loads D2…D0 When LOAD/SHIFT# = 0, register shifts right This register is always either loading or shifting

© BYU 12 REGISTERS Page 16 ECEn 224 MUX for Register Control Loadable register concept can be generalized to provide any combination of inputs to register –Load, clear, set, enable, left shift, right shift, increment, etc.

© BYU 12 REGISTERS Page 17 ECEn 224 A SISO With An Enable Input CLK D Q 0101 ENABLE SerIn D Q CLK ENABLE CLK ENABLE SerOut Combination of loadable register with shift register… When ENABLE=0, register doesn’t shift (re-loads old value) When ENABLE=1, register shifts

© BYU 12 REGISTERS Page 18 ECEn 224 A Bidirectional Shift Register D Q Q CLK UP/DOWN# D Q Q CLK UP/DOWN# TopIn D Q Q CLK UP/DOWN# Q1 Q0 BottomIn Q2 Q1

© BYU 12 REGISTERS Page 19 ECEn 224 Uses of Shift Registers Collecting serial input data into a parallel word Shifting out bits of a word Delaying a serial stream by some # of cycles

© BYU 12 REGISTERS Page 20 ECEn 224 A Clearable Counter D Q Q CLK CLR INC Q Q+1 0 Q From there to here, from here to there, interesting circuits are everywhere… (when you have a MUX and some flip flops)

© BYU 12 REGISTERS Page 21 ECEn 224 An Up/Down Counter D Q Q CLK UP/DN# Q Q+1 How about an up/down counter + bi-directional shift register design?

© BYU 12 REGISTERS Page 22 ECEn 224 Up/Down Counter + Bi-Directional Shift Register D Q Q CLK Control Q+1 Q-1 Q<<1 Q>>

© BYU 12 REGISTERS Page 23 ECEn 224 An Accumulator D Q Q CLK LOAD A D Q Q CLK CLR A 0 This one loads A when LOAD=1 This one loads 0 when CLR=1 Both work, they just have different timings… Values to be added are placed on A input, one per cycle. Register accumulates their sum. 44 Version AVersion B

© BYU 12 REGISTERS Page 24 ECEn 224 Register Files Small memories holding multiple words of data

© BYU 12 REGISTERS Page 25 ECEn 224 Typical Register File DataIn clk Addr regWE RegFile DataOut n n m

© BYU 12 REGISTERS Page 26 ECEn 224 Typical Register File DataIn clk Addr regWE RegFile DataOut Data to be written to register file n n m

© BYU 12 REGISTERS Page 27 ECEn 224 Typical Register File DataIn clk Addr regWE RegFile DataOut Data to be written to register file Data that is read from register file n n m

© BYU 12 REGISTERS Page 28 ECEn 224 Typical Register File DataIn clk Addr regWE RegFile DataOut Data to be written to register file Data that is read from register file Address that reads and writes are for n n m

© BYU 12 REGISTERS Page 29 ECEn 224 Typical Register File DataIn clk Addr regWE RegFile DataOut Data to be written to register file Data that is read from register file Address that reads and writes are for n n m This register will hold 2 m words, each n bits wide

© BYU 12 REGISTERS Page 30 ECEn 224 Typical Register File DataIn clk Addr regWE RegFile DataOut Data to be written to register file Data that is read from register file Address that reads and writes are for Controls whether reading or writing n n m This register will hold 2 m words, each n bits wide

© BYU 12 REGISTERS Page 31 ECEn 224 Typical Register File DataIn clk Addr regWE RegFile DataOut Data to be written to register file Data that is read from register file Address that reads and writes are for Reads are asynchronous (combinational) Writes occur on the clock edge. n n m This register will hold 2 m words, each n bits wide Controls whether reading or writing

© BYU 12 REGISTERS Page 32 ECEn 224 Building a Register File Reg0 Reg1 Reg2 Reg3 Reg4 Reg5 Reg6 Reg7 Write Decoder Addr regWE Register write signals DataInclk 8:1 MUX DataOut m=3 n nnnnnnnnn

© BYU 12 REGISTERS Page 33 ECEn 224 Building a Register File Reg0 Reg1 Reg2 Reg3 Reg4 Reg5 Reg6 Reg7 Write Decoder Addr regWE Register write signals DataInclk 8:1 MUX DataOut Asynchronous read: just a MUX m=3 n nnnnnnnnn

© BYU 12 REGISTERS Page 34 ECEn 224 Building a Register File Reg0 Reg1 Reg2 Reg3 Reg4 Reg5 Reg6 Reg7 Write Decoder Addr regWE Register write signals DataInclk 8:1 MUX DataOut Asynchronous read: just a MUX m=3 n nnnnnnnnn Loadable registers

© BYU 12 REGISTERS Page 35 ECEn 224 Building a Register File Reg0 Reg1 Reg2 Reg3 Reg4 Reg5 Reg6 Reg7 Write Decoder Addr regWE Register write signals DataInclk 8:1 MUX DataOut Asynchronous read: just a MUX m=3 n nnnnnnnnn Loadable registers 3:8 Decoder with enable

© BYU 12 REGISTERS Page 36 ECEn 224 Loadable Register Reg0 Reg1 Reg2 Reg3 Reg4 Reg5 Reg6 Reg7 Register write signals DataInclk n n n n n n n n n Reg k clk n Load D Q DataIn regWE k QkQk n

© BYU 12 REGISTERS Page 37 ECEn 224 Write Decoder Write Decoder Addr regWE Register write signals m=3 3:8 Decoder Addr m=3 regWE Register write signals

© BYU 12 REGISTERS Page 38 ECEn 224 Multi-Ported Register File Reg0 Reg1 Reg2 Reg3 Reg4 Reg5 Reg6 Reg7 Write Decoder WAddrWE Register write signals DataInclk RAddr 8:1 MUX DataOut One write port, one read port. Different write and read addresses Can be reading from one location on same cycle you write to another location

© BYU 12 REGISTERS Page 39 ECEn 224 Multi-Ported Register File Reg0 Reg1 Reg2 Reg3 Reg4 Reg5 Reg6 Reg7 Write Decoder WAddrWE Register write signals DataInclk RAddr1 8:1 MUX Raddr2 DataOut1 DataOut2 One write port Two read ports Can be reading from two locations on same cycle you write to another location Useful for microprocessor design

© BYU 12 REGISTERS Page 40 ECEn 224 Memories vs. Register Files Random Access Memory (RAM) is similar to a register file –Stores many multi-bit words for reading/writing RAM usually only single-ported RAM usually much, much larger –Mbytes instead of bytes RAM implementation conceptually the same as register file –Transistor-level implementation different due to size/usage characteristics RAM design beyond the scope of this class