Chapter 9
Chapter 9
Chapter 9 – Computer
Design Basics
Part 1 – Datapaths
Chapter 9 Part 1 2
Introduction
Computer Specification
• Instruction Set Architecture (ISA) - the
specification of a computer's appearance to a
programmer at its lowest level
• Computer Architecture - a high-level
description of the hardware implementing
the computer derived from the ISA
• The architecture usually includes additional
specifications such as speed, cost, and
reliability.
Chapter 9 Part 1 3
Introduction (continued)
Chapter 9 Part 1 5
Datapath Example
L oad enable A select B select
registers L oad
R0 2 2
Two mux-based n n
L oad
register selectors R1
0
n
Register destination
1
MUX
2
n
0 3
decoder L oad
R2
1
2
MUX
Bus B
n
n
A ddress
out
Data
0 1
V, C, N, Z MF select MUX F
F
Function unit
Data in
n n
MD select 0 1
MUX D
n Bus D
Chapter 9 Part 1 6
Datapath Example: Performing a
Microoperation
L oad enable A select B select
Microoperation: R0 ← R1 + R2 Write
D data n
A address B address
Bus B
n
n
A ddress
out
Data
enable the Load input to R0 G select
A
A
B
B
H select
n
B
out
4 2
Apply 1 to Load Enable to force the V
S2:0 || Cin
A rithmetic/logic 0
S
IR Shifter IL 0
unit (A L U)
Load input to R0 to 1 so that R0 is C
N
G
n
H
n
loaded on the clock pulse (not shown) Z Zero Detect
MF select
0 1
Function unit
MUX F
The overall microoperation requires F
n n Data in
1 clock cycle n
MD select
Bus D
0 1
MUX D
Chapter 9 Part 1 7
Datapath Example: Key Control Actions
for Microoperation Alternatives
Perform a shift microoperation –
L oad enable A select B select
Write A address B address
D data n
to MB select n 1
2
MUX
n
Provide an address and data for a L oad
0
1
MUX
3
R2 2
memory or output write n n
3
Destination select n 1 0
data for a memory or output read MB select
BusA
MUX B
n A ddress
out
microoperation – apply 1 to MD A B
Bus B n
n
Data
out
select
G select H select
4 A B 2 B
S2:0 || Cin S
V A rithmetic/logic 0 IR Shifter IL 0
For some of the above, other C unit (A L U)
G H
N n
n
control signals become don't Z Zero Detect
MF select
0 1
Function unit
MUX F
cares F
n n Data in
MD select 0 1
MUX D
n Bus D
Chapter 9 Part 1 8
Arithmetic Logic Unit (ALU)
Chapter 9 Part 1 9
Arithmetic Circuit Design (continued)
There are only four functions of B to select as Y in G = A + Y:
Cin = 0 Cin = 1
• 0 G=A G=A+1
• B G=A+B G=A+B+1
• B G=A+B G=A+B+1
• 1 G=A–1 G=A
What functions are implemented with carry-in to the adder = 0?
=1? C in
n
A X
n n-bit n
B parallel G X Y Cin
add
B input n
Y
S0 logic
S1
Cout
Chapter 9 Part 1 10
Arithmetic Circuit Design (continued)
S1 S0 Y Cin =0 Cin =1
Chapter 9 Part 1 11
Logic Circuit
Ci Ci Ci 1 1
Ai Ai
One stage of
Bi Bi arithmetic
circuit 2-to-1
S0 S0
0 MUX
S1 S1
Gi
1
Ai S
B i One stage of
Cin S logic circuit
0
S1
S
The next most 2
significant select signals, S0 for the arithmetic circuit and
S1 for the logic circuit, are wired together, completing the two select
signals for the logic circuit.
The remaining S1 completes the three select signals for the arithmetic
circuit.
Chapter 9 Part 1 14
Combinational Shifter Parameters
Direction: Left, Right
Number of positions with examples:
• Single bit:
1 position
0 and 1 positions
• Multiple bit:
1 to n – 1 positions
0 to n – 1 positions
Filling of vacant positions
• Many options depending on instruction set
• Here, will provide input lines or zero fill
Chapter 9 Part 1 15
4-Bit Basic Left/Right Shifter
B3 B2 B1 B0
Serial
output L
Serial
output R
IR IL
0 1 2 M 0 1 2 M 0 1 2M 0 1 2M
S U S U S U S U
X X X X
2
S
H3
Serial Inputs: H2 H H
Shift1
Functions:
0
Chapter 9 Part 1 16
Barrel Shifter
D3 D2 D1 D0
S0
S1
3 2 1 0 S1 S0 3 2 1 0 S1 S0 3 2 1 0 S1 S0 3 2 1 0 S1 S0
M M M M
U U U U
X X X X
Y3 Y2 Y1
A rotate is a shift in which the bits shifted out are insertedY0into the
positions vacated
The circuit rotates its contents left from 0 to 3 positions depending on S:
S = 00 position unchanged S = 10 rotate left by 2 positions
S = 01 rotate left by 1 positions S = 11 rotate left by 3 positions
See Table 10-3 in text for details
Chapter 9 Part 1 17
Barrel Shifter (continued)
Chapter 9 Part 1 18
Datapath Representation
Have looked at detailed design n
of Write
D data
m
ALU and shifter in the datapath D address
2mx n
in slide 8 Register file
m
Here we move up one level in the A address B address
m
A data B data
Constant in
hierarchy from that datapath n
n n
function unit Z
F
The remaining muxes and buses n n
Data in
which handle data transfers are 0 1
MD select MUX D
at the new level of the hierarchy Chapter 9 Part 1 19
Datapath Representation (continued)
In the register file: n
• Multiplexer select inputs become D data
Write
A address and B address m
D address
• Decoder input becomes D 2mx n
Register file
address m m
A address B address
• Multiplexer outputs become A
A data B data
data and B data Constant in
n n
• Input data to the registers n
1 0
becomes D data MB select
MUX B
• Load enable becomes write Bus A n
Address out
Bus B n
The register file now appears like Data out
MD select 0 1
MUX D
Chapter 9 Part 1 20
Definition of Function
GSelect,HSelect,
andMF Unit Select (FS) Codes
in T ofFSCodes
MF G H
FS(3:0) Select Select(3:0) Select(3:0) Microoperation
Chapter 9 Part 1 21
The Control Word
Chapter 9 Part 1 22
The Control Word Fields
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DA AA BA M FS M R
B D W
Control word
Fields
• DA – D Address
• AA – A Address
• BA – B Address
• MB – Mux B
• FS – Function Select
• MD – Mux D
• RW – Register Write
The connections to datapath are shown in the next slide
Chapter 9 Part 1 23
Control Word Block Diagram
n
RW 0 Write D data
15
DA 14 D address
13 8x n
Register file
12 9
AA 11 A address B address 8 BA
10 7
A data B data
n n
n
Constant in
1 0
MB 6 MUX B
Bus A n
Address out
Bus B n
Data out
A B
V 5
C Function 4 FS
N unit 3
Z 2
n
n Data in
0 1
MD 1 MUX D
Bus D
Chapter 9 Part 1 24
Control Word Encoding
Encoding of Control
W
DA, AA, BA MB FS MD RW
Function Code Function Code Function Code Function Code Function Code
Chapter 9 Part 1 25
Microoperations for the Datapath -
Symbolic Representation
Micr o-
operatio n DA AA BA MB FS MD RW
Chapter 9 Part 1 26
Microoperations for the Datapath -
Binary
m Representation
Microoperations from
aT Binary C
o o
Micro-
operation DA AA BA MB FS MD RW
Chapter 9 Part 1 27
Datapath Simulation
Clock 1 2 3 4 5 6 7 8
DA 1 4 7 1 0 4 5
AA 2 0 7 0
BA 3 6 0 3 0
FS 5 14 1 2 0 10
Constant_in X 2 X
MB
A ddress_out 2 0 7 0
Data_out 3 6 0 2 3 0
Data_in 18 18
MD
RW
reg0 0
reg1 1 255 2
reg2 2
reg3 3
reg4 4 12 18
reg5 5 0
reg6 6
reg7 7 8
Status_bits 2 0 0 1 X
Chapter 9 Part 1 28
Terms of Use
All (or portions) of this material © 2008 by Pearson
Education, Inc.
Permission is given to incorporate this material or
adaptations thereof into classroom presentations and
handouts to instructors in courses adopting the latest
edition of Logic and Computer Design Fundamentals as
the course textbook.
These materials or adaptations thereof are not to be
sold or otherwise offered for consideration.
This Terms of Use slide or page is to be included within
the original materials or any adaptations thereof.
Chapter 9 Part 1 29