-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotes.txt
More file actions
55 lines (34 loc) · 2.04 KB
/
Notes.txt
File metadata and controls
55 lines (34 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
MIPS Assembly/Instruction Formats: https://en.wikibooks.org/wiki/MIPS_Assembly/Instruction_Formats#I_Instructions
R-format:
e.g.:add $s1, $s2, $s3
opcode rs rt rd shift(shamt) funct
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
I-format:
e.g.: addi $s1, $s2, 100
J-format:
e.g.: jump LABEL
----------------------------------------------------------------------------------------------------------------------------------------
ALUSRC:
The MIPS architecture add instruction adds either two registers, or a register and a 16-bit immediate value that is encoded into the add instruction itself.
ALUSrc controls a mux that determines whether the second operand to the ALU is a register, or the 16-bit immediate value.
Reference from:https://tw.answers.yahoo.com/question/index?qid=20121107092830AA9S3Zx
----------------------------------------------------------------------------------------------------------------------------------------
ALUOp Action needed by ALU
00 Addition (for load and store)
01 Subtraction (for beq)
10 Determined by funct field (R-type instruction)
11 Not used
Opcode ALUOp operation functField ALUaction ALU cntl
LW 00 loadWord xxxxxx add 010
SW 00 storeWord xxxxxx add 010
BEQ 01 branchEqual xxxxxx subtract 110
R-type 10 add 100000 add 010
R-type 10 subtract 100010 subtract 110
R-type 10 AND 100100 and 000
R-type 10 OR 100101 or 001
R-type 10 SLT 101010 set on less than 111
------------------------------------------------------------------------------------------------------------------------------------------
More information from Zhihu:
Simple explanation of how 1+1=2 works in computing.
如何通俗的解释计算机是如何实现1+1=2计算的? - Barbirolli的回答 - 知乎
https://www.zhihu.com/question/29707696/answer/71747103