Nothing Special   »   [go: up one dir, main page]

Control Logic Design

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 52

Dept.

of CSE, KUET

Control Logic Design


 Introduction
 Possible configurations for a control
unit
 Control logic design with specific
Reference examples
book:
 Digital Logic and Computer Design (Chapter 10)
 by M. Morris Mano
Introduction

Most challenging and creative part of the design


• Establishment of design objectives
• The formulation of algorithms and procedures

A design algorithm is a procedure for implementing the problem with a given


piece of equipment

• First, the problem at hand must be thoroughly understood.


• Second, an initial configuration of equipment must be assumed for implementing the
procedure.

2
Dept. of CSE, KUET

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
 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 3
Dept. of CSE, KUET

Introduction

Data processor
A general-purpose
processing unit
 Consists of individual
registers
and associated digital
Control Logic
functions
 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
Control logic provides
a prescribed set of a time sequence of signals for initiating
the microoperations in the data-processor.
microoperations. 4
Dept. of CSE, KUET

Control Organization

Control is a sequential circuit


 So can be designed by a sequential logic
procedure.
 In theory
 But impractical for large number of states.
 Space efficiency
 Propagation delay
 Maintenance and upgrade becomes very
costly

5
Dept. of CSE, KUET

Control Organization

 The goal of control logic design is the development of a circu


that implements the desired control sequence in a logical and
straight forward manner.

Four methods of control organization


1. One flip-flop per state method Use SSI and MSI
and called hard-
2. Sequence register and decoder wired control
method
Use LSI device such
3. PLA control
PLA
as or
4. Microprogram control ROM

6
Dept. of CSE, KUET

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.
 So, sometimes called ring- 7
Dept. of CSE, KUET

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. 8
Dept. of CSE, KUET

PLA

Remember PLA?

9
Dept. of CSE, KUET

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.
10
Dept. of CSE, KUET

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 1’s and 0’s 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.

11
Dept. of CSE, KUET

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

12
Dept. of CSE, KUET

Development of a Design Algorithm (Hard-wired


Control)

1. Statement of the problem


Addition and subtraction of two binary numbers
represented in sign-magnitude form.

2. Equipment configuration

n-1 bit

13
Dept. of CSE, KUET

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


(+ 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. 14
Dept. of CSE, KUET

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)
15
Subtract smaller one from the larger
Dept. of CSE, KUET

Development of a Design Algorithm (Hard-wired Control)


System block diagram

16
Dept. of CSE, KUET
ALU and its Function Table (from Ch09)
14

17
Dept. of CSE, KUET

Development of a Design Algorithm (Hard-wired


Control) Control State Diagram

18
Dept. of CSE, KUET

Development of a Design Algorithm (Hard-wired


Control)

Design of Hard-wired Control

19
DDeepptt.. ooff
CCSSEE,,
KKUUEETT

Design of a Microprogram Controller


for Sign-Magnitude Addition and Subtraction

20
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Contents

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

21
Dept. of CSE, KUET

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


(+ 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. 22
Dept. of CSE, KUET
Flowchart, State Diagram &
Sequence of Microoperations

Need to Design a Microprogram Controller

23
Dept. of CSE, KUET

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 24
Dept. of CSE, KUET

Require Capabilities

1. Provision recognize external


to signals (qa or
2. q s).
Provision for sequencing
consecutive addresses.
3. Provision for addresses
choosing
based on status variables S and E.

25
Dept. of CSE, KUET
Recogniz
e
qa or qs.
Block Diagram

consecutive
Sequencing

addresses
26
Dept. of CSE, KUET

The Microprogram

Load External
Address

S=1

E=1
27
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
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.

28
DDeepptt.. ooff
CCSSEE,,
KKUUEETT

Design of General-Purpose Microprogram


Controller

29
Dept. of CSE, KUET
The Microprogram
Controller for
Addition and
Subtraction

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


situations.

30
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
A General-Purpose
Microprogram Control Unit

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

Why 26 bits word? C -> Carry


Z -> Zero
 16 bits for microinstruction S -> Sign
V ->
 6 bits for 64 words
Overflow
 1 bit for external address
 3 bits for 8 status bits

31
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Counting the Number of 1’s in a register

Set processor register R2


with
number of 1’s in register R1

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

32
Dept. of CSE, KUET

30
Processor Unit
(from Ch09)

33
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Microprogram

(e.g., Z)

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

Cin 34
The microprogram method sometimes referred as
DDeepptt.. ooff
CCSSEE,,
KKUUEETT

Multiplication of two fixed-point binary numbers

35
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Sign-magnitude Multiplication

Statement of the problem


DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Sign-magnitude Multiplication

Statement of the problem


DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Sign-magnitude Multiplication

Equipment Configuration
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Sign-magnitude Multiplication
Derivation of Algorithm

AQ <- shr EAQ, E <- 0


means
A <- shr A, Q <- shr Q,
Ak <- E, Qk <- A1 , E <-
39
0
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Sign-magnitude Multiplication
Control Specifications
Derivation of Algorithm

40
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Sign-magnitude Multiplication
Data-Processor Specification
Derivation of Algorithm

41
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Sign-magnitude Multiplication

Control Specifications

JK Flip-flop excitation table


Q(t) Q(t+1) J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0 42
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
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 don’t care
entries; otherwise, it may be advantageous to use a ROM instead of a PLA.
43
DDeepptt.. ooff
Review of PLA CCSSEE,,
KKUUEETT

44
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
Control Circuit for Multiplication with PLA

State Table for PLA

If an input does not influence the next


state, it marked it with don’t care X.

PLA is programmed to provide


the control outputs and the next
state for the sequence register

45
DDeepptt.. ooff
CCSSEE,,
KKUUEETT
PLA Program Table from State Table
State Table for PLA

State Table to Program Table


X’s in the input columns and 0’s
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. 46
Dept. of CSE, KUET

PLA vs Sequence Register and


Decoder
 The design of a control unit with a
PLA is very similar to the design
using the sequence register and
decoder methods.
 The sequence register in both
methods is the same. The difference
in the methods is in the way the
combinational-logic part of the
control is implemented.
 The PLA essentially replaces the
decoder and all other decision logic
circuits required in the hard-wired
implementation.
 The PLA acts as the combinational
logic part of a sequential circuit to
provide the control outputs and
the next state values for the47
Dept. of CSE, KUET

PLA vs Control Memory


The organization of the PLA control and Microprogram control methods is
different,
although there is a certain amount of similarity between control methods.
 The PLA unit in a PLA control may be
visualized as a control memory that
stores control information for the
system.
 The outputs of the sequence register,
together with external inputs, may be
considered to be an address for such a
control memory.
 The outputs provide a control word for
the data processor, and the next-state
information specifies a partial value for
the next address in the control memory.
 A PLA control may be classified as a
48
microprogram control unit with the
Dept. of CSE, KUET

Exercise

49
Dept. of CSE, KUET

Exercise

50
Dept. of CSE, KUET

Exercise

51
Dept. of CSE, KUET

Exercise

52

You might also like