Professional Documents
Culture Documents
Henry Hexmoor 1
10-1
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.
Henry Hexmoor 2
Introduction (continued)
Henry Hexmoor 3
Datapaths
10-2
Guiding principles for basic datapaths:
The set of registers
Collection of individual registers
A set of registers with common access resources called a
register file
A combination of the above
Microoperation implementation
One or more shared resources for implementing
microoperations
Buses - shared transfer paths
Arithmetic-Logic Unit (ALU) - shared resource for
implementing arithmetic and logic microoperations
Shifter - shared resource for implementing shift
microoperations
Henry Hexmoor 4
Datapath Example
Figure 10-1
Four parallel-load Load enable
Write A address
A select B select
B address
D data n
registers (R0-R3) Load R0 2 2
Two mux-based n n
Register destination n 1
2
MUX
n
3
decoder Load
0
1
MUX
R2 2
Mux B for external n n
3
n 1 0
4 A B 2 B
V, C, N, Z MF select
0
MUX F
1
Function unit
F
n n Data In
0 1
Henry Hexmoor n
5 MD select
Bus D
MUX D
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
1 clock
Henry cycle
Hexmoor 6 MD select
Bus D
0 1
MUX D
n
Arithmetic Logic Unit (ALU)
Henry Hexmoor 7
Arithmetic Circuit Design
Figure 10-3 and Table 10-1 and table 10-2
(pages
There are only four functions of B 435,
to select438)
as Y in G = A + Y:
Cin = 0 Cin = 1
All 0s G =A G=A+ 1
B G =A+ B G=A+ B +1
B G =A+ B G = A + B + 1 Subtraction
All 1s G=A 1 G=A
Cin
n
A X
n n-bit n G = X Y + Cin
B parallel
n adder
B input Y
S0 logic
S1
Henry Hexmoor 8
Cout
Logic Circuit
The custom circuit has interchanged the (S1,S0) codes for XOR and NOT
compared to the MUX circuit. To preserve compatibility with the text,
we use the MUX solution.
Next, use the arithmetic circuit, the logic circuit, and a 2-way
multiplexer to form the ALU. See the next slide for the bit slice diagram.
The input connections to the arithmetic circuit and logic circuit have
been been assigned to prepare for seamless addition of the shifter,
keeping the selection codes for the combined ALU and the shifter at 4
bits:
Carry-in Ci and Carry-out Ci+1 go between bits
Ai and Bi are connected to both units
A new signal S2 performs the arithmetic/logic selection
The select signal entering the LSB of the arithmetic circuit, Cin, is
connected to the least significant selection input for the logic circuit,
S0 .
Henry Hexmoor 10
Arithmetic Logic Unit (ALU)
Figure 10-7
Ci Ci Ci +1
Ai Ai
One stage of
Bi B i 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.
Henry Hexmoor 11
Combinational Shifter Parameters
10-4
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
Henry Hexmoor 12
4-Bit Basic Left/Right Shifter (Figure 10-8)
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)
Henry Hexmoor 13
Barrel Shifter
(Figure 10-9)
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 (page 440)
Henry Hexmoor 14
Barrel Shifter (continued)
Henry Hexmoor 15
Datapath Representation
10-5
Here we move up one level in the n
1 0
MB select MUX B
registers
Bus A n
Address out
The ALU, shifter, Mux F and Bus B n
Data out
status hardware become a 4 A B
FS
function unit V
The remaining muxes and buses C Function
unit
N
which handle data transfers are Z
F
at the new level of the hierarchy n
n Data in
MD select 0 1
Henry Hexmoor 16 MUX D
Datapath Representation (continued)
n
D data
In the register file: m
Write
D address
Multiplexer select inputs become 2mx n
Register file
A address and B address m m
A address B address
Decoder input becomes D A data B data
address Constant in n
n
Multiplexer outputs become A n
1 0
data and B data MB select
MUX B
Input data to the registers Bus A n
Address out
Bus B n
becomes D data Data out
Henry Hexmoor 17
Definition of Function Unit Select (FS) Codes
G Select, H Select, and MF
in T (Table 10-4, page 443))
of FS Codes
MF G H
FS(3:0) Select Select(3:0) Select(3:0) Microoperation
Henry Hexmoor 18
The Control Word
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 (destination)
AA A Address
BA B Address (source for MUXB
MB Mux B (constant/source
FS Function Select
MD Mux D
RW Register Write
The connections to datapath are shown in the next slide
Henry Hexmoor 20
Control Word Block Diagram (Figure 10-11)
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
Henry Hexmoor 21
Control Word Encoding
Encoding of Control W Table 10-5
DA, AA, BA MB FS MD RW
Function Code Function Code Function Code Function Code Function Code
Henry Hexmoor 22
Microoperations for the Datapath -
Symbolic Representation
Micro- Table 10-6
operation DA AA BA MB FS MD RW
Henry Hexmoor 23
Microoperations for the Datapath - Binary
m
RepresentationBinary Co
Microoperations from Ta o
Micro-
Table 10-7
operation DA AA BA MB FS MD RW
Henry Hexmoor 24
Datapath Simulation
Figure 10-12
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
Henry Hexmoor Status_bits 2 0 25 0 1 X
Instruction Set Architecture (ISA) for Simple
Computer (SC)
10-7
A programmable system uses a sequence of instructions to control its
operation
An typical instruction specifies:
Operation to be performed
Operands to use, and
Where to place the result, or
Which instruction to execute next
Instructions are stored in RAM or ROM as a program
The addresses for instructions in a computer are provided by a program
counter (PC) that can
Count up
Load a new address based on an instruction and, optionally, status
information
Henry Hexmoor 26
Instruction Set Architecture (ISA) (continued)
Henry Hexmoor 27
ISA: Storage Resources
Figure 10-13
The storage resources are "visible" to the programmer at the lowest
software level (typically, machine or assembly language)
Storage resources
for the SC => Program counter
(PC)
Separate instruction and Instruction
data memories imply memory
"Harvard architecture" 215 x 16
Done to permit use of
single clock cycle per Register file
8 x 16
instruction implementation
Due to use of "cache" in
modern computer
Data
architectures, is a fairly memory
realistic model 215 x 16
Henry Hexmoor 28
ISA: Instruction Format
Henry Hexmoor 29
ISA: Instruction Format
Figure 10-14
15 9 8 6 5 3 2 0
Destination Source reg- Source reg-
Opcode register (DR) ister A (SA) ister B (SB)
(a) Register
15 9 8 6 5 3 2 0
Destination Source reg-
Opcode register (DR) ister A (SA) Operand (OP)
(b) Immediate
15 9 8 6 5 3 2 0
Address (AD) Source reg- Address (AD)
Opcode (Left) ister A (SA) (Right)
Henry Hexmoor 30
ISA: Instruction Format (continued)
15 9 8 6 5 3 2 0
(a) Register
This format supports instructions represented by:
R1 R2 + R3
R1 sl R2
There are three 3-bit register fields:
DR - specifies destination register (R1 in the examples)
SA - specifies the A source register (R2 in the first
example)
SB - specifies the B source register (R3 in the first
example and R2 in the second example)
Henry Hexmoor 31
ISA: Instruction Format (continued)
15 9 8 6 5 3 2 0
(b) Immediate
Henry Hexmoor 32
ISA: Instruction Format (continued)
15 9 8 6 5 3 2 0
Henry Hexmoor 33
ISA: Instruction Specifications
Henry Hexmoor 34
ISA: Instruction Specifications (continued)
Henry Hexmoor 35
ISA: Instruction Specifications (continued)
Henry Hexmoor 36
ISA:Example Instructions and Data in
Memory
Memory Repr esentation of Instructions and Data
Deciimal Decimal
Address Memory Contents Opcode Other Fields Operation
Henry Hexmoor 37
Single-Cycle Hardwired Control
10-8
Based on the ISA defined, design a computer architecture
to support the ISA
The architecture is to fetch and execute each instruction in
a single clock cycle
The datapath from Figure 10-11 will be used
The control unit will be defined as a part of the design
The block diagram is shown on the next slide
Henry Hexmoor 38
IR(8:6) || IR(2:0)
V Extend
C Branch PC
N Control
Z
P JB Address
LBC Instruction
memory RW D
Instruction DA Register
AA file
A B BA
Zero fill
IR(2:0) Constant
in
Instruction decoder
1 0
MUX B MB
Address out
Bus A Bus B
Data out
MW
D B A M F M R M P J B
A A A B S D WW L B C A B Data in Address
FS
CONTROL
V Data
C Function memory
unit
N
Data out
Figure 10-15 Z
F
Data in
0 1
MD MUX D
Henry Hexmoor Bus D 39
DATAPATH
The Control Unit
Henry Hexmoor 41
Instruction Decoder
Henry Hexmoor 42
Instruction Decoder (continued)
Henry Hexmoor 43
Instruction Decoder (continued)
Henry Hexmoor 44
Instruction Decoder (continued)
The types are based on the blocks controlled and the seven signals to be
generated; types can be divided into two groups:
Datapath and Memory Control (First 4 types)
PC Control (Last 3 types)
In Datapath and Memory Control blocks controlled are considered:
Mux B (1st and 4th types)
Memory and Mux D (2nd and 3rd types)
By assigning codes with no or only one 1 for these, implementation of MB,
MD, RW and MW are simplified.
In Control Unit more of a bit setting approach was used:
Bit 15 = Bit 14 = 1 were assigned to generate PL
Bit 13 values were assigned to generate JB.
Bit 9 was use as BC which contradicts FS = 0000 needed for branches. To
force FS(6) to 0 for branches, Bit 9 into FS(6) is disabled by PL.
Also, useful bit correlations between values in the two groups were
exploited in assigning the codes.
Henry Hexmoor 45
Instruction Decoder (continued)
essential parts of
the single-cycle
simple computer
DA AA BA MB FS MD RW MW PL JB BC
Henry Hexmoor 46
Control word