Professional Documents
Culture Documents
Advanced Microprocessor Designs: Few Important Concepts Related To Advanced Processors
Advanced Microprocessor Designs: Few Important Concepts Related To Advanced Processors
Microprocessor
Designs
Lecture 10
• Other Resources:
– An ALU does computations.
– A limited set of registers serve as fast temporary storage.
– A larger, but slower, random-access memory is also available.
2
What is CPU?: A Sequential Circuit
ALU
Registers
3
Register Transfer Language (Review)
• RTL is a kind of intermediate representation (IR) that is very close to
assembly language. It is used to describe data flow at the register -
transfer level of an architecture.
R1 R2
K: R2 R3
R1 R2, K: R2 R3
4
Register Transfer Language (Review)
• We can apply arithmetic operations to registers.
R1 R2 + R3
R3 R1 - 1
• Logical operations are applied bitwise. AND and OR are denoted with
special symbols, to prevent confusion with arithmetic operations.
R2 R1 R2 bitwise AND
R3 R0 R1 bitwise OR
R2 sl R1 left shift
R2 sr R1 right shift
5
Block Symbols for Registers
Load
n
Data input
n R0
Data output
6
Register File
AA k A address B address k BA
• Here is a block symbol for a
k
2 x n register file. A data B data
7
Accessing the Register File
• Normally, two registers can
be read at once by supplying
D
the AA and BA inputs. The
data appears on the A and B n
outputs.
D data
WR Write
• You can write to a register by DA
k
D address
using the DA and D inputs,
and setting WR = 1. Register File
k k
AA A address B address BA
• These are registers so there
must be a clock signal, not A data B data
shown here. n n
– We can read from the
register file at any time. A B
8
What’s Inside the Register File
• Here’s a 4 x n register file. (We’ll assume a 4 x n register file for all
our examples.)
n
n n
9
The All-Important ALU
• General block symbol for the ALU:
– A and B are two n-bit numeric inputs.
– FS is an m-bit function select code, which picks one of 2 m functions.
– The n-bit result is called F.
– Several status bits provide more FS Operation
information about the output F: 00000 F = A
00001 F = A + 1
• V = 1 in case of signed overflow.
00010 F = A + B
• C is the carry out. 00011 F=A+B+1
• N = 1 if the result is negative. 00100 F = A + B’
• Z = 1 if the result is 0. 00101 F = A + B’ + 1
00110 F=A–1
00111 F=A
n n
01000 F = A B (AND)
A B 01010 F= A B (OR)
m FS 01100 F= AB
ALU 01110 F= A’
V
C
N
10000 F= B
Z 10100 F= sr B (shift right)
F
11000 F= sl B (shift left)
n 10
Datapath
2 2
AA A address B address BA
– The ALU computes a result, which
A data B data
is saved back to the registers.
n n
A B
• WR, DA, AA, BA and FS are control 5
FS FS
signals. Their values determine the
exact actions taken by the datapath— V
ALU
which registers are used and for what C
N
operation. n Z
F
11
An Example Computation
• Let’s look at the proper control signals
for the operation below: D data
WR Write
R0 R1 + R3 1
DA D address
00
Register File
• Set AA = 01 and BA = 11. This causes
the contents of R1 to appear at A AA A address B address BA
data, and the contents of R3 to 01 11
12
Total Number of Required Registers ?
DA D address
A data B data
A B
FS FS
ALU
V
C
N
Z
F
13
We can access RAM also
• Here’s a way to connect RAM n
into our existing datapath.
D data
WR Write
• To write to RAM, we must give DA D address
an address and a data value. Register File
AA A address B address BA
• These will come from the A data B data RAM
registers. We connect A data n
n
ADRS
DATA OUT
to the memory’s ADRS input, +5V CS
and B data to the memory’s FS FS
A B MW
1
WR
14
R3 M[R0]
• AA should be set to 00, to read n
register R0.
• The value in R0 will be sent to 1
WR Write
D data
15
R3 R3 + 1
• AA = 11, so R3 is read from the n
register file and sent to the
ALU’s A input. 1 D data
WR Write
• FS needs to be 00001 for the DA D address
operation A + 1. Then, R3 + 1 11
Register File
appears as the ALU output F. AA A address B address BA
• If MD is set to 0, this output 11
A data B data RAM
will go back to the register file. n ADRS
n
• To write to R3, we need to +5V
DATA
CS
OUT
D0 n
Q D1
S MD
0
16
Constant in
D data
• One last refinement is the WR Write
addition of a Constant input. DA D address
Register File
arbitrary number. FS FS
A B MW WR
V
C ALU
N
Z
F
D0
Q D1
S MD
17
Thank You
18