Download LW $1,32($2)

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
??‫איפה אנחנו ולאן ממשיכים‬
Input
Multiplier
Input
Multiplicand
32
Multiplicand
Register
LoadMp
32=>34
signEx
<<1
32
34
34
32=>34
signEx
1
Arithmetic
Multi x2/x1
34
34
Sub/Add
34-bit ALU
Control
Logic
32
32
2
ShiftAll
LO register
(16x2 bits)
Prev
2
Booth
Encoder
HI register
(16x2 bits)
LO[1]
2
"LO
[0]"
34
Extra
2 bits
ENC[2]
ENC[1]
ENC[0]
LoadLO
LoadHI
2
ClearHI
Single/multicycle
Datapaths
0
34x2 MUX
32
Result[HI]
LO[1:0]
32
Result[LO]
1000
CPU
IFetchDcd
WB
Exec Mem
WB
Performance
Processor-Memory
Performance Gap:
(grows 50% / year)
10
DRAM
9%/yr.
DRAM (2X/10 yrs)
1
198
2
3
198
498
1
5
198
6
198
7
198
8
198
9
199
0
199
199
2
199
399
1
4
199
5
199
699
1
7
199
8
199
9
200
0
Exec Mem
100
198
098
1
1
198
IFetchDcd
‫מבנה‬
‫מחשבים‬
“Moore’s Law”
µProc
60%/yr.
(2X/1.5yr)
Time
IFetchDcd
Exec Mem
IFetchDcd
WB
Exec Mem
WB
Pipelining
I/O
Memory Systems

1 / 52
? ‫מה נלמד‬
.‫כיצד מחשב בנוי‬
•
.‫כיצד לנתח ביצועי מחשב‬
•
) cache, pipeline( ‫נושאים המשפיעים על מעבדים חדשים‬
•
:‫הספר‬
Computer Organization &
Design The hardware/software
interface,
David A. Patterson and
John L. Hennessy.
Third Edition 2005
2 / 52
4 / 52
Levels of Representation
High Level Language
Program
Compiler
Assembly Language
Program
Assembler
Machine Language
Program
Machine Interpretation
Control Signal
Specification
°
°
:‫שפה עלית‬
v[k] = v[k+1];
‫• קל לתכנת‬
v[k+1] = temp;
‫• לא חד ערכי לשפת מכונה‬
‫• תלוי קומפיילר אופטימיזר‬
Portable •
0($2) $15, lw
4($2) $16, lw)Assembly ‫שפת סף (אסמבלי‬
‫ לשפת מכונה‬1:1 •
0($2) $16,sw
‫• יותר קריא מש' מכונה‬
4($2) $15,sw
temp = v[k];
0000
1010
1100
0101
1001
1111
0110
1000
1100
0101
1010
0000
0110
1000
1111
1001
1010
0000
0101
1100
1111
1001
1000
0110
0101
1100
0000
1010
1000
0110
1001
1111
ALUOP[0:3] <= InstReg[9:11] & MASK
5 / 52
MIPS Instruction Set
Use the
MIPS ISA
document
as the final
word on
the ISA
MIPS ISA
document
available
on Course
Web Site.
6 / 52
Instruction Sets: A Thin Interface
Syntax: ADD $8 $9 $10 Semantics: $8 = $9 + $10
Application (iTunes)
Compiler
Software
Hardware
Assembler
Operating
System
(Mac OS X)
Processor Memory I/O system
Instruction Set
Architecture
Datapath & Control
Digital Design
Circuit Design
Transistors
“R-Format”
Fieldsize: 6 bits
5 bits
5 bits 5 bits 5 bits
6 bits
Bitfield: opcode
rs
rt
rd shamt funct
Binary: 000000 01001 01010 01000 00000 100000
In Hexadecimal: 012A4020
7 / 52
‫‪Instruction Set Architecture‬‬
‫• יש דמיון רב בין שפות המכונה השונות‬
‫• אנו נלמד את שפת המכונה של מעבד ה‪ MIPS -‬שפותח‬
‫בתחילת שנות ה‪ ( 80 -‬משתמשים בו ב‪Silicon -‬‬
‫‪.) Graphics,NEC,Sony‬‬
‫• ‪RISC v. CISC‬‬
‫– ‪Reduced Instruction Set Computer - MIPS‬‬
‫– ‪8086 - Complex Instruction Set Computer‬‬
‫המוטו “פחות זה יותר“‬
‫•‬
‫כלומר‪ :‬סט פקודות קטן יותר‪ ,‬כאשר הפקודות עצמן פשוטות יותר‪ ,‬מאפשר‬
‫ביצועים טובים יותר‪ .‬זאת היות והחומרה הדרושה לביצוע הפקודות הנ”ל תהיה‬
‫פשוטה יותר המהירות תגדל ושטח הסיליקון הדרוש (=המחיר) יצטמצם‪.‬‬
‫‪8 / 52‬‬
Hardware implements semantics ...
Syntax: ADD $8 $9 $10 Semantics: $8 = $9 + $10
Instruction
Fetch
Instruction
Decode
Operand
Fetch
Execute
Result
Store
Next
Instruction
Fetch next inst from memory:012A4020
opcode
rs
rt
rd
shamt funct
Decode fields to get : ADD $8 $9 $10
“Retrieve” register values: $9 $10
Add $9 to $10
Place this sum in $8
Prepare to fetch instruction that
follows the ADD in the program.
9 / 52
Memory Instructions: LW $1,32($2)
Instruction
Fetch
Instruction
Decode
Operand
Fetch
Execute
Result
Store
Next
Instruction
Fetch the load inst from memory
opcode
rs
rt
offset
“I-Format”
Decode fields to get : LW $1, 32($2)
“Retrieve” register value: $2
Compute memory address: 32 + $2
Load memory address contents into: $1
Prepare to fetch instr that follows the
LW in the program. Depending on load
semantics, new $1 is visible to that
instr, or not until the following instr
(”delayed loads”).
10 / 52
Branch Instructions: BEQ $1,$2,25
Instruction
Fetch
Fetch branch inst from memory
opcode
Instruction
Decode
Operand
Fetch
Execute
Result
Store
Next
Instruction
rs
rt
offset
“I-Format”
Decode fields to get: BEQ $1, $2, 25
“Retrieve” register values: $1, $2
Compute if we take branch: $1 == $2 ?
ALWAYS prepare to fetch instr that
follows the BEQ in the program
(”delayed branch”). IF we take branch,
the instr we fetch AFTER that
instruction is PC + 4 + 100.
PC == “Program
Counter”
11 / 52
Why ISA is important?
Code size •
– long instructions may take more time to be fetched
– Requires larges memory (important in small devices, e.g., cell
phones)
Number of instructions (IC) •
– Reducing IC reduce execution time (assuming same CPI and
frequency)
Code “simplicity” •
– Simple HW implementation which leads to higher frequency and
lower power
– Code optimization can better be applied to “simple code”
12 / 52
The impact of the ISA
RISC vs CISC
13 / 52
CISC Processors
CISC - Complex Instruction Set Computer •
The idea: a high level machine language •
Characteristic •
– Many instruction types, with many addressing modes
– Some of the instructions are complex:
• Perform complex tasks
• Require many cycles
– ALU operations directly on memory
• Usually uses limited number of registers
– Variable length instructions
• Common instructions get short codes 
save code length
Example: x86 •
14 / 52
CISC Drawbacks
Compilers do not take advantage of the complex instructions and the
complex indexing methods
Implement complex instructions and complex addressing modes •
 complicate the processor
 slow down the simple, common instructions
 contradict Amdahl’s law corollary:
•
Make The Common Case Fast
Variable length instructions are real pain in the neck: •
– It is difficult to decode few instructions in parallel
• As long as instruction is not decoded, its length is
unknown
 It is unknown where the instruction ends
 It is unknown where the next instruction starts
– An instruction may not fit into the “right behavior” of the
memory hierarchy (will be discussed next lectures)
Examples: VAX, x86 (!?!) •
15 / 52
RISC Processors
RISC - Reduced Instruction Set Computer •
The idea: simple instructions enable fast hardware •
Characteristic •
– A small instruction set, with only a few instructions formats
– Simple instructions
• execute simple tasks
• require a single cycle (with pipeline)
– A few indexing methods
– ALU operations on registers only
• Memory is accessed using Load and Store
instructions only.
• Many orthogonal registers
• Three address machine: Add dst, src1, src2
– Fixed length instructions
Examples: MIPSTM, SparcTM, AlphaTM, PowerPCTM •
16 / 52
RISC Processors (Cont.)
Simple architecture  Simple micro-architecture •
– Simple, small and fast control logic
– Simpler to design and validate
– Room for on die caches: instruction cache + data
cache
• Parallelize data and instruction access
– Shorten time-to-market
Using a smart compiler •
– Better pipeline usage
– Better register allocation
Existing RISC processor are not “pure” RISC •
– e.g., support division which takes many cycles
17 / 52
‫‪RISC v. CISC‬‬
‫‪ - I‬מספר פקודות בתוכנית‬
‫‪ –T‬הזמן לביצוע פקודה‬
‫‪RISC:‬‬
‫‪T‬‬
‫* ‪I‬‬
‫‪CISC:‬‬
‫‪I * T‬‬
‫‪18 / 52‬‬
So, what is better, RISC or CISC
Today CISC architectures (X86) are running as fast as RISC (or even •
faster)
The main reasons are: •
– Translates CISC instructions into RISC instructions (ucode)
– CISC architecture are using “RISC like engine”
We will discuss this kind of solutions later on in this course. •
19 / 52
‫כלל תכנון מספר ‪Simplicity favors Regularity :1‬‬
‫פעולות אריתמטיות‬
‫• ‪MIPS‬‬
‫‪addi a,b,100 # a=b+100‬‬
‫‪add a,b,c‬‬
‫‪# a=b+c‬‬
‫• ‪8086‬‬
‫‪ADD EAX,B # EAX= EAX+B‬‬
‫אנו מעדיפים מנגנון פשוט עם פקודות מינימליות כמו‬
‫‪ R3 = R1 op R2‬עלפני מחשב שקל יותר לתכנות עם כמה משתנים שרוצים‬
‫בפקודה למשל‬
‫)‪R5 = ( R1 op1 R2) op2 (R3 op3 R4‬‬
‫אבל קשה מאוד לתכנן ולממש אותו‪.‬‬
‫‪20 / 52‬‬
‫כלל תכנון מס’ ‪Smaller is faster :2‬‬
‫•‬
‫•‬
‫•‬
‫•‬
‫•‬
‫נאפשר פעולות אריתמטיות רק על רגיסטרים‪.‬‬
‫האופרנדים יכולים להיות רגיסטר או קבוע (אחד)‪.‬‬
‫סה”כ יש ‪ 32‬רגיסטרים‪spilling .‬‬
‫רגיסטר ‪word = 32 bits = 4 bytes‬‬
‫קונבנציות הרגיסטרים מסומנים ע”י ‪.$‬‬
‫או ‪ 0$ - 31$‬או ע”י שמות‬
‫הקשורים לתפקידיהם‬
‫משתנים של ‪$s0,$s1 ... - C‬‬
‫בתכנית‪ .‬יש הסכמה על‬
‫תפקידי הרגיסטרים הנ”ל בכל משתנים זמניים ‪$t1,$t2 … -‬‬
‫התכניות בשפת ‪ C‬למשל‪.‬‬
‫… ‪$1,$2‬‬
‫עמ’ ‪110‬‬
‫דוגמא‪:‬‬
‫‪$s0=f, $s1=g, $s2=h, $s3=k, $s4=j‬‬
‫‪21 / 52‬‬
‫הדוגצא מתארת איך המשפט‬
‫( ‪ f=(g+h)-(k+j‬מיוצג ע”י פקודות‬
‫אסמבלי‪.‬‬
‫הרגיסטרים הם ליבו של הפרוססור‪.‬‬
‫הגישה אליהם מהירה מלזיכרון‪ .‬נגשים‬
‫‪,‬בוזמנית” ל‪ 3-‬רגיסטרים‪ :‬מ‪ 2-‬קוראים‬
‫ולשלישי כותבים‪.‬‬
‫‪f=(g+h)-(k+j) #‬‬
‫‪add $t0,$s1,$s2‬‬
‫‪add $t1,$s3,$s4‬‬
‫‪sub $s0, $t0, $t1‬‬
Policy of Use Conventions
Name Register number
$zero
0
$v0-$v1
2-3
$a0-$a3
4-7
$t0-$t7
8-15
$s0-$s7
16-23
$t8-$t9
24-25
$gp
28
$sp
29
$fp
30
$ra
31
Usage
the constant value 0
values for results and expression evaluation
arguments
temporaries
saved
more temporaries
global pointer
stack pointer
frame pointer
return address
‫ השמור לאסמבלר‬$ at = $1
‫רגיסטרים נוספים הם‬
‫ השמורים למערכת ההפעלה‬$ k0 , $ k1 = $ 26, $ 27 -‫ו‬
22 / 52
‫הזיכרון‬
.‫ מערך גדול‬- ‫• הזיכרון‬
.‫ אינדקס למערך‬- ‫• כתובת לזיכרון‬
.‫ האינדקס בבתים‬- Byte addressing •
0
1
2
3
4
5
6
...
8 bits of data
8 bits of data
‫גודל הזיכרון המכסימלי‬
8 bits of data
230 words = 232 bytes
•
8 bits of data
8 bits of data
8 bits of data
8 bits of data
23 / 52
‫פניה לזיכרון‬
Load and Store ‫פקודות‬
LW - ‫טוענים מילה אבל הכתובת בזיכרון היא בבתים‬
lw $s1,100($s2)
# $s1=Memory[$s2+100]
offset = ‫מקום במערך‬
sw $s1,100($s2)
base register = ‫מצביע למערך‬
# Memory[$s2+100]=$s1
:‫דוגמא נוספת‬
Word ‫ מערך של‬- save
muli
lw
$9,$19,4
$8,save($9)
base register = ‫מצביע למערך‬
•
•
•
# Temporary reg $9:=i*4
# Temporary reg $8:=save[i]
= ‫מקום במערך‬
offset
24 / 52
byte ‫קריאה של‬
lb (load byte( ‫• ישנם גם פקודות כמו‬
sb(store byte( -‫ו‬
ASCII - ‫ ב‬byte ‫ גודל‬:char ‫• שימושי לקריאת‬
American Standard Code For Information
Interchange
.‫ בתים‬2 ‫ הוא‬char ‫ גודל‬- Unicode -‫• ב‬
25 / 52
‫גישה לזיכרון‬
MIPS = Big endian
A
0
32 bits of data
4
8
12
16
A[0]
A[1]
A[2]
0
1
2
3
INTEL = Little endian
3
2
1
0
C code:
A[2] = h + A[2];
MIPS code:
lw $t0, 8($s3)
add $t0, $s2,$t0
sw $t0, 8($s3)
:‫• דוגמא‬
words ‫ מערך של‬A
$ s3 -‫ ב‬A ‫כתובת‬
$ s2-‫ נמצא ב‬h
# $t0=$s3[8]
# $t0=$s2+$t0
# $s3[8]=$t0
27 / 52
‫שפת המכונה‬
.‫ ביט‬32 ‫ בגודל זהה של‬MIPS -‫• הפקודות ב‬
.‫ בתים‬17-‫ עד ל‬1-‫ פקודות בגודל משתנה מ‬- 8086 - ‫• ב‬
:‫דוגמא‬
add $s1,$s2,$s3
# $s1=$17,$s2=$18, $s3=$19
‫מסוג‬
R-type
‫פורמט הפקודה‬
31
0
0
18
000000 10010
19
10011
17
10001
op
rs
rt
rd
6
5
5
5
op - opecode
rt- register source no 2
funct - function
0
00000
32
100000
shamt
funct
5
6
rs - register source
rd - register destination
shamt - shift amount
28 / 52
‫ תכנון טוב דורש לעיתים פשרות‬: 3 ’‫כלל תכנון מס‬
.‫ דמיון בין הפקודות‬.‫• צמצום מספר סוגי הפקודות השונים‬
6
5
op
rs
rt
rd
I
op
rs
rt
16 bit address
J
op
R
•
5
5
5
shamt
6
funct
26 bit address
Example: lw $s1, 32($s2)
6
5
5
35
18
17
op
rs
rt
# $s1 =$17, $s2=18
5
5
6
32
16 bit number
29 / 52
‫התוכנית בזיכרון‬
‫• התוכנית נשמרת בזיכרון בדיוק כמו נתונים‬
‫‪memory for data, programs,‬‬
‫‪compilers, editors, etc.‬‬
‫‪Memory‬‬
‫‪Processor‬‬
‫ביצוע תוכנית‬
‫• רגיסטר מיוחד ‪ PC - Program Counter‬שומר את‬
‫כתובת הפקודה‪.‬‬
‫• קוראים מילה שלמה מהזיכרון‪.‬‬
‫• מקדמים את ה ‪.PC -‬‬
‫‪30 / 52‬‬
Branch vs Jump
‫ קפיצה “אבסולוטית” ללא תנאים‬- Jump •
j
label
‫ קפיצה יחסית מותנת‬- Branch •
bne $1,$2,label
• Example:
if (i!=j)
h=i+j;
else
h=i-j;
# $1!=$2 go to label
($s3=h
$s4 =i
$s5=j )
beq $s4, $s5, Lab1
add $s3, $s4, $s5
j Lab2
Lab1: sub $s3, $s4, $s5
Lab2: ...
31 / 52
Addresses in Branches and Jumps
•
Instructions:
bne $t4,$t5,Label
beq $t4,$t5,Label
j Label
Next instruction is at Label if $t4!= $t5
Next instruction is at Label if $t4 = $t5
Next instruction is at Label
Formats:
I
op
J
op
rs
rt
•
16 bit address
26 bit address
‫מכאן‬
.‫ מילים‬2^16 ‫ קפיצה יחסית בגבולות‬- branch
.‫ יהיו קפיצות לוקאליות‬branches -‫ רוב ה‬:‫הנחה‬
Beq $s1,$s2,25
# if ($s1 ==$s2) go to PC +4 +25*4
•
32 / 52
‫דוגמא לקידוד‬
Loop: lw
$8, save($19) # $8=save[i]
bne $8, $21,Exit #Goto Exit if save[i]<> k
add $19,$19,$20
j
Loop
# i:=i+j
# Goto Loop
Exit:
SAVE - 1000
80,000
35
19
8
1000
80,004
5
8
21
2
80,008
0
19
20
80,012
2
19
0
32
20,000
80,016
33 / 52
‫כלל שחשוב לזכור‬
‫באסמבלי של ‪ MIPS‬מקודדים‪:‬‬
‫כתובת ‪ code‬במילים‬
‫כתובת ‪ data‬בבתים‬
‫כאשר מעבד ‪ MIPS‬ניגש לזיכרון הוא מבקש את הכתובת בבתים‬
‫‪34 / 52‬‬
Branch-if-less-than?
Slt- set less then
slt $t0, $s1, $s2
if
$s1 < $s2 then
$t0 = 1
else
$t0 = 0
:blt ‫• ניתן לבנות את‬
Blt –branch less then
slt $at,$s0,$s1
bne $at,$zero, Less
blt $s0,$s1, Less
# $t0 gets 1 if $s0<$s1
# go to Less if $t0 != 0
Pseudo instruction ‫ היא‬blt
•
Assembler uses $at (= $1) for pseudo instructions •
35 / 52
Pseudo instruction -‫דוגמאות נוספות ל‬
bne $8,$21,far_adrs
- ‫שקול ל‬
beq $8,$21,nxt
j far_adrs
nxt:
move $t1,$s4
- ‫שקול ל‬
add $t1,$s4,$zero
36 / 52
‫כלל תכנון מס’ ‪ : 4‬בנה את המקרה השכיח ‪ -‬מהיר‬
‫• הרבה פעולות ארתמטיות מתבצעות עם קבועים‬
‫קטנים‪.‬‬
‫לכן הוקצו פקודות מיוחדות לחיבור חיסור והשוואה של קבועים קטנים‪addi, :‬‬
‫‪slti, andi, ori, xori‬‬
‫‪addi $29, $29, 4‬‬
‫• קבועים גדולים‬
‫נחשב ב‪ 2-‬פקודות‪ ,‬כלומר לאט יותר‪ ,‬אבל נדרשת רק‬
‫‪$t0=101010101010101011111111111111111‬‬
‫פקודה אחת נוספת‪lui :‬‬
‫‪lui $t0,1010101010101010‬‬
‫‪0000000000000000‬‬
‫‪1010101010101010‬‬
‫‪# $t0=2^16*(101010101010101010)2‬‬
‫‪ori $t0,$t0, 1111111111111111‬‬
‫‪1111111111111111‬‬
‫‪0000000000000000‬‬
‫‪# $t0=$t0||1010101010101010‬‬
‫…‪$to=10101010101010101111111111111‬‬
‫‪37 / 52‬‬
‫‪1111111111111111‬‬
‫‪1010101010101010‬‬
‫לסיכום‬
MIPS operands
Name
32 registers
Example
Comments
$s0-$s7, $t0-$t9, $zero, Fast locations for data. In MIPS, data must be in registers to perform
$a0-$a3, $v0-$v1, $gp,
arithmetic. MIPS register $zero always equals 0. Register $at is
$fp, $sp, $ra, $at
reserved for the assembler to handle large constants.
Memory[0],
2
30
memory Memory[4], ...,
words
Memory[4294967292]
Accessed only by data transfer instructions. MIPS uses byte addresses, so
sequential words differ by 4. Memory holds data structures, such as arrays,
and spilled registers, such as those saved on procedure calls.
38 / 52
‫תרגיל‬
:MIPS ‫ ושני תרגומים שלו לשפת האסמבלי של‬,C-‫ לפניך קוד הכתוב ב‬:1 ‫שאלה‬
while (save[i]!=k) do
i=i+j ;
save:array [ 0..100] of word
.k-‫ כ‬$21-‫ ו‬j-‫ כ‬$20 ‫ ו‬i ‫ מתפקד כ‬$19
:‫תרגום ראשון‬
Loop: muli $9,$19,4
# Temporary reg $9:=i*4
lw
$8,save($9)
# Temporary reg $8:=save[i]
beq $8,$21,Exit
# Goto Exit if save[i] = k
add $19,$19,$20
# i:=i+j
j
Loop
# Goto Loop
Exit:
•
39 / 52
‫המשך תרגיל‬
:‫• תרגום שני‬
muli
lw
beq
Loop: add
muli
lw
bnq
Exit:
$9,$19,4
# Temporary reg $9:=i*4
$8,save($9) # Temporary reg $8:=save[i]
$8,$21,Exit # Goto Exit if save[i] = k
$19,$19,$20 # i:=i+j
$9,$19,4
# Temporary reg $9:=i*4
$8,save($9) # Temporary reg $8:=save[i]
$8,$21,Loop # Goto Loop if save[i]!=k
‫ מה מספר‬,‫ פעמים‬10 ‫ בהנחה שהלולאה מתבצעת‬:‫• שאלה‬
?‫שמתבצעות בכל אחד מהתרגומים‬
‫הפקודות‬
40 / 52
Compiler
A.asm
compiler
A.obj
P.exe
loader
Memory
linker
B.asm compiler
B.obj
C.lib
(c.obj)
41 / 52
‫תהליך הקומפילציה‬
‫‪42 / 52‬‬
‫דוגמא‬
m: .word 2
sw 7, m($3)
2
compiler
A.asm
sw $7,0($3)
2
3
A.obj
linker
4
s: .word 3,4
j
3
4
k
lw $1,s ($2)
k: add $1,$2,$3
B.asm
compiler
j 2
lw $1,0($2)
add $1,$2,$3
B.obj
sw $7,0($3)
j
3
lw $1,4($2)
add $1,$2,$3
P.exe
43 / 52
Unix -‫ ב‬Object ‫קובץ‬
•
•
•
•
•
•
Object file header
text segment
data segment
relocation information
symbol table
debugging information
44 / 52
‫מבנה הזיכרון במחשב ‪MIPS‬‬
‫‪45 / 52‬‬
46 / 52
Preprocessing
• Macro:
• Code:
• After preprocessing
47 / 52
48 / 52
49 / 52
Calling procedure:
50 / 52
Callee procedure:
Sub1:
51 / 52
Single Cycle
I nstr u ctio n [ 2 5– 0]
26
Shift
l eft 2
J u mp a d dr es s [31 – 0]
28
PC +4 [31 – 2 8]
Ad d
Ad d
1
M
u
x
M
u
x
1
0
Shift
left 2
Re g D st
Ju mp
4
A LU
r e sult
0
Br a n ch
Me mR e a d
I nstr uctio n [31 – 2 6]
C o ntr ol
Me mto Reg
AL U Op
Me m Write
AL U Sr c
Re g Writ e
I nstr uctio n [25 – 2 1]
PC
Re a d
addr e ss
I nstr uctio n [20 – 1 6]
I n str ucti o n
[3 1– 0]
Instr ucti o n
me mor y
Rea d
r e gi st er 1
I nstr uctio n [15 – 1 1]
0
M
u
x
1
Re a d
data 1
Rea d
r e gi st er 2
Regi ster s Re a d
Wri te
data 2
r e gi st er
Z er o
0
M
u
x
1
Wri te
dat a
AL U
AL U
r e sult
Ad dr e ss
Dat a
me mory
Writ e
d ata
I nstr uctio n [15 – 0]
16
Re a d
dat a
1
M
u
x
0
32
Sig n
ex te nd
AL U
co ntr ol
I n str u cti on [5– 0]
52 / 52
Related documents