• Aucun résultat trouvé

1 Instruction Sets A Simple MicroprocessorRISC Processors

N/A
N/A
Protected

Academic year: 2022

Partager "1 Instruction Sets A Simple MicroprocessorRISC Processors"

Copied!
4
0
0

Texte intégral

(1)

1 A Simple Microprocessor

RISC Processors

Architectures and complex instruction sets:

Long design time (control circuit,…)

Fast evolution of technology not fully taken advantage of

Operands in memory

long access time

More complex compilers

RISC (Reduced Instruction Set Computer):

Few instructions, few addressing modes, few data formats, fixed instruction size.

Operands in registers only for fast access.

Instructions decomposed into pipeline stages

More simple design, low cycle time.

Instruction Sets

The instruction set describes an abstract version of a processor (ISA: Instruction Set Architecture).

An instruction set can correspond to many different implementations.

Example: x86 ISA and Intel processors.

The instruction set must be able to:

Access memory

Perform arithmetic and logic operations

Control the program flow (branching)

(2)

2

Designing a Simple Processor

«

Speficifactions » of the LC-2

Use a 16-bit word:

• Circuit size and speed constraints

• Memory size

A RISC processor (load/store, register operands, fixed- size instructions)

Minimum ISA:

• ALU: addition and minimum number of logic operations;

operands: either registers, or immediate;

• Memory: absolute addressing, index addressing

• Control: unconditional branches, procedure calls, conditional branches (possible tests: zero, positive, negative); system calls; direct and indexed addressing

Questions:

• What ISA format ?

• What implementation for the processor ?

Rd

Instruction Set

Instructions size = balance between

Number of instructions/operands

Number of registers

Memory size

Control circuit complexity

Example: 16 bits for data word/instructions:

16 instructions →4 opcode bits.

12 bits for operands (3 registers for ALU instructions; example: ADD Rd←Rs1,Rs2)

maximum 4 bits per register number (16 registers)

basesize (LOAD Rd←Rs1,base)

depends on register size (4 bits for 16 registers, 6 bits for 8 registers) Predict the most important characteristics of upcoming architectures:

Adding new instructions

Increasing the number of registers

Facilitate memory access (large base size)

...

Opcode

log2(nb instr.)

Rs1 Rs2

Rd Rs base

Opcode

log2(nb reg.) ADD

LOAD

Instruction Set Design

Arithmetic and logic instructions:

• Be able to write any logic expression.

• Be able to make any arithmetic computation.

• Two addressing modes:

Immediate

Direct

•ADD Rd←Rs1,Rs2

Rd←Rs1+Rs2

•AND Rd←Rs1,Rs2

Rd←ET(Rs1,Rs2)

•ADD Rd←Rs,valeur

Rd←Rs+valeur

•AND Rd←Rs,valeur

Rd←ET(Rs,valeur)

•NOT Rd←Rs

Rd←NOT(Rs)

(3)

3 Instruction Set Design

Memory access:

• Load

• Store

• 3 addressing modes:

Direct

Indexed

Immediate

•LD Rd←M(adresse)

•ST Rs→M(adresse)

Direct addressing

Address = PC[15:9],offset[8:0]

•LDR Rd←Rs,index

Direct addressing

Address = Rs + index

•STR Rs2→Rs1,index

Direct addressing

Address = Rs1 + index

•LEA Rd←adresse

Direct addressing

Rd←PC[15:9],offset[8:0]

Instruction Set Design

Control:

• Unconditional branch

• Conditional branch

• Procedure call and return

• System call Condition bits:

• 1-bit registers for conditional branches

• Updated by instructions upon writing into registers

• N(Negative), P(Positive), Z (Zéro).

• JMP/JSR L,offset

Direct addressing

If L=1 R7←PC

PC←PC[15:9],offset[8:0]

• JMPR/JSRR L,Rs,base

Indexed addressing

If L=1 R7←PC

PC←Rs + base

• BR nzpoffset

Direct addressing

PC←PC[15:9],offset[8:0]

Test condition registers if n,z and/or p bit is 1

Condition value = N&n | P&p | Z&z

• RET

PC←R7

• TRAP trapvect8

Call a system subroutine

R7←PC

PC←@(00000000trapvec8)

1001 0101 0001 Opcode

NOT AND ADD Instruction

ALU

Instruction Set Format

≤16 instructions →4 opcode bits.

Opcode:

• Simplify control circuit

• Possible ISA extensions

Opcode Operands

4 bits 12 bits

Contrôle

STR 0111

ST 0011 1110 0110 0010 Opcode

LEA LDR LD Instruction

Mémoire RET

1101

TRAP 1111

1100 0100 0000 Opcode

JMPR/JSRR JMP/JSR

BR Instruction

(4)

4

Instruction Set Format

0 1 2 3 4 5 6 7 8 9 1 0 1 1

Rs2 0 0 0 Rs1 Rd

0 1 2 3 4 5 6 7 8 9 1 0 1 1

offset 0

0 L

0 1 2 3 4 5 6 7 8 9 1 0 1 1

valeur 1

Rs1 Rd

• ADD, AND:

• NOT:

1 1

1 1

0 1 2 3 4 5 6 7 8 9 1 0 1 1

1 1 Rs Rd

8 registers

3 bits.

0 1 2 3 4 5 6 7 8 9 1 0 1 1

offset p

z n

• BR:

• TRAP:

0 1 2 3 4 5 6 7 8 9 1 0 1 1

trapvect8 0

0 0 0

• JSR/JMP:

index 0 1 2 3 4 5 6 7 8 9 1 0 1 1

Rs 0 0 L

• JSRR/JMPR:

• RET:

0 1 2 3 4 5 6 7 8 1 9 0 1 1

0 0 0 0 0 0 0 0 0 0 0

0

• LD/ST:

0 1 2 3 4 5 6 7 8 1 9 0 1 1

offset Rd/Rs

• LDR/STR:

0 1 2 3 4 5 6 7 8 9 1 0 1 1

index Rs2

Rd/Rs1

• LEA:

0 1 2 3 4 5 6 7 8 9 1 0 1 1

offset Rd

Processor Architecture

Instruction execution stages (1 stage = 1 processor cycle):

1.Send instruction address 2.Fetch instruction 3.Store instruction 4.Decode (fetch operands) 5.Compute address 6.Fetch operands from

memory 7.Execution 8.Write result

ADD R5, R4, #3

LC-2

Références

Documents relatifs

For such a multi-server system, we in- vestigate load balancing in two different settings: (i) the centralized setting in which a dispatcher assigns the server to an incoming

pièces du dessus de table en se servant des loquets de sécurité lors de l'utilisation d'extension.

- Dans le cas d’une barre de charge pas de niveau, d’une mauvaise fermeture du store ou des coudes de bras décalés, un réglage du store doit être réalisé. - Ne pas utiliser

When bit 7 of the instruction is a ZERO, the least significant four bits of the general register selected by XR, contains the shift count.. When bit 7 is a ONE, the K

The counter is loaded on the ClK pulse after a control byte and initial count are written to the counter.. OUT goes low N ClK pulses after the initial count

When a single EOM (Buff,er Control mode) sets up the channel and interlace with a POT instruction following, the programmer cannot step through the sequence since

b) Détermine l’équation sinusoïdale qui représente le mieux le graphique en utilisant vos listes.. Le cœur pompe le sang partout dans le corps. Lorsque le sang quitte le cœur, il

Appuyez sur le bouton max/min pour afficher la température maximale atteinte dans une période de 24h Press the max/min button to display the maximum temperature achieved in a