













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A chapter extract from a microprocessor design textbook, discussing various datapath elements such as register files, adders/subtractors, and logical units. It covers topics like register layout, write and read decoders, 32-bit register files, adders/subtractors with carry-in and carry-out signals, and logical functions. The text also mentions the implementation of logical units using bit slices and the introduction of shift units.
Typology: Exams
1 / 21
This page cannot be seen from the preview
Don't miss anything!














INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
•CHAPTER XI
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
DATAPATH ELEMENTS
-INTRODUCTION
So far we have discussed many small components and buildingblocks.
One final step in our building blocks before we can start to piecetogether a microprocessor is various datapath elements. •
We have already discussed portions of these datapath elements in terms of other components and building blocks.
We will now consider some of these components and building blocks in ways that will make the design of a microprocessor a little easier in thenext chapter.
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
DATAPATH ELEMENTS
-
REGISTER FILES
-REGISTER LAYOUT
For writing to a register, we include a write address with decoder. •
A given
Write Address
(with
Write Enable = 1
) selects which register, 0
through
m
Register 0Register 1
Register
m
Data
Out
Data
In
n
n
w
0
w
1
w
m
1
Decoder
m
Write
Address
Write
Enable
r
1
r
m
1
r
0
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
DATAPATH ELEMENTS
-
REGISTER FILES
-REGISTER LAYOUT-WRITE DECODER
For reading from a register, we include a read address with decoder. •
A given
Read Address
(with
Read Enable = 1
) selects which register, 0
through
m
Could have multiple
data outputs
with multiple
read address
decoders.
Register 0Register 1
Register
m
Data
Out
Data
In
n
n
w
0
w
1
w
m
1
r
0
r
1
r
m
1
Decoder
m
Read
Address
Read
Enable
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
REGISTER FILES
-WRITE DECODER-READ DECODER-32X32 REGISTER FILE
An
n
-bit adder/subtractor unit is often illustrated as follows.
This unit would have
n
full-adders internally.
adder/subtrator
unit
n
n
n
a
s
enable
Select either
addition (
or subtraction (
Enable unit (
or disable unit (
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
REGISTER FILES
-
ADDER/SUBTRACTOR
-GENERAL UNIT DIAGRAM
Other signals often included with an adder/subtractor are shownbelow.
n
n
n
a
s
enable
in
out
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
REGISTER FILES
-
ADDER/SUBTRACTOR
-
LOGICAL UNIT
-INTRODUCTION
Below is a general unit diagram for an
n
-bit logical unit.
Logical operations, such as
/etc., are done for
each bit of
and
to form
logical
unit
n
n
n
enable
Enable unit (
or disable unit (
Logical Function (LF)
on 2 bits
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
ADDER/SUBTRACTOR
-
LOGICAL UNIT
-INTRODUCTION-GENERAL UNIT DIAGRAM
Recall the possible logic functions for two bits,
and
We can use the column
n
as the 4-bit LF input for the logical unit.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Null
Identity
Inhibition
Implication
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
LOGICAL UNIT
-GENERAL UNIT DIAGRAM-4-BIT LOGICAL FUNCTIONS-BIT SLICE IMPLEMENTAT.
The following are example LF inputs for a logical unit bit slice.
1
0
Module Enable
1
0
Module Enable
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
LOGICAL UNIT
-GENERAL UNIT DIAGRAM-4-BIT LOGICAL FUNCTIONS-BIT SLICE IMPLEMENTAT.
We have already discussed the bulk about shift units in previouschapters.
As given in the Free-Doc, there are different types of shift units. •
Logical shift
Arithmetic shift
Circular shift (this is just a rotate unit)
We want to discuss an implementation, the barrel shifter, that will beuseful in our single cycle datapath computer we will design nextchapter.
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
LOGICAL UNIT
-
SHIFT UNIT
-INTRODUCTION-GENERAL UNIT DIAGRAM
Previously, we discussed the
p
-shifter but not its implementation.
p
-shifter shifts the value to the left or right by
p
-bits.
A bit slice view of a
p
-shifter for
n
th bit could be as follows.
Notice that this can
shift by
p
-bits. It is
hardwired
to shift
p
-bits.
1
0
Module Enable
INTRO. TO COMP. ENG.
CHAPTER XI-
K
DATAPATH ELEMENTS
-
SHIFT UNIT
-INTRODUCTION-GENERAL UNIT DIAGRAM-
P
-SHIFTER BIT SLICE
A useful type of
p
-shifter is when p = 2
k
for some positive integer
k
k
-shifter allows use to build a barrel shifter.
1
0
Module Enable
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
SHIFT UNIT
P
-SHIFTER BIT SLICE
K
-SHIFTER BIT SLICE
-BARREL SHIFTER
We will do some exampleswith the following arbitrary n
-shifter on a 16-bit input.
Note that this barrel shiftercan shift the input by 15 bitsin either direction.
INTRO. TO COMP. ENG.
CHAPTER XI-
DATAPATH ELEMENTS
-
SHIFT UNIT
K
-SHIFTER BIT SLICE
-BARREL SHIFTER-SAMPLE BARREL SHIFTER
For example, consider theinput of
If we want to shift this value to the
left
by
, we need
the input
d = 0 s = (s
3
s
2
s
1
s
0
Note: This example is for a logical shift.