Registers & Register Transfers Digital Logic Design Instructor: Kasım Sinan YILDIRIM.

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

Computer Architecture CS 215
CPEN Digital System Design
KU College of Engineering Elec 204: Digital Systems Design
Registers and Counters
Registers and Counters
Propagation Delay: capacitances introduce delay
Chapter 7 Henry Hexmoor Registers and RTL
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 7 – Registers.
Charles Kime © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part 3 – Control of.
Chapter 7 Henry Hexmoor Registers and RTL
Chapter 7. Register Transfer and Computer Operations
Logic and Computer Design Fundamentals Registers and Counters
CPEN Digital System Design Chapter 9 – Computer Design
Chapter 7 - Part 2 1 CPEN Digital System Design Chapter 7 – Registers and Register Transfers Part 2 – Counters, Register Cells, Buses, & Serial Operations.
Logic and Computer Design Dr. Sanjay P. Ahuja, Ph.D. FIS Distinguished Professor of CIS ( ) School of Computing, UNF.
Chapter 7 – Registers and Register Transfers Part 1 – Registers, Microoperations and Implementations Logic and Computer Design Fundamentals.
KU College of Engineering Elec 204: Digital Systems Design
Counters and Registers
Chapter 1_4 Part II Counters
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
Rabie A. Ramadan Lecture 3
CSC321 Where We’ve Been Binary representations Boolean logic Logic gates – combinational circuits Flip-flops – sequential circuits Complex gates – modules.
Chap 8. Sequencing and Control. 8.1 Introduction Binary information in a digital computer –data manipulated in a datapath with ALUs, registers, multiplexers,
Computer Design Basics
Instructor: Yuzhuang Hu State-Machine Diagrams contd. (Chapter 5, Section 5-7) Use boolean expressions to simplify the diagram. S0S0 S1S1.
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 7 – Registers.
EKT221 ELECTRONICS DIGITAL II CHAPTER 4: Computer Design Basics
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
Chapter 4 Computer Design Basics. Chapter Overview Part 1 – Datapaths  Introduction  Datapath Example  Arithmetic Logic Unit (ALU)  Shifter  Datapath.
7-6 단일 레지스터에서 Microoperation Multiplexer-Based Transfer  Register 가 서로 다른 시간에 둘 이상의 source 에서 data 를 받을 경우 If (K1=1) then (R0 ←R1) else if (K2=1) then.
 Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences.
ENG241 Digital Design Week #8 Registers and Counters.
Register and Register Transfers
Chapter 1_4 Part III more on … Counters Chapter 1_4 Part III more on … Counters.
REGISTER TRANSFER & MICROOPERATIONS By Sohaib. Digital System Overview  Each module is built from digital components  Registers  Decoders  Arithmetic.
Chapter 1 Counters. Counters Counters are sequential circuits which "count” through a specific state sequence. They can count up, count down, or count.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
DIGITAL 2 : EKT 221 RTL : Microoperations on a Single Register
EKT 221 : Chapter 4 Computer Design Basics
C HAPTER S IX R EGISTERS AND C OUNTERS 1. A clocked sequential circuit consists of a group of flip-flops and combinational gates connected to form a feedback.
Counters.
Register Transfer Languages (RTL)
Chap 5. Registers and Counters
Chapter 1_0 Registers & Register Transfer. Chapter 1- Registers & Register Transfer  Chapter 7 in textbook.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 23 Introduction Computer Specification –Instruction Set Architecture (ISA) - the specification.
Sequential Circuit: Design BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part.
REGISTER TRANSFER & MICROOPERATIONS By Sohaib. Digital System Overview  Each module is built from digital components  Registers  Decoders  Arithmetic.
6.
6.
Chap 7. Register Transfers and Datapaths
EKT 221 – Counters.
EEL 3705 / 3705L Digital Logic Design
EKT 221 : Digital 2 COUNTERS.
KU College of Engineering Elec 204: Digital Systems Design
Chapter 7 – Registers and Register Transfers
DIGITAL 2 : EKT 221 RTL : Microoperations on a Single Register
Register Transfer and Microoperations
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
Chapter 1_5 register Cell Design
Overview Part 1 - Registers, Microoperations and Implementations
Overview Part 1 - Registers, Microoperations and Implementations
CHAPTER-3 REGISTER TRANSFER LANGUAGE AND MICROOPERATIONS
Instruction execution and ALU
Presentation transcript:

Registers & Register Transfers Digital Logic Design Instructor: Kasım Sinan YILDIRIM

Registers Register – a collection of binary storage elements More often, think of a register as storing a vector of binary values Frequently used to perform simple data storage and data movement and processing operations

How many states are there? How many input combinations? Output combinations? What is the output function? What is the next state function? Moore or Mealy? What are the quantities above for an n-bit register? Example: 2-bit Register C D Q C D Q CP In0 In1 A1 A0 Y1 Y0

Register as a Storage A register can store information for multiple clock cycles – To “store” or “load” information should be controlled by a signal Load is a frequent name for the signal that controls register storage and loading – Load = 1: Load the values on the data inputs – Load = 0: Store the values in the register

A more reliable way to selectively load a register: – Run the clock continuously, and – Selectively use a load control to change the register contents. Example: 2-bit register with Load Control: For Load = 0, loads register contents (hold current values) For Load = 1, loads input values (load new values) Hardware more complex than clock gating, but free of timing problems Registers with Load-Controlled Feedback C D Q C D Q Clock In0 In1 A1 A0 Y1 Y0 Load 2-to-1 Multiplexers

Example: 4-bit Register with Parallel Load

Digital Systems Interconnected flip-flops and gates. – Sequential circuits – state tables – The number of states – prohibitively large!!! Systems are composed of – Subsystems (modules) - modular and hierarchial approach Modules are composed of – Functional blocks, registers, counters, decoders, multiplexers, buses, arithmetic elements, flip-flops Modules communicate with data and control signals.

Digital Systems Data path – performs data processing operations – Defined by their registers and the operations performed on binary data stored in the registers. Registers are the basic components of the digital system! Control unit – determines the sequence of operations

Register Transfer Operations Register Transfer Operations – The movement and processing of data stored in registers Three basic components: – set of registers – operations – control of operations Elementary Operations -- load, count, shift, add, bitwise "OR", etc. – Elementary operations called microoperations

Register Notation

Conditional Transfer If (K1 =1) then (R2  R1) is shortened to K1: (R2  R1) where K1 is a control variable specifying a conditional execution of the microoperation.

Microoperations

Logical Groupings: – Transfer - move data from one register to another – Arithmetic - perform arithmetic on data in registers – Logic - manipulate data or use bitwise logical operations – Shift - shift data in registers Arithmetic operations + Addition – Subtraction * Multiplication / Division Logical operations  Logical OR  Logical AND  Logical Exclusive OR - Not

Arithmetic Microoperations Note that any register may be specified for source 1, source 2, or destination.

Example  X K1 : R1  R1 + R2 X K1 : R1  R1 + R2 + 1  Control variables K1 and X enables and selects the add or subtract operation.

Logical Microoperations R1 = R2 =

Shift Microoperations  Note: These shifts "zero fill". Sometimes a separate flip- flop is used to provide the data shifted in, or to “catch” the data shifted out.  Other shifts are possible (rotates, arithmetic)

Microoperations on a Single Register

We will consider the implementations of microoperations with a single register as the destination of all primary results. The combinational logic implementing the microoperation is assumed to be a part of the register – Dedicated logic

Multiplexer-Based Transfers Multiplexers connected to register inputs produce flexible transfer structures (Note: Clocks are omitted for clarity) K1: R0  R1 K2. K1: R0  R2

Generalization of Multiplexer Selection for n Sources

Shift Registers Shift Registers move data laterally within the register toward its MSB or LSB position In the simplest case, the shift register is simply a set of D flip-flops connected in a row like this: Data input, In, is called a serial input or the shift right input. Data output, Out, is often called the serial output.

Shift Registers (continued) The behavior of the serial shift register is given in the listing on the lower right T0 is the register state just before the first clock pulse occurs T1 is after the first pulse and before the second. Initially unknown states are denoted by “?” Complete the last three rows of the table DQDQDQDQ In Clock CP A B C Out

Parallel Load Shift Registers By adding a mux between each shift register stage, data can be shifted or loaded.

Bidirectional Shift Register

Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences. Two distinct types are in common usage: Ripple Counters – Clock connected to the flip-flop clock input on the LSB bit flip-flop – For all other bits, a flip-flop output is connected to the clock input, thus circuit is not truly synchronous! – Output change is delayed more for each bit toward the MSB. – Resurgent because of low power consumption Synchronous Counters – Clock is directly connected to the flip-flop clock inputs – Logic is used to implement the desired state sequencing Counters

How does it work? – When there is a positive edge on the clock input of A, A complements – The clock input for flip- flop B is the complemented output of flip-flop A – When flip A changes from 1 to 0, there is a positive edge on the clock input of B causing B to complement. Reset Clock D D CRCR CRCR B A Ripple Counter CP B A The changes “ripple” upward through the chain of flip-flops, i. e., each transition occurs after a clock-to-output delay from the stage before.

Ripple Counter (continued)

In fine timing detail: – The clock to output delay t PHL causes an increasing delay from clock edge for each stage transition. – Thus, the count “ripples” from least to most significant bit. – For n bits, total worst case delay is n t PHL. Ripple Counter (continued) CP A B C tPHL tpHL Not good for delay-dependent circuits!

Synchronous Counters To eliminate the "ripple" effects, use a common clock for each flip-flop and a combinational circuit to generate the next state. For an up-counter, use an incrementer => D3Q3 D2 Q2 D1 Q1 D0Q0 Clock Incre- menter A3 A2 A1 A0 S3 S2 S1 S0

Internal Logic – Half Adders to increment the value stored in the flip-flops Count Enable – Forces all outputs of AND chain to 0 to “hold” the state Carry Out – Added as part of incrementer – Connect to Count Enable of additional 4-bit counters to form larger counters Synchronous Counters (continued)

Add path for input data – enabled for Load = 1 Add logic to: – disable count logic for Load = 1 – disable feedback from outputs for Load = 1 – enable count logic for Load = 0 and Count = 1 The resulting function table: Counter with Parallel Load LoadCountAction 00Hold Stored Value 01Count Up Stored Value 1XLoad D

Carry chain – series of AND gates through which the carry “ripples” – Yields long path delays – Called serial gating Replace AND carry chain with ANDs in parallel – Reduces path delays – Called parallel gating Synchronous Counters (continued)

Design Example: Synchronous BCD Use the sequential logic model to design a synchronous BCD counter with D flip-flops Input combinations 1010 through 1111 are don’t cares

Synchronous BCD (continued) Use K-Maps to two-level optimize the next state equations and manipulate into forms containing XOR gates: D1 = Q1 D2 = Q2 + Q1Q8 D4 = Q4 + Q1Q2 D8 = Q8 + (Q1Q8 + Q1Q2Q4) The logic diagram can be draw from these equations – An asynchronous or synchronous reset should be added What happens if the counter is perturbed by a power disturbance or other interference and it enters a state other than 0000 through 1001?

Find the actual values of the six next states for the don’t care combinations from the equations Find the overall state diagram to assess behavior for the don’t care states (states in decimal) Synchronous BCD (continued) Present StateNext State Q8 Q4 Q2 Q

Synchronous BCD

Arbitrary Count Sequence

Register Cell Design

Assume that a register consists of identical cells Then register design can be approached as follows: – Design representative cell for the register – Connect copies of the cell together to form the register

Implement the following register transfers: – AND: (A  A. B) – EXOR: (A  A + B) – OR: (A  A + B) LOAD= AND + EXOR + OR A(t+1) i =AND.A i B i + EXOR.(A i B i +A i B i ) + OR(A i +B i ) Example 1: Design-1

Example 1: Design -2 A(t+1) i =AND.A i B i + EXOR.(A i B i +A i B i ) + OR(A i +B i ) + (AND+EXOR+OR) A i =(AND+OR+EXOR).A i B i + (EXOR+OR+AND).A i B i + (EXOR+OR).A i B i REDUCED COST!!!

Multiplexer and Bus-Based Transfers for Multiple Registers

Dedicated MUX-Based Transfers A digital system has many registers! Paths must be provided top transfer data from one register to another. Bus – a shared transfer path Multiplexer connected to each register input produces a very flexible transfer structure Characterize the simultaneous transfers possible with this structure.

Multiplexer Bus A single bus driven by a multiplexer lowers cost, but limits the available transfers Characterize the simultaneous transfers possible with this structure. Characterize the cost savings compared to dedicated multiplexers

Three-State Bus The 3-input MUX can be replaced by a 3-state node (bus) and 3-state buffers. Cost is further reduced, but transfers are limited

Serial Transfer and Microoperations

Serial Transfers and Microoperations Serial Transfer from register A to B

The circuit shown uses two shift registers for operands A(3:0) and B(3:0). The result is stored in the A register and the final carry in the flip-flop A3 A2 A1 A0 B3 B2 B1 B0 A B Cin Sum Cout DQ CP FA Load/Right Shift Registers Serial In Serial In Parallel Load (Clock and Load/Shift Control not shown) Serial Adder

Control of Register Transfers

Programmable and Non-Programmable Systems Programmable System – a portion of the input consists of a sequence of instructions called a program – typically stored in a memory and addressed by a program counter – the Control Unit is responsible for fetching and executing these instructions. Non-programmable System – the control unit does not deal with fetching and executing instructions – but contains all of the information for sequencing register transfers based on inputs and on status bits from the datapath. Only non-programmable designs are considered here.

Register Transfer System Design Procedure 1.Write a detailed system specification 2.Determine all data, control and status input signals, all data, control and status output signals, and registers of the datapath and control unit. 3.Find a state machine diagram for the system including register transfers for the datapath and control unit as outputs. 4.Determine all internal control and status signals. Use these signals to separate output conditions and actions, including register transfers, from the state machine diagram flow and represent them in tabular form. 5.Draw a block diagram of the datapath including all control and status inputs and outputs. Draw a block diagram of the control if it includes register transfer hardware. 6.Design any specialized register transfer logic as needed for the datapath and the control. 7.Design the control unit logic. 8.Verify the correct operation of the combined datapath and control unit. If verification fails, debug the system and verify the changed system.

The State Machine Diagram Model (SMD) Y, Z S0 S1 Moore Outputs ABAB S2 A  B A/Y, B/Z S0 S1 TCI Outputs ABAB S2 A  B S0 S1 TCD Outputs A  B/Y S2 (A  B)/Z TCOD Outputs (A  B) C/Y S0 S1 S2 ABAB C/Y Transition condition (TC) Transition condition-independent (TCI) Input Variables A, B, C Output Variables Y, Z Default: Y = 0, Z = 0 Transition condition-dependent (TCD) Transition and output condition-dependent (TCOD)

Example-1 What is the state diagram for this SMD? Y, Z A/Y BCBC S0 ABAB S2 A  B S1 S3 A  C ACAC B  C/Y (B  C)/Z A/Z BC Defaults: Y = 0, Z = 0 A/Y, B/Z

Example-2 What is the SMD for this state diagram?

Design Example – DASHWATCH - Specs Times intervals to at most seconds Stopwatch action and storage of best performance time per session (session ended by turning off power or pushing RESET) START STOP CSS RESET Display Time

Design Example – DASHWATCH - Specs

DASHWATCH – Registers (BCD Counter) Binary Counter with Parallel Load BCD Counter How to design 4-digit BCD Counter? 0.01 seconds = 100Hz must be the clock of the circuit

State Machine Diagram S1 S2 S3 S4 S5 S7S6 SD<-(9999) BCD TM<-(0000) BCD TM<-(TM+1) BCD, DIS=TM DIS=TM SD<-TM RESET START STOP CSS·START START STOP CSS TM<SD TM>=SD START CSS·START START DIS=SD STAR T STOP CSS RESET Display Time LSR RSTM ENTM LSR, UPDATE ALTB ALTB’ CONTROL CONTROL START STOP CSS RESET RSTM ENTM UPDATE LSR DIS DATA PATH DATA PATH ALTB DIS

SRST TM A<B Comparator A<B Comparator Storage Register LOAD RESET D1D0 16-Bit 2-to-1 MUX DP 4-Digit LCD Display Segment Converter 4-Digit BCD-to-7 D1D0 16-Bit 2-to-1 MUX ENTM RSTM ALTB LSR RESET SD S DIS 4-Digit BCD Counter C0 D CONTROL CONTROL UPDATE STARTSTOPCSSRESET DS 1

Output Equations Control State Machine Flip-Flop Input Equations One-Hot State Assignment – 7 bits State S1 entered only by using asynchronous RESET (RESET)

Microprogrammed Control Microprogrammed Control — a control unit with binary control values stored as words in memory. Microinstructions — words in the control memory. Microprogram — a sequence of microinstructions. Control Memory — RAM or ROM memory holding the microinstructions. Writeable Control Memory — RAM Memory into which microinstructions may be written

Microprogrammed Control (continued)