Control Logic Design - PowerPoint PPT Presentation

1 / 60
About This Presentation
Title:

Control Logic Design

Description:

... than number of bits in either the Multiplicand or the Multiplier (up to 2n) ... Multiplicand 1000. Multiplier x 1001. 1000. 0000. 0000. 1000. Product ... – PowerPoint PPT presentation

Number of Views:702
Avg rating:3.0/5.0
Slides: 61
Provided by: joelbj
Category:

less

Transcript and Presenter's Notes

Title: Control Logic Design


1
Control Logic Design
  • CIS-3357
  • Computer Engineering
  • Chapter 8

2
HOMEWORK
8-1, 8-2, 8-7, 8-8, 8-9, 8-13, 8-14, 8-20
Have a GREAT Day !!
3
OVERVIEW
  • Introduction
  • Microprogrammed Control
  • Control of Processor Unit
  • Microprogram Examples
  • Design ExampleBinary Multiplier
  • Hardwired Control for Multiplier
  • Example of a Simple Computer
  • Design of Simple Computer

4
Introduction
  • Control logic is the hardware that controls the
    operation of all the various hardware pieces
    ranging from the ALU to the registers
  • Think of the control logic as the supervisor
  • Determines the sequence of operations to be
    performed

5
Introduction
  • Control logic is developed as one of two types
  • Hardwired control
  • Control logic is implemented with gates and
    flip-flops like a sequential circuit
  • Microprogrammed control
  • Control information such as control functions or
    control words are stored as 1s and 0s in a
    special memory
  • Hardwired control has the advantage of speed and
    size but is harder to do

6
Introduction
External Input
Control Logic Subsystem
Commands
Data Processor Subsystem
Status conditions
Input Data
Output Data
Hardwired or microprogrammed
7
OVERVIEW
  • Introduction
  • Microprogrammed Control
  • Control of Processor Unit
  • Microprogram Examples
  • Design ExampleBinary Multiplier
  • Hardwired Control for Multiplier
  • Example of a Simple Computer
  • Design of Simple Computer

8
Microprogrammed Control
  • Purpose of the control unit is to initiate a
    sequence of microoperations
  • During certain times, certain microoperations are
    to be performed while others remain idle
  • Control variable at any given time can be
    represented as a string of 1s and 0s (a control
    word)

9
Microprogrammed Control
  • Control words then can be programmed to initiate
    activity with various components in the digital
    subsystem
  • A system whose binary control variables (control
    words) are stored in a specialized memory is
    called a microprogrammed control unit
  • Each control word in control memory contains a
    microinstruction

10
Microprogrammed Control
  • The microinstruction specifies one or more
    microoperation
  • A sequence of microinstructions constitutes a
    microprogram
  • This microprogram is generally stored in a ROM

11
Microprogrammed Control
External Input
Control Word
Next address generator (sequencer)
Control Address Register
Control memory ROM
Control data Register
Next Address Information
12
Microprogrammed Control
  • The next address generator determines the address
    sequence that is read from control memory
  • Incrementing the control address
  • Transferring an external address
  • Loading an initial address to start operations
  • The control data register holds the present
    microinstruction while the next address is
    computed and read from memory
  • Allows the microoperations specified in the
    control word to be executed simultaneously with
    the generation of the next microinstruction

13
Microprogrammed Control
  • The control address register holds the next
    microinstruction and points to the correct
    location in memory while the instruction of the
    current address is being executed

14
OVERVIEW
  • Introduction
  • Microprogrammed Control
  • Control of Processor Unit
  • Microprogram Examples
  • Design ExampleBinary Multiplier
  • Hardwired Control for Multiplier
  • Example of a Simple Computer
  • Design of Simple Computer

15
Process Unit Control Example
SELECT
1-16
Control Memory 64 x 26 (ROM)
Control Address Register
MUX 1
17
18-20
21-26
External address
INC
LOAD
Clock
MUX 2
Select
3
n
Input Data
Processor Unit
16
Status bits
Control Word
16
Encoding Microinstructions
  • So far we have developed a control system in
    theory that will control the processor that we
    developed in chapter 7
  • We have a memory which has a 26 bit output for
    each and every address
  • Our control word has 16 bits which are used to
    control the processor
  • The other 10 bits are used for control of the the
    controller
  • How do we get the bits in the right arrangement
    to do the things we want them to do?
  • Can use state diagrams, flow charts, etc

17
4-bit Processor Unit
Clock
A Select
n Inputs
R0
Load
MUX
R1
Load
A Bus
MUX
R2
B Bus
B Select
Load
Operation Select
Arithmetic Logic Unit (ALU)
Load
R3
S
Z
V
C
0
1
2
3
Decoder
Shift Select
Shifter
Output data
Destination Select
18
4-bit Processor Unit
Input Data
Clock
Register File R0 to R7
4
1
B Bus Select
A Bus Select
B
A
5
2
6
3
7
Destination Select
B Bus
A Bus
D
8
ALU Select
9
10
Arithmetic Logic Unit (ALU)
11
F
12
Clock
S
Z
V
C
13
14
Shifter
H
15
16
Shift Select
Output data
1 2 3
4 5 6
7 8 9
10 11 12 13
14 15 16
A
B
D
F
H
19
Microinstruction Format
20
Microinstruction Format
ALU Operations
21
Microinstruction Format
Shifter Operations
22
Microinstruction Format
Select Input to MUX2
23
Microinstruction Format
Examples
24
Microinstruction Format
Examples
The microinstruction at CAR Address 36 reads
R1 ? R1 ? R2, CAR ? CAR 1
The microinstruction at CAR Address 40 reads
R3 ? R3 - 1, CAR ? 43
25
Microinstruction Format
Examples
The microinstruction at CAR Address 52 reads
R4 ? 0, If Sign 1 CAR ? 37 Else CAR ? CAR 1
The microinstruction at CAR Address 56 reads
R5 ? shl R5, If Carry 0 CAR?62 Else CAR?CAR1
26
OVERVIEW
  • Introduction
  • Microprogrammed Control
  • Control of Processor Unit
  • Microprogram Examples
  • Design ExampleBinary Multiplier
  • Hardwired Control for Multiplier
  • Example of a Simple Computer
  • Design of Simple Computer

27
Microprogram Example 1
  • Lets try an example and see if we can generate a
    microprogram

EXAMPLE Register Transfer Statements
28
Microprogram Example
Pneumonic Microprogram
29
Microprogram Example
ROM Microprogram Contents
30
Process Unit Control
SELECT
1-16
Control Memory 64 x 26 (ROM)
Control Address Register
MUX 1
17
18-20
21-26
External address
INC
LOAD
Clock
MUX 2
Select
3
n
Input Data
Processor Unit
16
Status bits
Control Word
31
Example 2 Counting of 1s
R2?0
START
R1?R1 C?0 Update Z
R2 holds the count value
R1 is the number
1
Z
Done
0
Rotate R1 with carry
0
C
1
R2?R2 1
32
Example 2 Counting 1s
Pneumonic Microprogram
33
Example 2 Counting 1s
ROM Microprogram Contents
34
OVERVIEW
  • Introduction
  • Microprogrammed Control
  • Control of Processor Unit
  • Microprogram Examples
  • Design ExampleBinary Multiplier
  • Hardwired Control for Multiplier
  • Example of a Simple Computer
  • Design of Simple Computer

35
Hardwire Control Example
  • So far weve talked about the microprogramming
    approach to developing control logic
  • Now lets change our focus and see how we can
    apply the design methods weve discussed
    previously to develop hardwired control logic
  • Take the binary multiplier as example

36
Binary Multiplication
  • Several ways of making hardware do multiplication
  • Number of bits in the Product is considerably
    larger than number of bits in either the
    Multiplicand or the Multiplier (up to 2n)
  • Can perform multiplication in binary by
    successive shifts and adds to develop partial
    products

Multiplicand 1000 Multiplier x
1001 1000 0000 0000
1000 Product 1001000
8
9
72
37
Multiply Hardware Configuration
Z1 if P0
Register B
Check Z?
Control Logic
P counter
32-bit ALU
S (Start)
n
Cout
Shift Right
Q0
Register A
C
0
Register Q
38
Binary Multiplication Process Flowchart
Initial State
0
S
1
A?0 C?0 P?n
1
0
P?P-1 A?AB, C?Cout
Q0
P?P-1
AQ?shr CAQ, C?0
1
0
Z
39
Binary Multiplication
  • Now that the flow chart is complete, lets see if
    we cant make some sense out of this flowchart and
    the associated hardware
  • Looking at an example multiplication problem done
    in binary

40
Binary Multiplication
Numerical Example
41
Binary Multiplication Example
  • The numerical example works !
  • Now determine the hardwired control
  • A Sequential circuit design problem
  • The flowchart is very similar to the state
    diagram
  • Rectangular boxes represent states
  • Diamond boxes designate decision points (input
    variables which determine the next state taken)

42
Binary Multiplication Example
  • Conversion from flowchart to state diagram is not
    unique - and thats ok!
  • Start by assigning an initial state T0 to our
    sequential controller
  • Then determine the required transitions to other
    states
  • For each state, determine the microoperations
    that must be initiated by the logic control
  • This procedure produces a state diagram for the
    controller along with a list of register transfer
    operations to be execute in each state

43
Binary Multiplication Example 1
  • For our example, there are going to be four
    states related to the rectangular boxes
  • There are two input variables S, Z

Z1/T3
S0/T01
Q0/T21,L
T1
T0
T2
T3
T11
S1/T01
Z0/T3
44
Binary Multiplication Example 1
Z1/T3
S0/T01
Q0/T21,L
T1
T0
T2
T3
T11
S1/T01
T0 Initial State
Z0/T3
T1 A?0, C?0, P?n
T2 P? P-1
L Q0T2 A?AB, C?Cout
T3 AQ?shr CAQ, C?0
45
Binary Multiplication Example 1
  • Control Block Diagram

Control Logic
T0
Z
T1
S
T2
T3
Q0
LQ0T2
46
Multiply Hardware Configuration
Z1 if P0
T0
(Load)
Register B
T0-T3
Check Z?
Control Logic
P counter
32-bit ALU
S (Start)
n
T2
(Dec)
T1
(Load)
Cout
Q0
Register A
C
0
Register Q
T3
T1
(Reset)
T3
(Shift)
T0
(Load)
Q0T2
47
Binary Multiplication Example 1
Z1/T3
S0/T01
Q0/T21,L
T1
T0
T2
T3
T11
S1/T01
Present State
Next State
Z0/T3
Outputs
Inputs
G0
G1
G0
G1
T0
T1
T2
T3
S
Z
0
0
0
X
0
0
1
0
0
0
0
0
1
X
0
1
1
0
0
0
0
1
X
X
1
0
0
1
0
0
1
0
X
X
1
1
0
0
1
0
1
1
X
0
1
0
0
0
0
1
1
1
X
1
0
0
0
0
0
1
48
Binary Multiplication Example 1
T0
T1
SZ
SZ
00
01
11
10
00
01
11
10
G1G0
G1G0
1
1
1
1
0
0
0
0
00
00
01
01
0
0
0
0
1
1
1
1
0
0
0
0
11
0
0
0
0
11
0
0
0
0
10
0
0
0
0
10
T0 G1(bar)G0
T0 G1(bar)G0(bar)
49
Binary Multiplication Example 1
T2
T3
SZ
SZ
00
01
11
10
00
01
11
10
G1G0
G1G0
0
0
0
0
0
0
0
0
00
00
01
01
0
0
0
0
0
0
0
0
0
0
0
0
11
1
1
1
1
11
1
1
1
1
10
0
0
0
0
10
T0 G1G0
T2 G1G0(bar)
50
Binary Multiplication Example 1
Next G1
Next G0
SZ
SZ
00
01
11
10
00
01
11
10
G1G0
G1G0
0
0
0
0
0
0
1
1
00
00
01
01
1
1
1
1
0
0
0
0
1
0
0
1
11
0
0
0
0
11
1
1
1
1
10
1
1
1
1
10
G1 G1G0 G1G0 G0Z
G0 G1G0 G0S
51
Binary Multiplication Example 2
  • For our example, there are going to be five
    states related to the rectangular boxes
  • There are three input variables S, Z, and Q0

Z1
Q00
S0
T1
T0
T2
T3
T4
Q01
S1
Z0
52
Binary Multiplication Example 2
Z1
Q00
S0
T1
T0
T2
T3
T4
Q01
S1
T0 Initial State
Z0
T1 A?0, C?0, P?n
T2 P? P-1
T3 A?AB, C?Cout
T4 AQ?shr CAQ, C?0
53
Binary Multiplication Example 2
  • Control Block Diagram

Control Logic
T0
Z
T1
S
T2
Q0
T3
T4
54
OVERVIEW
  • Introduction
  • Microprogrammed Control
  • Control of Processor Unit
  • Microprogram Examples
  • Design ExampleBinary Multiplier
  • Hardwired Control for Multiplier
  • Example of a Simple Computer
  • Design of Simple Computer

55
Design of Simple Computer
  • We have already talked in some detail about
    simple computer
  • Instruction codes
  • Code Formats
  • Block Diagram of the functional components
  • Designing the control of a computer is very
    similar to what we have already done for the
    multiplier
  • Break operations down into microoperations
  • Design control for each operation - Load, Store,
    Add, Sub, etc

56
Design of Simple Computer
  • Typically break down into Instruction Fetch and
    Execution phases
  • Fetch phase is typically very similar for all
    instructions
  • Execution phase is normally unique to a specific
    instruction
  • Flow chart the whole process for each instruction
  • Develop a state diagram from the flow chart

57
Opcode Process Flowchart
DR?M(PC)
START
T0
IR?DR PC?PC1
T1
Decode Opcode
INA microinstruction
CMA microinstruction
LOAD microinstruction
T2
CMA microinstruct 2
T3
LOAD microinstruct 2
Etc.
See Figure 8-14 for the simple computer show in
the book
58
Design of Simple Computer
  • Now convert into a state diagram or state table
    and reduce to refine hardware requirements as
    done previously
  • Many states will do common tasks (microoperations)

59
END Chapter 8
60
4-bit Processor Unit
Input Data
Clock
Register File R0 to R7
4
1
B Bus Select
A Bus Select
B
A
5
2
6
3
7
Destination Select
B Bus
A Bus
D
8
ALU Select
9
10
Arithmetic Logic Unit (ALU)
11
F
12
Clock
S
Z
V
C
13
14
Shifter
H
15
16
Shift Select
Output data
1 2 3
4 5 6
7 8 9
10 11 12 13
14 15 16
A
B
D
F
H
Write a Comment
User Comments (0)
About PowerShow.com