Professional Documents
Culture Documents
Chapter 10 – Computer
Design Basics
Part 1 – Datapaths
Chapter 10 Part 1
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 10 Part 1
Introduction (continued)
registers Load R0 2 2
n n
n n
Mux B for external
Load R3
constant input 0 1 2 3 n
n
Register file
n
Decoder
Buses A and B with external 2
D address
Constant in n
A data
n
B data
Bus A n Address
V Arithmetic/logic 0 IR Shifter IL 0
Mux D for external data input C unit (ALU)
G H
N n
n
Logic for generating status bits Z Zero Detect
MF select
0
MUX F
1
Function unit
V, C, N, Z F
n n Data In
MD select 0 1
MUX D
n Bus D
Chapter 10 Part 1
Datapath Example: Performing a
Microoperation
Load enable A select B select
Microoperation: R0 ← R1 + R2 Write
D data n
A address B address
4 A B 2
Apply 1 to Load Enable to force the V
S2:0 || Cin
Arithmetic/logic 0
S
IR Shifter IL 0
unit (ALU)
Load input to R0 to 1 so that R0 is N
C
G
n
H
n
loaded on the clock pulse (not shown) Z Zero Detect
0 1
MF select MUX F Function unit
The overall microoperation requires F
n n Data In
Decoder
A data B data
Provide an address and obtain 2
D address
Constant in n n
Destination select
data for a memory or output read
n 1 0
MB select
MUX B Address
Bus A n
microoperation – apply 1 to MD A B
Bus B n
n
Out
Data
Out
select G select
4 A
S2:0 || Cin
B
H select
2 S
B
V Arithmetic/logic 0 IR Shifter IL 0
For some of the above, other C unit (ALU)
G H
N
control signals become don't cares n n
Z Zero Detect
0 1
MF select MUX F Function unit
F
n n Data In
MD select 0 1
MUX D
n Bus D
Chapter 10 Part 1
Arithmetic Logic Unit (ALU)
Chapter 10 Part 1
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?
Cin
=1?
n
A X
n n-bit n
B parallel G 5 X 1 Y 1 Cin
n adder
B input Y
S0 logic
S1
S1 S0 Y Cin 0 Cin 1
= =
0 0 all 0's G = A (transfer) G = A 1 (increment)
0 1 B G = A + B (add) G = A B 1
+
1 0 B G = A B G = A B 1 (subtract)
1 1 all 1's G = A 1 (decrement) G = A (transfer)
Chapter 10 Part 1
Logic Circuit
Chapter 10 Part 1
Arithmetic Logic Unit (ALU) (continued)
Ci Ci Ci +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
logic circuit
C in S0
S1
S2
The next most 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 10 Part 1
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 10 Part 1
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 H2 H1 H0
Serial Inputs:
Shift Functions:
• IR for right shift
(S1, S0) = 00 Pass B unchanged
• IL for left shift 01 Right shift
Serial Outputs 10 Left shift
• R for right shift (Same as MSB input) 11 Unused
• L for left shift (Same as LSB input)
Chapter 10 Part 1
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 Y0
A rotate is a shift in which the bits shifted out are inserted into 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 10 Part 1
Barrel Shifter (continued)
Chapter 10 Part 1
Datapath Representation
Have looked at detailed design of n
1 0
multiplexer, decoder, and enable MB select MUX B
hardware for accessing them Bus A n
Address out
become a register file Bus B n
Data out
The ALU, shifter, Mux F and 4 A B
FS
status hardware become a V
Function
function unit C
unit
N
The remaining muxes and buses Z
F
which handle data transfers are n n
Data in
at the new level of the hierarchy 0 1
MD select MUX D
Chapter 10 Part 1
Datapath Representation (continued)
In the register file: n
MD select 0 1
MUX D
Chapter 10 Part 1
Definition of Function
G Select, H Select, and MF Unit Select (FS) Codes
in T of FS Codes
MF G H
FS(3:0) Select Select(3:0)
Select(3:0) Micr
ooperation
Chapter 10 Part 1
The Control Word
Chapter 10 Part 1
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 MR
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 10 Part 1
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 10 Part 1
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 10 Part 1
Microoperations for the Datapath -
Symbolic Representation
Micro-
operation DA AA BA MB FS MD RW
Chapter 10 Part 1
Microoperations for the Datapath -
Binary
m Representation
Microoperations from Ta Binary Co o
Micro-
operation DA AA BA MB FS MD RW
Chapter 10 Part 1
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
Address_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 10 Part 1
Terms of Use
© 2004 by Pearson Education,Inc. All rights reserved.
The following terms of use apply in addition to the standard Pearson
Education Legal Notice.
Permission is given to incorporate these materials into classroom
presentations and handouts only to instructors adopting Logic and
Computer Design Fundamentals as the course text.
Permission is granted to the instructors adopting the book to post these
materials on a protected website or protected ftp site in original or
modified form. All other website or ftp postings, including those
offering the materials for a fee, are prohibited.
You may not remove or in any way alter this Terms of Use notice or
any trademark, copyright, or other proprietary notice, including the
copyright watermark on each slide.
Return to Title Page
Chapter 10 Part 1