You are on page 1of 40

Dept.

of CSE, KUET 1

Control Logic Design


Introduction Possible configurations for a control unit Control logic design with specific examples

Dept. of CSE, KUET 2

Introduction
Control over a system is mandatory Control is require for any vehicle, from bicycles to aircrafts

Control signals are essential in any digital system (DS)


Binary information of a DS can be either data or control information Data-> Discrete elements of information that are manipulated by microoperations Control information-> The signals for specifying the sequence of microoperations.

The logic design of a DS =


Derive digital circuits that performs data processing + Derive digital circuits that provide control signals

Dept. of CSE, KUET 3

Introduction
Data processor
A general-purpose processing unit Consists of individual registers and associated digital functions

Control Logic
Generates the signals for sequencing the microoperations Sequential circuit whose internal states dictate the control functions At any given time the state of the sequential control initiates a prescribed set of microoperations.

Control logic provides a time sequence of signals for initiating the microoperations in the data-processor.

Dept. of CSE, KUET 4

Control Organization
Control is a sequential circuit can be designed by a sequential logic procedure but impractical because of large number of states.

The goal of control logic design is the development of a circuit that implements the desired control sequence in a logical and straight forward manner. Control logic design is the extension of sequential logic method combined with the register-transfer method.

Four methods of control organization 1.One flip-flop per state method 2.Sequence register and decoder method 3.PLA control 4.Microprogram control
Use SSI and MSI and called hard-wired control

Use LSI device such as PLA or ROM

Dept. of CSE, KUET 5

One Flip-Flop per State Method


Only one flip-flop is set at any particular time
Uses maximum number of flip-flops. Advantage is the simplicity. Savings in design effort It converts to a shift register when does not need external inputs for sequencing. It reduces to ring counter when control sequence repeats over time. It sometimes called ring-counter controller.

Dept. of CSE, KUET 6

Sequence Register and Decoder Method


Uses a register to sequence the control states and the register is decodes to provide one output for each state

For n flip-flops in the sequence register, it will give 2n using n x 2n decoder. It sometimes called counter-decoder because it continuously sequences when does not need external inputs.

Dept. of CSE, KUET 7

PLA Control
PLA contains all combinational circuits including the decoder and the decision logic

Sequence register is external to the PLA when it has only combinational circuits.

Dept. of CSE, KUET 8

Microprogram Control
Control unit initiates a series of sequential steps of microoperations. The control variables at any given time can be represented by a strings of 1s and 0s called a control word. A control unit whose control variables are stored in a memory is called a microprogrammed control unit. Each word of memory is called a microinstruction.

Dept. of CSE, KUET 9

Development of a Design Algorithm (Hard-wired Control)

Five consecutive steps of the design:


1. Statement of the problem 2. Equipment configuration 3. Derivation of the algorithm 4. Specify data processor 5. Design control logic

Dept. of CSE, KUET 10

Development of a Design Algorithm (Hard-wired Control)

1. Statement of the problem


Addition and subtraction of two binary numbers represented in signmagnitude form.

2. Equipment configuration

n-1 bit

Dept. of CSE, KUET 11

Development of a Design Algorithm (Hard-wired Control) 3. Derivation of the algorithm


For signed A and B eight different conditions: ( A ) ( B ) Subtraction is signed changed addition Need to implement four conditions : ( A ) + ( B )

Having same sign


(+ A) + (+ B) = + (A + B) (- A) + (- B) = - (A + B) Add the magnitude and sign is same.

Having different sign


if A=>B if A<B = - (B - A) = + (B - A) (+ A) + (- B) = + (A - B) (- A) + (+ B) = - (A - B)

Subtract smaller one from the larger one and resulting sign is the sign of the larger one.

Dept. of CSE, KUET 12

Development of a Design Algorithm (Hard-wired Control)

Having same sign


(+ A) + (+ B) = + (A + B) (- A) + (- B) = - (A + B) Add the magnitude and sign is same.

Having different sign


if A=>B if A<B (+ A) + (- B) = + (A - B) = - (B - A) (- A) + (+ B) = - (A - B) = + (B - A) Subtract smaller one from the larger one and resulting sign is the sign of the larger one.

Dept. of CSE, KUET 13

Development of a Design Algorithm (Hard-wired Control) System block diagram

Dept. of CSE, KUET 14

Development of a Design Algorithm (Hard-wired Control) Control State Diagram

Dept. of CSE, KUET 15

Development of a Design Algorithm (Hard-wired Control)

Design of Hard-wired Control

Dept. of CSE, KUET 16

Design of a Microprogram Controller for Sing-Magnitude Addition and Subtraction

Dept. of CSE, KUET 17

Contents

Problem Statement Flowchart , State Diagram & Sequence of Microoperations Microprogram Controller Design Conclusions

Dept. of CSE, KUET 18

Sign-Magnitude Addition and Subtraction


For signed A and B eight different conditions: ( A ) ( B ) Subtraction is signed changed addition Need to implement four conditions : ( A ) + ( B )

Having same sign


(+ A) + (+ B) = + (A + B) (- A) + (- B) = - (A + B) Add the magnitude and sign is same.

Having different sign


if A=>B if A<B = - (B - A) = + (B - A) (+ A) + (- B) = + (A - B) (- A) + (+ B) = - (A - B)

Subtract smaller one from the larger one and resulting sign is the sign of the larger one.

Dept. of CSE, KUET 19

Flowchart , State Diagram & Sequence of Microoperations

Need to Design a Microprogram Controller

Dept. of CSE, KUET 20

Microprogram Control

In a Microprogram Controller Control variables are stored in memory, usually ROM. After each operation control unit must determine its next address. Contain additional bits with bits for microoperations and a special circuit.

A microinstruction = bits for initiating microoperations + bits to determine next address.

Microprogram controller is efficient for large and/or complicated system

Dept. of CSE, KUET 21

Require Capabilities

1.Provision to recognize external signals (qa or qs). 2.Provision for sequencing consecutive addresses. 3.Provision for choosing addresses based on status variables S and E.

Dept. of CSE, KUET 22

Block Diagram

Recognize qa or qs.

Sequ encin g cons ecuti ve addr esse s

Ch ng oosi ad se dres ba s on sed an S dE

Dept. of CSE, KUET 23

The Microprogram

Load External Address

S=1

E=1

Dept. of CSE, KUET 24

Conclusions

Sign-magnitude addition & subtraction is explained with four operations. A microprogram controller is designed for the operations. In the controller, a control instruction is a part of a microinstruction and the microinstructions are stored in a ROM.

Dept. of CSE, KUET 25

Design of Microprogram Controller

26

The Microprogram Controller for Addition and Subtraction

Dept. of CSE, KUET

A general-purpose configuration is require for a wide variety of situations.

Dept. of CSE, KUET 27

A General-Purpose Microprogram Control Unit

Requirements:
Have a large control memory Include all possible control variables Initiate many operations

Why 26 bits word?


16 bits for microinstruction 6 bits for 64 words 1 bit for external address 3 bits for 8 status bits

C -> Carry Z -> Zero S -> Sign V -> Overflow

Dept. of CSE, KUET 28

Counting the Number of 1s in a register

Set processor register R2 with number of 1s in register R1


If R1=00110101 then R2 will be 100 (4 in binary )

Dept. of CSE, KUET 29

Microprogram

The microprogram method sometimes referred as firmware

Dept. of CSE, KUET 30

Multiplication of two fixed-point binary numbers

Dept. of CSE, KUET 31

Sign-magnitude Multiplication
Statement of the problem

Dept. of CSE, KUET 32

Sign-magnitude Multiplication
Statement of the problem

Dept. of CSE, KUET 33

Sign-magnitude Multiplication
Equipment Configuration

Dept. of CSE, KUET 34

Sign-magnitude Multiplication
Derivation of Algorithm

AQ <- shr EAQ, E <- 0 means A <- shr A, Q <- shr Q, Ak <- E, Qk <- A1, E <- 0

Dept. of CSE, KUET 35

Sign-magnitude Multiplication
Control Specifications

Derivation of Algorithm

Dept. of CSE, KUET 36

Sign-magnitude Multiplication
Data-Processor Specification

Derivation of Algorithm

Data-Processor Dept. of CSE, KUET Specification


37

Sign-magnitude Multiplication
Control Specifications

JK Flip-flop excitation table Q(t) 0 0 1 1 Q(t+1) 0 1 0 1 J 0 1 X X K X X 1 0

Dept. of CSE, KUET 38

Control Circuit for Multiplication with PLA


Any combinational circuit can be replaced by programmable logic array (PLA) Possible to design of a control circuit with a register connected to a PLA.

Control Circuit with PLA


The register operates as a sequence register that determines the state of the control. PLA is programmed to provide the control outputs and the next state for the sequence register.

PLA method should be used if the state table contains many dont care entries; otherwise, it may be advantageous to use a ROM instead of a PLA.

Dept. of CSE, KUET 39

Control Circuit for Multiplication with PLA


State Table for PLA

If an input does not influence the next state, it marked it with dont care X.

Dept. of CSE, KUET 40

Control Circuit for Multiplication with PLA


State Table for PLA

PLA control may be classified as a microprogram control unit with the PLA replacing the ROM for the control memory.

State Table to Program Table Xs in the input columns and 0s in the output columns of state table are changed to dashes in program table. PLA Five inputs and Seven outputs. Seven product terms, one for each row in the state table.

You might also like