











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












INTRO. TO COMP. ENG.CHAPTER XII-1SINGLE CYCLE DPU R.M. Dansereau; v.1.
•CHAPTER XII
INTRO. TO COMP. ENG.CHAPTER XII-14 R.M. Dansereau; v.1.
SINGLE CYCLE DPU
- SINGLE CYCLE DPU-ARITHMETIC LOGIC UNIT-SINGLE CYCLE DPU W/ALU-IMMEDIATE REGISTER -^ 32x32 bits is not sufficient memory for most computers. •^ We can include external memory (SRAM, DRAM, etc.) as follows.
Zdi
X^ do Y^ do
rwe
STen a/s
asl 2
Clk^
im en^ im va immediate register
st en^ TG ld en TG
r/w msel
32
ZX^ wa^ ra
Y^ ra
INTRO. TO COMP. ENG.CHAPTER XI-7 R.M. Dansereau; v.1.
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
adder/subtrator n full-adders internally.
n n n
a^ s⁄ enable
Select eitheraddition (
or subtraction (
Enable unit (
or disable unit (
INTRO. TO COMP. ENG.CHAPTER XI-9 R.M. Dansereau; v.1.
DATAPATH ELEMENTS
- REGISTER FILES • ADDER/SUBTRACTOR-GENERAL UNIT DIAGRAM-OTHER UNIT SIGNALS -^ A useful unit would be one that can take two
n -bit inputs and perform
some logical operation between each of the bits to get an
n -bit output.
-^ For example, given the 8-bit values
and^ 1001 1000
, we might
want to find the
bit-wise logical
-^ Or similarly, the
bit-wise logical AND
of the two 8-bit values.
-^ These types of operations are often used for masking and setting bits.
bit-wiselogical OR
bit-wiselogical AND
INTRO. TO COMP. ENG.CHAPTER XI-15 R.M. Dansereau; v.1.
DATAPATH ELEMENTS
- LOGICAL UNIT • SHIFT UNIT-INTRODUCTION -^ Below is a general unit diagram for an
n -bit shift unit.
-^ Notice that the
n -bit value
A^ will be shifted according to the distance
indicated with signed number
1+log^2 n n n
enable^
Enable unit (
or disable unit (
INTRO. TO COMP. ENG.CHAPTER XII-10 R.M. Dansereau; v.1.
SINGLE CYCLE DPU
- SINGLE CYCLE DPU-ADD/SUBTRACT MACHINE-BASIC SINGLE CYCLE DPU-COMPUTATION EXAMPLES -^ Since only one of
, or^ LU^
will be active at a time in this architecture,
we will combine to form an
arithmetic logic unit
(^3232) en a/s 32
asl 2 asl line00 - AU01 - SU10 - LU
INTRO. TO COMP. ENG.CHAPTER XII-13 R.M. Dansereau; v.1.
SINGLE CYCLE DPU
- SINGLE CYCLE DPU-ARITHMETIC LOGIC UNIT-SINGLE CYCLE DPU W/ALU-IMMEDIATE REGISTER -^ The^ im_en
line does two things:
-^ When
^0 ,^ im_en
controls
-^ immediate register outputs
to go to
high impedence
so as^ NOT
to affect
Y bus.
-^ register file Y data out
to output corresponding register value.
-^ When
^1 ,^ im_en
controls
-^ immediate register
to output register value to
Y bus.
-^ register file Y data out
to go to
high impedence
so as^ NOT
to
affect^ Y bus
-^ The^ im_va
lines pass a value to the immediate register.
INTRO. TO COMP. ENG.CHAPTER XII-18 R.M. Dansereau; v.1.
SINGLE CYCLE DPU
- SINGLE CYCLE DPU-INCLUDING MEMORY-READING FROM MEMORY-WRITING TO MEMORY -^ Microcode in a processor are all of the control signals required to executean operation for a clock cycle. •^ We have actually looked at examples of a microcode operation when weconsidered various operations such asor •^ Later we will talk about macrocode which are longer operations consistingof many microcode operation over a number of clock cycles.
INTRO. TO COMP. ENG.CHAPTER XII-17 R.M. Dansereau; v.1.
SINGLE CYCLE DPU
- SINGLE CYCLE DPU-IMMEDIATE REGISTER-INCLUDING MEMORY-READING FROM MEMORY -^ A sample write/store operation can be expressed as follows^ •^ This operation uses the value in
R5^ as the address to the memory and
write the value in
R9^ to that address in the memory.
-^ What control signals are required?^ •^ en = 0
for^ ALU
-^ X^ = 00101ra^
,^ Y^ = 01001ra^
,^ Z^ = XXXXXwa^
, and^ rwe = 0
for^ RF.
-^ st_en = 1
and^ ld_en = 0
-^ ~r/w = w
and^ msel = 1
INTRO. TO COMP. ENG.CHAPTER XIII-3 R.M. Dansereau; v.1.
ISA
- ISA-INTRODUCTION -^ Below is the process for translating a program to machine opcodes.
High level programe.g. C, C++,
add $10, $8, $9xor $13, $11, $12lw $15,0($16) 010110001010111010010011001010100110101110110100101110100101010111011
Pascal, JavaAssembly languageprogram Machine instructions
Compiler translatesprogram Assembler convertsto machine code
INTRO. TO COMP. ENG.CHAPTER XIII-18 R.M. Dansereau; v.1.
ISA
- MIPS ASSEMBLY-REGISTER INSTRUCTIONS-IMMEDIATE INST. FORMAT-IMMEDIATE INSTRUCTIONS -^ While instructions can come in many different shapes and forms, we willconsider the following 32-bit instruction formats to loosely follow the MIPSR3000/4000 format.^ R-format I-format
opcode
other potential bits
opcode
immediate value
INTRO. TO COMP. ENG.CHAPTER XIII-21 R.M. Dansereau; v.1.
ISA
- MIPS ASSEMBLY-INSTRUCTION FORMATS-R-FORMAT W/ DPU-I-FORMAT W/ DPU -^ Use a general instruction register that can act as R- or I-Format.
im va 16
(^6) ROMOpcodes
Instruction Register (IR)
Y^ ZX rawa ra ControlSignals Opcode
INTRO. TO COMP. ENG.CHAPTER XIII-20 R.M. Dansereau; v.1.
ISA
- MIPS ASSEMBLY-IMMEDIATE INSTRUCTIONS-INSTRUCTION FORMATS-R-FORMAT W/ DPU -^ If we have an I-format instruction, we link the bits as follows.
opcode
Zdi
Y^ ra X^ do Y^ do
rwe
sign extension im en^
im va 16
addr data
(^6) ROMOpcodes
immediate
Notice signextension of16-bit value.