Docsity

Single Cycle Implementation, Schemes and Mind Maps of Computer Architecture and Organization

Partial preview of the text

Download Single Cycle Implementation and more Schemes and Mind Maps Computer Architecture and Organization in PDF only on Docsity!

INTRO. TO COMP. ENG.CHAPTER XII-1SINGLE CYCLE DPU R.M. Dansereau; v.1.

•CHAPTER XII

CHAPTER XII

SINGLE CYCLE DATAPATH UNIT

READ SINGLE CYCLE DATAPATH FREE-DOC ON COURSE WEBPAGE

INTRO. TO COMP. ENG.CHAPTER XII-14 R.M. Dansereau; v.1.

SINGLE CYCLE DPU

INCLUDING MEMORY

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

5 5 32x32RF

rwe

X bus

Y bus

Z bus

A^ ALU

B

STen a/s

LF^42

asl 2

Clk^

im en^ im va immediate register

addr RAM/ROMdata

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.

ADDER/SUBTRACTOR

GENERAL UNIT DIAGRAM

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.

A^ unit

B F

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.

LOGICAL UNIT^ INTRODUCTION

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.

-^ 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.

SHIFT UNIT GENERAL UNIT DIAGRAM

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

A^ shiftunit^ B.

B F

1+log^2 n n n

ST

enable^

Enable unit (

or disable unit (

Shift type0 = logical1 = arithmetic2 = rotate

n -bit valueto shift

Distance of shift(signed #)+’ive = right-’ive = left

INTRO. TO COMP. ENG.CHAPTER XII-10 R.M. Dansereau; v.1.

SINGLE CYCLE DPU

ARITHMETIC LOGIC UNIT

SINGLE CYCLE DPU

- SINGLE CYCLE DPU-ADD/SUBTRACT MACHINE-BASIC SINGLE CYCLE DPU-COMPUTATION EXAMPLES -^ Since only one of

AU ,^ SU

, or^ LU^

will be active at a time in this architecture,

we will combine to form an

arithmetic logic unit

(ALU).

3232 A B SUSTen 32 F

3232 A B AUen a/s^32 F

A^ ALU

B F

(^3232) en a/s 32

3232 A B LULFen 32 F

LF^4 ST^2

asl 2 asl line00 - AU01 - SU10 - LU

INTRO. TO COMP. ENG.CHAPTER XII-13 R.M. Dansereau; v.1.

SINGLE CYCLE DPU

IMMEDIATE REGISTER

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

MICROCODE

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.

R3^ R

R2 +=

M R5 [^ ]^

R9 =

INTRO. TO COMP. ENG.CHAPTER XII-17 R.M. Dansereau; v.1.

SINGLE CYCLE DPU

WRITING TO MEMORY

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

[^ ]^ M R

= R

INTRO. TO COMP. ENG.CHAPTER XIII-3 R.M. Dansereau; v.1.

PROGRAM PATH^ TRANSLATING CODE

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.

INSTRUCTIONS INSTRUCTION FORMATS

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

Z^

X^ Y

other potential bits

opcode

Z^

X^

immediate value

INTRO. TO COMP. ENG.CHAPTER XIII-21 R.M. Dansereau; v.1.

INSTRUCTIONS INSTRUCTION REGISTER

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

DPU

Instruction Register (IR)

addr ROMRAM/datar/w msel^

Y^ ZX rawa ra ControlSignals Opcode

INTRO. TO COMP. ENG.CHAPTER XIII-20 R.M. Dansereau; v.1.

INSTRUCTIONS^ I-FORMAT W/ DPU

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

Z^ X

Zdi

Y^ ra X^ do Y^ do

5 5 ZX^ wa^ ra 32x32RF

rwe

32 X bus 32

Y bus

Clk^ Z bus

sign extension im en^

im va 16

addr data

(^6) ROMOpcodes

DPU

immediate

Notice signextension of16-bit value.